@infrab4a/connect-angular 5.0.0-beta.6 → 5.0.0-beta.61

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.
Files changed (70) hide show
  1. package/angular-connect.module.d.ts +13 -8
  2. package/angular-firestore.module.d.ts +1 -2
  3. package/angular-vertex-search.module.d.ts +9 -0
  4. package/consts/index.d.ts +2 -0
  5. package/consts/persistence.const.d.ts +1 -0
  6. package/consts/vertex-config.const.d.ts +1 -0
  7. package/esm2022/angular-connect.module.mjs +38 -5
  8. package/esm2022/angular-elastic-search.module.mjs +1 -1
  9. package/esm2022/angular-firebase-auth.module.mjs +1 -1
  10. package/esm2022/angular-firestore.module.mjs +39 -28
  11. package/esm2022/angular-hasura-graphql.module.mjs +24 -2
  12. package/esm2022/angular-vertex-search.module.mjs +34 -0
  13. package/esm2022/consts/category-structure.mjs +1 -1
  14. package/esm2022/consts/default-shop.const.mjs +1 -1
  15. package/esm2022/consts/es-config.const.mjs +1 -1
  16. package/esm2022/consts/firebase-const.mjs +1 -1
  17. package/esm2022/consts/hasura-options.const.mjs +1 -1
  18. package/esm2022/consts/index.mjs +3 -1
  19. package/esm2022/consts/persistence.const.mjs +2 -0
  20. package/esm2022/consts/storage-base-url.const.mjs +1 -1
  21. package/esm2022/consts/vertex-config.const.mjs +2 -0
  22. package/esm2022/helpers/index.mjs +1 -1
  23. package/esm2022/helpers/mobile-operation-system-checker.helper.mjs +1 -1
  24. package/esm2022/index.mjs +2 -1
  25. package/esm2022/persistence/cookie-data-persistence.mjs +22 -0
  26. package/esm2022/persistence/data-persistence.mjs +2 -0
  27. package/esm2022/persistence/index.mjs +3 -0
  28. package/esm2022/services/auth.service.mjs +1 -1
  29. package/esm2022/services/cart.service.mjs +15 -12
  30. package/esm2022/services/catalog/adapters/category-structure.adapter.mjs +1 -1
  31. package/esm2022/services/catalog/adapters/index.mjs +1 -1
  32. package/esm2022/services/catalog/adapters/new-category-structure.adapter.mjs +6 -4
  33. package/esm2022/services/catalog/adapters/old-category-structure.adapter.mjs +1 -1
  34. package/esm2022/services/catalog/catalog.service.mjs +89 -33
  35. package/esm2022/services/catalog/category.service.mjs +1 -1
  36. package/esm2022/services/catalog/enums/index.mjs +1 -1
  37. package/esm2022/services/catalog/enums/product-sorts.enum.mjs +1 -1
  38. package/esm2022/services/catalog/index.mjs +1 -1
  39. package/esm2022/services/catalog/models/category-with-tree.model.mjs +1 -1
  40. package/esm2022/services/catalog/models/index.mjs +1 -1
  41. package/esm2022/services/catalog/types/index.mjs +1 -1
  42. package/esm2022/services/catalog/types/product-sort.type.mjs +1 -1
  43. package/esm2022/services/catalog/wishlist.service.mjs +140 -18
  44. package/esm2022/services/checkout-subscription.service.mjs +18 -21
  45. package/esm2022/services/checkout.service.mjs +13 -16
  46. package/esm2022/services/coupon.service.mjs +60 -21
  47. package/esm2022/services/helpers/index.mjs +1 -1
  48. package/esm2022/services/helpers/util.helper.mjs +1 -1
  49. package/esm2022/services/home-shop.service.mjs +4 -4
  50. package/esm2022/services/index.mjs +1 -1
  51. package/esm2022/services/order.service.mjs +1 -1
  52. package/esm2022/services/shipping.service.mjs +1 -1
  53. package/esm2022/services/types/index.mjs +1 -1
  54. package/esm2022/services/types/required-checkout-data.type.mjs +1 -1
  55. package/esm2022/services/types/required-checkout-subscription-data.type.mjs +1 -1
  56. package/esm2022/services/types/shipping-methods.type.mjs +1 -1
  57. package/esm2022/types/firebase-app-config.type.mjs +1 -1
  58. package/esm2022/types/index.mjs +1 -1
  59. package/fesm2022/infrab4a-connect-angular.mjs +479 -145
  60. package/fesm2022/infrab4a-connect-angular.mjs.map +1 -1
  61. package/index.d.ts +1 -0
  62. package/package.json +5 -5
  63. package/persistence/cookie-data-persistence.d.ts +10 -0
  64. package/persistence/data-persistence.d.ts +6 -0
  65. package/persistence/index.d.ts +2 -0
  66. package/services/catalog/catalog.service.d.ts +7 -4
  67. package/services/catalog/wishlist.service.d.ts +16 -4
  68. package/services/checkout-subscription.service.d.ts +5 -4
  69. package/services/checkout.service.d.ts +8 -4
  70. package/services/coupon.service.d.ts +6 -2
package/index.d.ts CHANGED
@@ -2,4 +2,5 @@ export * from './angular-connect.module';
2
2
  export * from './angular-firebase-auth.module';
3
3
  export * from './angular-firestore.module';
4
4
  export * from './angular-hasura-graphql.module';
5
+ export * from './persistence';
5
6
  export * from './services';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect-angular",
3
- "version": "5.0.0-beta.6",
3
+ "version": "5.0.0-beta.61",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -9,10 +9,10 @@
9
9
  "url": "https://github.com/B4AGroup/b4a-firebase-libs"
10
10
  },
11
11
  "peerDependencies": {
12
- "@angular/common": "^17.0.0",
13
- "@angular/core": "^17.0.0",
14
- "@angular/fire": "^17.0.0-next.0",
15
- "@infrab4a/connect": "^4.3.6-beta.2",
12
+ "@angular/common": "17.2.3",
13
+ "@angular/core": "17.2.3",
14
+ "@angular/fire": "17.0.1",
15
+ "@infrab4a/connect": "4.9.7-beta.0",
16
16
  "js-cookie": "^3.0.1",
17
17
  "rxjs": "^7.8.1"
18
18
  },
@@ -0,0 +1,10 @@
1
+ import { Observable } from 'rxjs';
2
+ import { DataPersistence } from './data-persistence';
3
+ import * as i0 from "@angular/core";
4
+ export declare class CookieDataPersistence implements DataPersistence {
5
+ get(key: string): Observable<string>;
6
+ remove(key: string): Observable<void>;
7
+ set(key: string, value: string): Observable<void>;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<CookieDataPersistence, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<CookieDataPersistence>;
10
+ }
@@ -0,0 +1,6 @@
1
+ import { Observable } from 'rxjs';
2
+ export interface DataPersistence {
3
+ get(key: string): Observable<string>;
4
+ remove(key: string): Observable<void>;
5
+ set(key: string, value: string): Observable<void>;
6
+ }
@@ -0,0 +1,2 @@
1
+ export * from './cookie-data-persistence';
2
+ export * from './data-persistence';
@@ -1,4 +1,4 @@
1
- import { Category, CategoryRepository, Product, ProductGender, ProductRepository, ProductsIndex, Shops } from '@infrab4a/connect';
1
+ import { Category, CategoryRepository, Product, ProductGender, ProductRepository, ProductSearchIndex, ProductStockNotificationRepository, Shops } from '@infrab4a/connect';
2
2
  import { CategoryStructureAdapter } from './adapters';
3
3
  import { ProductSort } from './types/product-sort.type';
4
4
  import * as i0 from "@angular/core";
@@ -63,17 +63,20 @@ type FetchProductsResponse = {
63
63
  };
64
64
  export declare class CatalogService<T extends Category = Category> {
65
65
  private readonly productRepository;
66
+ private readonly productStockNotificationRepository;
66
67
  private readonly categoryRepository;
67
68
  private readonly categoryStructureAdapter;
68
69
  private readonly shop;
69
- private readonly productIndex;
70
+ private readonly productSearch;
70
71
  private productsByTerm;
71
- constructor(productRepository: ProductRepository, categoryRepository: CategoryRepository, categoryStructureAdapter: CategoryStructureAdapter, shop: Shops, productIndex: ProductsIndex);
72
+ constructor(productRepository: ProductRepository, productStockNotificationRepository: ProductStockNotificationRepository, categoryRepository: CategoryRepository, categoryStructureAdapter: CategoryStructureAdapter, shop: Shops, productSearch: ProductSearchIndex);
72
73
  fetchProducts(options: FetchProductsParams<T>): Promise<FetchProductsResponse>;
74
+ addCustomerToStockNotification(shop: Shops, productId: string, name: string, email: string): Promise<void>;
73
75
  private findCatalog;
74
76
  private buildMainFilter;
75
77
  private findCatalogAndSortByMostRevelant;
76
- private findCatalogIdsByElasticSearch;
78
+ private findCatalogAndSortByMostRevelantByTerm;
79
+ private findCatalogIdsBySearch;
77
80
  private buildFilterQuery;
78
81
  private buildSortQuery;
79
82
  private buildLimitQuery;
@@ -1,38 +1,50 @@
1
- import { CategoryFilterRepository, CategoryRepository, ProductRepository, ProductsIndex, Shops, Wishlist, WishlistRepository } from '@infrab4a/connect';
1
+ import { CategoryFilterRepository, CategoryRepository, LogRepository, PersonType, ProductRepository, ProductSearchIndex, ProductStockNotificationRepository, Shops, Wishlist, WishlistRepository } from '@infrab4a/connect';
2
2
  import { CatalogService } from './catalog.service';
3
3
  import { CategoryService } from './category.service';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class WishlistService {
6
6
  private readonly wishlistRepository;
7
7
  private readonly shop;
8
+ productRepository: ProductRepository;
9
+ private readonly productSearch;
10
+ private readonly logRepository;
8
11
  private catalogService;
9
12
  private categoryService;
10
- constructor(wishlistRepository: WishlistRepository, shop: Shops, productRepository: ProductRepository, categoryFilterRepository: CategoryFilterRepository, categoryRepository: CategoryRepository, productIndex: ProductsIndex);
13
+ constructor(wishlistRepository: WishlistRepository, shop: Shops, productRepository: ProductRepository, categoryFilterRepository: CategoryFilterRepository, categoryRepository: CategoryRepository, productStockNotificationRepository: ProductStockNotificationRepository, productSearch: ProductSearchIndex, logRepository: LogRepository);
11
14
  getCatalogService(): CatalogService<import("@infrab4a/connect").Category>;
12
15
  getCategoryService(): CategoryService;
13
- create({ personId, title, description, userFullName, userPhoto, theme, bannerUrl, }: {
16
+ create({ personId, title, description, published, userFullName, userPhoto, theme, bannerUrl, personType, personIsSubscriber, }: {
14
17
  personId: string;
15
18
  title: string;
16
19
  description: string;
20
+ published: boolean;
17
21
  userFullName: string;
18
22
  userPhoto?: string;
19
23
  theme?: string;
20
24
  bannerUrl?: string;
25
+ personType?: PersonType;
26
+ personIsSubscriber?: boolean;
21
27
  }): Promise<Wishlist>;
22
- update({ id, title, description, userFullName, userPhoto, theme, bannerUrl, }: {
28
+ update({ id, title, description, published, userFullName, userPhoto, theme, bannerUrl, personType, personIsSubscriber, }: {
23
29
  id: string;
24
30
  title: string;
25
31
  description: string;
32
+ published: boolean;
26
33
  userFullName: string;
27
34
  userPhoto?: string;
28
35
  theme?: string;
29
36
  bannerUrl?: string;
37
+ personType?: PersonType;
38
+ personIsSubscriber?: boolean;
30
39
  }): Promise<Wishlist>;
31
40
  delete(wishlistId: string): Promise<void>;
32
41
  getWishlistBySlug(slug: string): Promise<Wishlist>;
33
42
  getWishlistsByPerson(personId: string): Promise<Wishlist[]>;
34
43
  addProduct(wishlistId: string, productId: string): Promise<Wishlist>;
35
44
  removeProduct(wishlistId: string, productId: string): Promise<Wishlist>;
45
+ private findById;
46
+ private findProductById;
47
+ private createWishlistLog;
36
48
  static ɵfac: i0.ɵɵFactoryDeclaration<WishlistService, never>;
37
49
  static ɵprov: i0.ɵɵInjectableDeclaration<WishlistService>;
38
50
  }
@@ -1,18 +1,19 @@
1
- import { CheckoutSubscription, CheckoutSubscriptionRepository, Coupon, SubscriptionRepository } from '@infrab4a/connect';
1
+ import { CheckoutSubscription, CheckoutSubscriptionRepository, Coupon } from '@infrab4a/connect';
2
2
  import { Observable } from 'rxjs';
3
3
  import { RequiredCheckoutSubscriptionData } from './types';
4
+ import { DataPersistence } from '../persistence';
4
5
  import { CouponService } from './coupon.service';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class CheckoutSubscriptionService {
7
8
  private readonly checkoutSubscriptionRepository;
8
- private readonly subscriptionRepository;
9
+ private readonly dataPersistence;
9
10
  private readonly couponService;
10
- constructor(checkoutSubscriptionRepository: CheckoutSubscriptionRepository, subscriptionRepository: SubscriptionRepository, couponService: CouponService);
11
+ constructor(checkoutSubscriptionRepository: CheckoutSubscriptionRepository, dataPersistence: DataPersistence, couponService: CouponService);
11
12
  getCheckoutSubscription(checkoutData?: RequiredCheckoutSubscriptionData): Observable<CheckoutSubscription>;
12
- private createCheckoutSubscription;
13
13
  clearCheckoutSubscriptionFromSession(): Observable<void>;
14
14
  checkCoupon(nickname: string, userEmail: string): Observable<Coupon>;
15
15
  calcDiscountSubscription(coupon: Coupon): Observable<number>;
16
+ private createCheckoutSubscription;
16
17
  static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutSubscriptionService, never>;
17
18
  static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutSubscriptionService>;
18
19
  }
@@ -1,21 +1,25 @@
1
- import { Checkout, CheckoutRepository, CheckoutTypes, Coupon, OrderRepository, Shops, User, UserRepository } from '@infrab4a/connect';
1
+ import { Checkout, CheckoutRepository, CheckoutTypes, Coupon, Shops, User, UserRepository } from '@infrab4a/connect';
2
2
  import { Observable } from 'rxjs';
3
+ import { DataPersistence } from '../persistence';
3
4
  import { CouponService } from './coupon.service';
4
5
  import { RequiredCheckoutData } from './types';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class CheckoutService {
7
8
  private readonly couponService;
8
9
  private readonly checkoutRepository;
9
- private readonly orderRepository;
10
10
  private readonly userRepository;
11
11
  private readonly defaultShop;
12
- constructor(couponService: CouponService, checkoutRepository: CheckoutRepository, orderRepository: OrderRepository, userRepository: UserRepository, defaultShop: Shops);
12
+ private readonly dataPersistence;
13
+ constructor(couponService: CouponService, checkoutRepository: CheckoutRepository, userRepository: UserRepository, defaultShop: Shops, dataPersistence: DataPersistence);
13
14
  getCheckout(checkoutData?: RequiredCheckoutData): Observable<Checkout>;
14
15
  getUserByCheckout(checkoutId: string): Observable<User>;
15
16
  updateCheckoutLineItems(checkout: Partial<Checkout>): Observable<Checkout>;
16
17
  updateCheckoutUser(checkout: Partial<Checkout>): Observable<Checkout>;
17
18
  clearCheckoutFromSession(): Observable<void>;
18
- calcDiscount(coupon: Coupon): Observable<number>;
19
+ calcDiscount(coupon: Coupon): Observable<{
20
+ discount: number;
21
+ lineItems: import("@infrab4a/connect").LineItem[];
22
+ }>;
19
23
  checkCoupon(nickname: string, checkoutType: CheckoutTypes): Observable<Coupon>;
20
24
  private createCheckout;
21
25
  static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutService, never>;
@@ -1,4 +1,4 @@
1
- import { CategoryRepository, Checkout, CheckoutSubscription, CheckoutTypes, Coupon, CouponRepository, OrderRepository, Shops } from '@infrab4a/connect';
1
+ import { CategoryRepository, Checkout, CheckoutSubscription, CheckoutTypes, Coupon, CouponRepository, LineItem, OrderRepository, Shops } from '@infrab4a/connect';
2
2
  import { Observable } from 'rxjs';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class CouponService {
@@ -11,7 +11,10 @@ export declare class CouponService {
11
11
  private couponValidation;
12
12
  private couponRulesValidation;
13
13
  calcDiscountSubscription(coupon: Coupon, checkout: Partial<CheckoutSubscription>): Observable<number>;
14
- calcDiscountShopping(coupon: Coupon, checkout: Partial<Checkout>): Promise<number>;
14
+ calcDiscountShopping(coupon: Coupon, checkout: Partial<Checkout>): Promise<{
15
+ discount: number;
16
+ lineItems: LineItem[];
17
+ }>;
15
18
  private calcDiscountByType;
16
19
  private hasMinSubTotal;
17
20
  private hasProductCategories;
@@ -24,6 +27,7 @@ export declare class CouponService {
24
27
  private getOrdersFromUser;
25
28
  private countOrdersWithUser;
26
29
  private getCouponUseLimits;
30
+ private calcLineItenDiscount;
27
31
  static ɵfac: i0.ɵɵFactoryDeclaration<CouponService, never>;
28
32
  static ɵprov: i0.ɵɵInjectableDeclaration<CouponService>;
29
33
  }