@reactionary/provider-fake 0.1.5 → 0.1.6

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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@reactionary/provider-fake",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "main": "index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "dependencies": {
7
- "@reactionary/core": "0.1.5",
7
+ "@reactionary/core": "0.1.6",
8
8
  "zod": "4.1.9",
9
9
  "@faker-js/faker": "^9.8.0"
10
10
  },
@@ -24,6 +24,16 @@ class FakeSearchProvider extends ProductSearchProvider {
24
24
  super(cache, context);
25
25
  this.config = config;
26
26
  }
27
+ async createCategoryNavigationFilter(payload) {
28
+ const facetIdentifier = {
29
+ key: "category"
30
+ };
31
+ const facetValueIdentifier = {
32
+ facet: facetIdentifier,
33
+ key: payload.categoryPath[payload.categoryPath.length - 1].identifier.key
34
+ };
35
+ return facetValueIdentifier;
36
+ }
27
37
  async queryByTerm(payload) {
28
38
  await jitter(this.config.jitter.mean, this.config.jitter.deviation);
29
39
  const query = payload.search;
@@ -1,10 +1,11 @@
1
1
  import { ProductSearchProvider } from '@reactionary/core';
2
- import type { ProductSearchResult, ProductSearchResultFacet, Cache as ReactionaryCache, FacetIdentifier, FacetValueIdentifier, ProductSearchResultFacetValue, ProductSearchResultItemVariant } from '@reactionary/core';
2
+ import type { ProductSearchResult, ProductSearchResultFacet, Cache as ReactionaryCache, FacetIdentifier, FacetValueIdentifier, ProductSearchResultFacetValue, ProductSearchResultItemVariant, ProductSearchQueryCreateNavigationFilter } from '@reactionary/core';
3
3
  import type { RequestContext, ProductSearchQueryByTerm } from '@reactionary/core';
4
4
  import type { FakeConfiguration } from '../schema/configuration.schema.js';
5
5
  export declare class FakeSearchProvider extends ProductSearchProvider {
6
6
  protected config: FakeConfiguration;
7
7
  constructor(config: FakeConfiguration, cache: ReactionaryCache, context: RequestContext);
8
+ createCategoryNavigationFilter(payload: ProductSearchQueryCreateNavigationFilter): Promise<FacetValueIdentifier>;
8
9
  queryByTerm(payload: ProductSearchQueryByTerm): Promise<ProductSearchResult>;
9
10
  protected parseFacetValue(facetValueIdentifier: FacetValueIdentifier, label: string, count: number): ProductSearchResultFacetValue;
10
11
  protected parseFacet(facetIdentifier: FacetIdentifier, facetValue: unknown): ProductSearchResultFacet;