@infrab4a/connect 0.16.10 → 0.17.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.
@@ -5,6 +5,7 @@ export declare class ProductsIndex {
5
5
  constructor(adapter: AxiosAdapter<Product>);
6
6
  findById(ids: string[], options?: {
7
7
  hasStock: boolean;
8
+ stock?: number;
8
9
  size: number;
9
10
  shop: Shops;
10
11
  }): Promise<Product[]>;
@@ -1,5 +1,6 @@
1
1
  import { FirebaseFirestore } from '@firebase/firestore-types';
2
2
  import { Category, CategoryRepository, Product, Shops } from '../../../../../domain';
3
+ import { ProductsIndex } from '../../../../elasticsearch';
3
4
  declare const CategoryFirestoreRepository_base: {
4
5
  new (...args: any[]): {
5
6
  update(data: import("../../../../../domain").RepositoryUpdateParams<Category>): Promise<Category>;
@@ -44,15 +45,21 @@ declare const CategoryFirestoreRepository_base: {
44
45
  };
45
46
  export declare class CategoryFirestoreRepository extends CategoryFirestoreRepository_base implements CategoryRepository {
46
47
  readonly firestore: FirebaseFirestore;
47
- constructor(firestore: FirebaseFirestore);
48
+ private readonly productsIndex;
49
+ constructor(firestore: FirebaseFirestore, productsIndex: ProductsIndex);
48
50
  getCategoryBySlug(slug: string, shop: Shops): Promise<Category>;
49
- getCategoriesForHome(categoryIds: string[], limit?: number): Promise<{
51
+ getCategoriesForHome(categoryIds: string[], { limit, stock }?: {
52
+ limit?: number;
53
+ hasStock?: boolean;
54
+ stock?: number;
55
+ }): Promise<{
50
56
  category: Category;
51
57
  products: Product[];
52
58
  }[]>;
53
59
  mountCategory(category: Category, options?: {
54
60
  limit?: number;
55
61
  hasStock?: boolean;
62
+ stock?: number;
56
63
  }): Promise<Product[]>;
57
64
  }
58
65
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "0.16.10",
3
+ "version": "0.17.0-beta.0",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },