@reactionary/provider-fake 0.0.62 → 0.0.63

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.
@@ -1,6 +1,5 @@
1
1
  import {
2
2
  ProductSchema,
3
- ProductSearchResultSchema,
4
3
  CategorySchema,
5
4
  CartSchema,
6
5
  InventorySchema,
@@ -18,44 +17,48 @@ import {
18
17
  FakeStoreProvider
19
18
  } from "../providers/index.js";
20
19
  function withFakeCapabilities(configuration, capabilities) {
21
- return (cache) => {
20
+ return (cache, context) => {
22
21
  const client = {};
23
22
  if (capabilities.product) {
24
23
  client.product = new FakeProductProvider(
25
24
  configuration,
26
25
  ProductSchema,
27
- cache
26
+ cache,
27
+ context
28
28
  );
29
29
  }
30
30
  if (capabilities.productSearch) {
31
31
  client.productSearch = new FakeSearchProvider(
32
32
  configuration,
33
33
  ProductSearchResultItemSchema,
34
- cache
34
+ cache,
35
+ context
35
36
  );
36
37
  }
37
38
  if (capabilities.category) {
38
39
  client.category = new FakeCategoryProvider(
39
40
  configuration,
40
41
  CategorySchema,
41
- cache
42
+ cache,
43
+ context
42
44
  );
43
45
  }
44
46
  if (capabilities.cart) {
45
- client.cart = new FakeCartProvider(configuration, CartSchema, cache);
47
+ client.cart = new FakeCartProvider(configuration, CartSchema, cache, context);
46
48
  }
47
49
  if (capabilities.inventory) {
48
50
  client.inventory = new FakeInventoryProvider(
49
51
  configuration,
50
52
  InventorySchema,
51
- cache
53
+ cache,
54
+ context
52
55
  );
53
56
  }
54
57
  if (capabilities.store) {
55
- client.store = new FakeStoreProvider(configuration, StoreSchema, cache);
58
+ client.store = new FakeStoreProvider(configuration, StoreSchema, cache, context);
56
59
  }
57
60
  if (capabilities.price) {
58
- client.price = new FakePriceProvider(configuration, PriceSchema, cache);
61
+ client.price = new FakePriceProvider(configuration, PriceSchema, cache, context);
59
62
  }
60
63
  return client;
61
64
  };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@reactionary/provider-fake",
3
- "version": "0.0.62",
3
+ "version": "0.0.63",
4
4
  "main": "index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "dependencies": {
7
- "@reactionary/core": "0.0.62",
7
+ "@reactionary/core": "0.0.63",
8
8
  "zod": "4.1.9",
9
9
  "@faker-js/faker": "^9.8.0"
10
10
  },
@@ -2,8 +2,8 @@ import {
2
2
  AnalyticsProvider
3
3
  } from "@reactionary/core";
4
4
  class FakeAnalyticsProvider extends AnalyticsProvider {
5
- constructor(config, schema, cache) {
6
- super(schema, cache);
5
+ constructor(config, schema, cache, context) {
6
+ super(schema, cache, context);
7
7
  this.config = config;
8
8
  }
9
9
  }
@@ -3,8 +3,8 @@ import {
3
3
  } from "@reactionary/core";
4
4
  import { Faker, en, base } from "@faker-js/faker";
5
5
  class FakeCartProvider extends CartProvider {
6
- constructor(config, schema, cache) {
7
- super(schema, cache);
6
+ constructor(config, schema, cache, context) {
7
+ super(schema, cache, context);
8
8
  this.carts = /* @__PURE__ */ new Map();
9
9
  this.generator = new Faker({
10
10
  locale: [en, base],
@@ -12,7 +12,7 @@ class FakeCartProvider extends CartProvider {
12
12
  });
13
13
  this.config = config;
14
14
  }
15
- async getById(payload, _reqCtx) {
15
+ async getById(payload) {
16
16
  const cartId = payload.cart.key;
17
17
  if (payload.cart.key === "") {
18
18
  const result = this.newModel();
@@ -43,9 +43,9 @@ class FakeCartProvider extends CartProvider {
43
43
  }
44
44
  return cart;
45
45
  }
46
- async add(payload, reqCtx) {
46
+ async add(payload) {
47
47
  const cartId = payload.cart.key || `cart-${this.generator.string.uuid()}`;
48
- const cart = await this.getById({ cart: { key: cartId } }, reqCtx);
48
+ const cart = await this.getById({ cart: { key: cartId } });
49
49
  const existingItemIndex = cart.items.findIndex(
50
50
  (item) => item.variant.sku === payload.variant.sku
51
51
  );
@@ -60,20 +60,20 @@ class FakeCartProvider extends CartProvider {
60
60
  price: {
61
61
  unitPrice: {
62
62
  value: price,
63
- currency: reqCtx.languageContext.currencyCode
63
+ currency: this.context.languageContext.currencyCode
64
64
  },
65
65
  totalPrice: {
66
66
  value: 0,
67
67
  // Will be calculated below
68
- currency: reqCtx.languageContext.currencyCode
68
+ currency: this.context.languageContext.currencyCode
69
69
  },
70
70
  totalDiscount: {
71
71
  value: 0,
72
- currency: reqCtx.languageContext.currencyCode
72
+ currency: this.context.languageContext.currencyCode
73
73
  },
74
74
  unitDiscount: {
75
75
  value: 0,
76
- currency: reqCtx.languageContext.currencyCode
76
+ currency: this.context.languageContext.currencyCode
77
77
  }
78
78
  },
79
79
  product: {
@@ -84,18 +84,18 @@ class FakeCartProvider extends CartProvider {
84
84
  this.recalculateCart(cart);
85
85
  return this.assert(cart);
86
86
  }
87
- async remove(payload, reqCtx) {
87
+ async remove(payload) {
88
88
  const cartId = payload.cart.key || `cart-${this.generator.string.uuid()}`;
89
- const cart = await this.getById({ cart: { key: cartId } }, reqCtx);
89
+ const cart = await this.getById({ cart: { key: cartId } });
90
90
  cart.items = cart.items.filter(
91
91
  (item) => item.identifier.key !== payload.item.key
92
92
  );
93
93
  this.recalculateCart(cart);
94
94
  return this.assert(cart);
95
95
  }
96
- async changeQuantity(payload, reqCtx) {
96
+ async changeQuantity(payload) {
97
97
  const cartId = payload.cart.key || `cart-${this.generator.string.uuid()}`;
98
- const cart = await this.getById({ cart: { key: cartId } }, reqCtx);
98
+ const cart = await this.getById({ cart: { key: cartId } });
99
99
  const item = cart.items.find(
100
100
  (item2) => item2.identifier.key === payload.item.key
101
101
  );
@@ -108,28 +108,28 @@ class FakeCartProvider extends CartProvider {
108
108
  this.recalculateCart(cart);
109
109
  return this.assert(cart);
110
110
  }
111
- getActiveCartId(reqCtx) {
111
+ getActiveCartId() {
112
112
  throw new Error("Method not implemented.");
113
113
  }
114
- deleteCart(payload, reqCtx) {
114
+ deleteCart(payload) {
115
115
  throw new Error("Method not implemented.");
116
116
  }
117
- setShippingInfo(payload, reqCtx) {
117
+ setShippingInfo(payload) {
118
118
  throw new Error("Method not implemented.");
119
119
  }
120
- setBillingAddress(payload, reqCtx) {
120
+ setBillingAddress(payload) {
121
121
  throw new Error("Method not implemented.");
122
122
  }
123
- applyCouponCode(payload, reqCtx) {
123
+ applyCouponCode(payload) {
124
124
  throw new Error("Method not implemented.");
125
125
  }
126
- removeCouponCode(payload, reqCtx) {
126
+ removeCouponCode(payload) {
127
127
  throw new Error("Method not implemented.");
128
128
  }
129
- checkout(payload, reqCtx) {
129
+ checkout(payload) {
130
130
  throw new Error("Method not implemented.");
131
131
  }
132
- changeCurrency(payload, reqCtx) {
132
+ changeCurrency(payload) {
133
133
  throw new Error("Method not implemented.");
134
134
  }
135
135
  recalculateCart(cart) {
@@ -12,8 +12,8 @@ var __decorateClass = (decorators, target, key, kind) => {
12
12
  import { CategoryProvider, Reactionary } from "@reactionary/core";
13
13
  import { Faker, en, base } from "@faker-js/faker";
14
14
  class FakeCategoryProvider extends CategoryProvider {
15
- constructor(config, schema, cache) {
16
- super(schema, cache);
15
+ constructor(config, schema, cache, context) {
16
+ super(schema, cache, context);
17
17
  this.topCategories = new Array();
18
18
  this.childCategories = /* @__PURE__ */ new Map();
19
19
  this.allCategories = /* @__PURE__ */ new Map();
@@ -59,7 +59,7 @@ class FakeCategoryProvider extends CategoryProvider {
59
59
  this.allCategories.set(category.identifier.key, category);
60
60
  return category;
61
61
  }
62
- async getById(payload, reqCtx) {
62
+ async getById(payload) {
63
63
  const category = this.allCategories.get(payload.id.key);
64
64
  if (!category) {
65
65
  const dummyCategory = this.newModel();
@@ -69,7 +69,7 @@ class FakeCategoryProvider extends CategoryProvider {
69
69
  }
70
70
  return category;
71
71
  }
72
- getBySlug(payload, reqCtx) {
72
+ getBySlug(payload) {
73
73
  for (const p of this.allCategories.values()) {
74
74
  if (p.slug === payload.slug) {
75
75
  return Promise.resolve(p);
@@ -77,7 +77,7 @@ class FakeCategoryProvider extends CategoryProvider {
77
77
  }
78
78
  return Promise.resolve(null);
79
79
  }
80
- getBreadcrumbPathToCategory(payload, reqCtx) {
80
+ getBreadcrumbPathToCategory(payload) {
81
81
  const path = new Array();
82
82
  let category = this.allCategories.get(payload.id.key);
83
83
  path.push(category);
@@ -89,7 +89,7 @@ class FakeCategoryProvider extends CategoryProvider {
89
89
  }
90
90
  return Promise.resolve(path);
91
91
  }
92
- async findChildCategories(payload, reqCtx) {
92
+ async findChildCategories(payload) {
93
93
  const children = this.childCategories.get(payload.parentId.key);
94
94
  const page = children?.slice((payload.paginationOptions.pageNumber - 1) * payload.paginationOptions.pageSize, payload.paginationOptions.pageNumber * payload.paginationOptions.pageSize);
95
95
  const res = {
@@ -108,7 +108,7 @@ class FakeCategoryProvider extends CategoryProvider {
108
108
  };
109
109
  return Promise.resolve(res);
110
110
  }
111
- findTopCategories(payload, reqCtx) {
111
+ findTopCategories(payload) {
112
112
  const children = this.topCategories;
113
113
  const page = children?.slice((payload.paginationOptions.pageNumber - 1) * payload.paginationOptions.pageSize, payload.paginationOptions.pageNumber * payload.paginationOptions.pageSize);
114
114
  const res = {
@@ -3,12 +3,12 @@ import {
3
3
  } from "@reactionary/core";
4
4
  import { base, en, Faker } from "@faker-js/faker";
5
5
  class FakeIdentityProvider extends IdentityProvider {
6
- constructor(config, schema, cache) {
7
- super(schema, cache);
6
+ constructor(config, schema, cache, context) {
7
+ super(schema, cache, context);
8
8
  this.currentIdentity = null;
9
9
  this.config = config;
10
10
  }
11
- async getSelf(_payload, _reqCtx) {
11
+ async getSelf(_payload) {
12
12
  if (!this.currentIdentity) {
13
13
  const model = this.newModel();
14
14
  Object.assign(model, {
@@ -29,7 +29,7 @@ class FakeIdentityProvider extends IdentityProvider {
29
29
  }
30
30
  return this.currentIdentity;
31
31
  }
32
- async login(payload, _reqCtx) {
32
+ async login(payload) {
33
33
  const generator = new Faker({
34
34
  seed: 42,
35
35
  locale: [en, base]
@@ -53,7 +53,7 @@ class FakeIdentityProvider extends IdentityProvider {
53
53
  this.currentIdentity = this.assert(model);
54
54
  return this.currentIdentity;
55
55
  }
56
- async logout(_payload, _reqCtx) {
56
+ async logout(_payload) {
57
57
  const model = this.newModel();
58
58
  Object.assign(model, {
59
59
  id: "anonymous",
@@ -72,7 +72,7 @@ class FakeIdentityProvider extends IdentityProvider {
72
72
  this.currentIdentity = this.assert(model);
73
73
  return this.currentIdentity;
74
74
  }
75
- register(payload, reqCtx) {
75
+ register(payload) {
76
76
  throw new Error("Method not implemented.");
77
77
  }
78
78
  }
@@ -4,11 +4,11 @@ import {
4
4
  } from "@reactionary/core";
5
5
  import { base, en, Faker } from "@faker-js/faker";
6
6
  class FakeInventoryProvider extends InventoryProvider {
7
- constructor(config, schema, cache) {
8
- super(schema, cache);
7
+ constructor(config, schema, cache, context) {
8
+ super(schema, cache, context);
9
9
  this.config = config;
10
10
  }
11
- async getBySKU(payload, _reqCtx) {
11
+ async getBySKU(payload) {
12
12
  let hash = 0;
13
13
  const skuString = payload.variant.sku;
14
14
  for (let i = 0; i < skuString.length; i++) {
@@ -34,7 +34,7 @@ class FakeInventoryProvider extends InventoryProvider {
34
34
  model.meta = {
35
35
  cache: {
36
36
  hit: false,
37
- key: this.generateCacheKeySingle(model.identifier, _reqCtx)
37
+ key: this.generateCacheKeySingle(model.identifier)
38
38
  },
39
39
  placeholder: false
40
40
  };
@@ -3,18 +3,18 @@ import {
3
3
  } from "@reactionary/core";
4
4
  import { base, en, Faker } from "@faker-js/faker";
5
5
  class FakePriceProvider extends PriceProvider {
6
- constructor(config, schema, cache) {
7
- super(schema, cache);
6
+ constructor(config, schema, cache, context) {
7
+ super(schema, cache, context);
8
8
  this.config = config;
9
9
  }
10
- async getBySKUs(payload, reqCtx) {
11
- const promises = payload.map((p) => this.getBySKU(p, reqCtx));
10
+ async getBySKUs(payload) {
11
+ const promises = payload.map((p) => this.getBySKU(p));
12
12
  const result = await Promise.all(promises);
13
13
  return result;
14
14
  }
15
- async getBySKU(payload, _reqCtx) {
15
+ async getBySKU(payload) {
16
16
  if (payload.variant.sku === "unknown-sku") {
17
- return this.createEmptyPriceResult(payload.variant.sku, _reqCtx.languageContext.currencyCode);
17
+ return this.createEmptyPriceResult(payload.variant.sku);
18
18
  }
19
19
  let hash = 0;
20
20
  const skuString = payload.variant.sku;
@@ -33,7 +33,7 @@ class FakePriceProvider extends PriceProvider {
33
33
  },
34
34
  unitPrice: {
35
35
  value: generator.number.int({ min: 300, max: 1e5 }) / 100,
36
- currency: _reqCtx.languageContext.currencyCode
36
+ currency: this.context.languageContext.currencyCode
37
37
  },
38
38
  meta: {
39
39
  cache: {
@@ -52,14 +52,14 @@ class FakePriceProvider extends PriceProvider {
52
52
  minimumQuantity: generator.number.int({ min: 2, max: 5 }),
53
53
  price: {
54
54
  value: tier1Price,
55
- currency: _reqCtx.languageContext.currencyCode
55
+ currency: this.context.languageContext.currencyCode
56
56
  }
57
57
  },
58
58
  {
59
59
  minimumQuantity: generator.number.int({ min: 6, max: 10 }),
60
60
  price: {
61
61
  value: tier2Price,
62
- currency: _reqCtx.languageContext.currencyCode
62
+ currency: this.context.languageContext.currencyCode
63
63
  }
64
64
  }
65
65
  ];
@@ -7,11 +7,11 @@ import {
7
7
  import { Faker, en, base } from "@faker-js/faker";
8
8
  import { jitter } from "../utilities/jitter.js";
9
9
  class FakeSearchProvider extends ProductSearchProvider {
10
- constructor(config, schema, cache) {
11
- super(schema, cache);
10
+ constructor(config, schema, cache, context) {
11
+ super(schema, cache, context);
12
12
  this.config = config;
13
13
  }
14
- async queryByTerm(payload, _reqCtx) {
14
+ async queryByTerm(payload) {
15
15
  await jitter(this.config.jitter.mean, this.config.jitter.deviation);
16
16
  const query = payload.search;
17
17
  const querySpecificity = 20 - query.term.length - query.paginationOptions.pageNumber - query.facets.length;
@@ -116,13 +116,13 @@ class FakeSearchProvider extends ProductSearchProvider {
116
116
  const foo = this.childFunction();
117
117
  return result;
118
118
  }
119
- parseFacetValue(facetValueIdentifier, label, count, reqCtx) {
119
+ parseFacetValue(facetValueIdentifier, label, count) {
120
120
  throw new Error("Method not implemented.");
121
121
  }
122
- parseFacet(facetIdentifier, facetValue, reqCtx) {
122
+ parseFacet(facetIdentifier, facetValue) {
123
123
  throw new Error("Method not implemented.");
124
124
  }
125
- parseVariant(variant, product, reqCtx) {
125
+ parseVariant(variant, product) {
126
126
  throw new Error("Method not implemented.");
127
127
  }
128
128
  childFunction() {
@@ -15,17 +15,17 @@ import {
15
15
  } from "@reactionary/core";
16
16
  import { base, en, Faker } from "@faker-js/faker";
17
17
  class FakeProductProvider extends ProductProvider {
18
- constructor(config, schema, cache) {
19
- super(schema, cache);
18
+ constructor(config, schema, cache, context) {
19
+ super(schema, cache, context);
20
20
  this.config = config;
21
21
  }
22
- async getById(payload, _reqCtx) {
22
+ async getById(payload) {
23
23
  return this.parseSingle(payload);
24
24
  }
25
- async getBySlug(payload, _reqCtx) {
25
+ async getBySlug(payload) {
26
26
  return this.parseSingle(payload);
27
27
  }
28
- async getBySKU(payload, reqCtx) {
28
+ async getBySKU(payload) {
29
29
  return this.parseSingle(payload);
30
30
  }
31
31
  parseSingle(body) {
@@ -1,11 +1,11 @@
1
1
  import { StoreProvider } from "@reactionary/core";
2
2
  import { base, en, Faker } from "@faker-js/faker";
3
3
  class FakeStoreProvider extends StoreProvider {
4
- constructor(config, schema, cache) {
5
- super(schema, cache);
4
+ constructor(config, schema, cache, context) {
5
+ super(schema, cache, context);
6
6
  this.config = config;
7
7
  }
8
- async queryByProximity(payload, reqCtx) {
8
+ async queryByProximity(payload) {
9
9
  const generator = new Faker({
10
10
  seed: 42,
11
11
  locale: [en, base]
@@ -1,4 +1,4 @@
1
- import type { Cache as ReactinaryCache, ProductProvider, ProductSearchProvider, IdentityProvider, CategoryProvider, CartProvider, InventoryProvider, StoreProvider, PriceProvider } from '@reactionary/core';
1
+ import type { Cache as ReactinaryCache, ProductProvider, ProductSearchProvider, IdentityProvider, CategoryProvider, CartProvider, InventoryProvider, StoreProvider, PriceProvider, RequestContext } from '@reactionary/core';
2
2
  import type { FakeConfiguration } from '../schema/configuration.schema.js';
3
3
  import type { FakeCapabilities } from '../schema/capabilities.schema.js';
4
4
  type FakeClient<T extends FakeCapabilities> = (T['cart'] extends true ? {
@@ -18,5 +18,5 @@ type FakeClient<T extends FakeCapabilities> = (T['cart'] extends true ? {
18
18
  } : object) & (T['price'] extends true ? {
19
19
  price: PriceProvider;
20
20
  } : object);
21
- export declare function withFakeCapabilities<T extends FakeCapabilities>(configuration: FakeConfiguration, capabilities: T): (cache: ReactinaryCache) => FakeClient<T>;
21
+ export declare function withFakeCapabilities<T extends FakeCapabilities>(configuration: FakeConfiguration, capabilities: T): (cache: ReactinaryCache, context: RequestContext) => FakeClient<T>;
22
22
  export {};
@@ -1,8 +1,8 @@
1
- import type { BaseModel, Cache } from '@reactionary/core';
1
+ import type { BaseModel, Cache, RequestContext } from '@reactionary/core';
2
2
  import { AnalyticsProvider } from '@reactionary/core';
3
3
  import type z from 'zod';
4
4
  import type { FakeConfiguration } from '../schema/configuration.schema.js';
5
5
  export declare class FakeAnalyticsProvider<T extends BaseModel = BaseModel> extends AnalyticsProvider<T> {
6
6
  protected config: FakeConfiguration;
7
- constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: Cache);
7
+ constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: Cache, context: RequestContext);
8
8
  }
@@ -6,18 +6,18 @@ export declare class FakeCartProvider<T extends Cart = Cart> extends CartProvide
6
6
  protected config: FakeConfiguration;
7
7
  private carts;
8
8
  private generator;
9
- constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: Cache);
10
- getById(payload: CartQueryById, _reqCtx: RequestContext): Promise<T>;
11
- add(payload: CartMutationItemAdd, reqCtx: RequestContext): Promise<T>;
12
- remove(payload: CartMutationItemRemove, reqCtx: RequestContext): Promise<T>;
13
- changeQuantity(payload: CartMutationItemQuantityChange, reqCtx: RequestContext): Promise<T>;
14
- getActiveCartId(reqCtx: RequestContext): Promise<CartIdentifier>;
15
- deleteCart(payload: CartMutationDeleteCart, reqCtx: RequestContext): Promise<T>;
16
- setShippingInfo(payload: CartMutationSetShippingInfo, reqCtx: RequestContext): Promise<T>;
17
- setBillingAddress(payload: CartMutationSetBillingAddress, reqCtx: RequestContext): Promise<T>;
18
- applyCouponCode(payload: CartMutationApplyCoupon, reqCtx: RequestContext): Promise<T>;
19
- removeCouponCode(payload: CartMutationRemoveCoupon, reqCtx: RequestContext): Promise<T>;
20
- checkout(payload: CartMutationCheckout, reqCtx: RequestContext): Promise<OrderIdentifier>;
21
- changeCurrency(payload: CartMutationChangeCurrency, reqCtx: RequestContext): Promise<T>;
9
+ constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: Cache, context: RequestContext);
10
+ getById(payload: CartQueryById): Promise<T>;
11
+ add(payload: CartMutationItemAdd): Promise<T>;
12
+ remove(payload: CartMutationItemRemove): Promise<T>;
13
+ changeQuantity(payload: CartMutationItemQuantityChange): Promise<T>;
14
+ getActiveCartId(): Promise<CartIdentifier>;
15
+ deleteCart(payload: CartMutationDeleteCart): Promise<T>;
16
+ setShippingInfo(payload: CartMutationSetShippingInfo): Promise<T>;
17
+ setBillingAddress(payload: CartMutationSetBillingAddress): Promise<T>;
18
+ applyCouponCode(payload: CartMutationApplyCoupon): Promise<T>;
19
+ removeCouponCode(payload: CartMutationRemoveCoupon): Promise<T>;
20
+ checkout(payload: CartMutationCheckout): Promise<OrderIdentifier>;
21
+ changeCurrency(payload: CartMutationChangeCurrency): Promise<T>;
22
22
  protected recalculateCart(cart: T): void;
23
23
  }
@@ -11,10 +11,10 @@ export declare class FakeCategoryProvider<T extends Category = Category> extends
11
11
  protected allCategories: Map<string, T>;
12
12
  protected categoryGenerator: Faker;
13
13
  protected generateFakeCategory(parent: Category | undefined, index: number): T;
14
- constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: ReactionaryCache);
15
- getById(payload: CategoryQueryById, reqCtx: RequestContext): Promise<T>;
16
- getBySlug(payload: CategoryQueryBySlug, reqCtx: RequestContext): Promise<T | null>;
17
- getBreadcrumbPathToCategory(payload: CategoryQueryForBreadcrumb, reqCtx: RequestContext): Promise<T[]>;
18
- findChildCategories(payload: CategoryQueryForChildCategories, reqCtx: RequestContext): Promise<ReturnType<typeof this.parsePaginatedResult>>;
19
- findTopCategories(payload: CategoryQueryForTopCategories, reqCtx: RequestContext): Promise<ReturnType<typeof this.parsePaginatedResult>>;
14
+ constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: ReactionaryCache, context: RequestContext);
15
+ getById(payload: CategoryQueryById): Promise<T>;
16
+ getBySlug(payload: CategoryQueryBySlug): Promise<T | null>;
17
+ getBreadcrumbPathToCategory(payload: CategoryQueryForBreadcrumb): Promise<T[]>;
18
+ findChildCategories(payload: CategoryQueryForChildCategories): Promise<ReturnType<typeof this.parsePaginatedResult>>;
19
+ findTopCategories(payload: CategoryQueryForTopCategories): Promise<ReturnType<typeof this.parsePaginatedResult>>;
20
20
  }
@@ -4,9 +4,9 @@ import type { FakeConfiguration } from '../schema/configuration.schema.js';
4
4
  export declare class FakeIdentityProvider<T extends Identity = Identity> extends IdentityProvider<T> {
5
5
  protected config: FakeConfiguration;
6
6
  private currentIdentity;
7
- constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: Cache);
8
- getSelf(_payload: IdentityQuerySelf, _reqCtx: RequestContext): Promise<T>;
9
- login(payload: IdentityMutationLogin, _reqCtx: RequestContext): Promise<T>;
10
- logout(_payload: IdentityMutationLogout, _reqCtx: RequestContext): Promise<T>;
11
- register(payload: IdentityMutationRegister, reqCtx: RequestContext): Promise<T>;
7
+ constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: Cache, context: RequestContext);
8
+ getSelf(_payload: IdentityQuerySelf): Promise<T>;
9
+ login(payload: IdentityMutationLogin): Promise<T>;
10
+ logout(_payload: IdentityMutationLogout): Promise<T>;
11
+ register(payload: IdentityMutationRegister): Promise<T>;
12
12
  }
@@ -4,6 +4,6 @@ import type z from 'zod';
4
4
  import type { FakeConfiguration } from '../schema/configuration.schema.js';
5
5
  export declare class FakeInventoryProvider<T extends Inventory = Inventory> extends InventoryProvider<T> {
6
6
  protected config: FakeConfiguration;
7
- constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: Cache);
8
- getBySKU(payload: InventoryQueryBySKU, _reqCtx: RequestContext): Promise<T>;
7
+ constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: Cache, context: RequestContext);
8
+ getBySKU(payload: InventoryQueryBySKU): Promise<T>;
9
9
  }
@@ -3,7 +3,7 @@ import type z from 'zod';
3
3
  import type { FakeConfiguration } from '../schema/configuration.schema.js';
4
4
  export declare class FakePriceProvider<T extends Price = Price> extends PriceProvider<T> {
5
5
  protected config: FakeConfiguration;
6
- constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: Cache);
7
- getBySKUs(payload: PriceQueryBySku[], reqCtx: RequestContext): Promise<T[]>;
8
- getBySKU(payload: PriceQueryBySku, _reqCtx: RequestContext): Promise<T>;
6
+ constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: Cache, context: RequestContext);
7
+ getBySKUs(payload: PriceQueryBySku[]): Promise<T[]>;
8
+ getBySKU(payload: PriceQueryBySku): Promise<T>;
9
9
  }
@@ -5,10 +5,10 @@ import type z from 'zod';
5
5
  import type { FakeConfiguration } from '../schema/configuration.schema.js';
6
6
  export declare class FakeSearchProvider<T extends ProductSearchResultItem = ProductSearchResultItem> extends ProductSearchProvider<T> {
7
7
  protected config: FakeConfiguration;
8
- constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: ReactionaryCache);
9
- queryByTerm(payload: ProductSearchQueryByTerm, _reqCtx: RequestContext): Promise<ProductSearchResult>;
10
- protected parseFacetValue(facetValueIdentifier: FacetValueIdentifier, label: string, count: number, reqCtx: RequestContext): ProductSearchResultFacetValue;
11
- protected parseFacet(facetIdentifier: FacetIdentifier, facetValue: unknown, reqCtx: RequestContext): ProductSearchResultFacet;
12
- protected parseVariant(variant: unknown, product: unknown, reqCtx: RequestContext): ProductSearchResultItemVariant;
8
+ constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: ReactionaryCache, context: RequestContext);
9
+ queryByTerm(payload: ProductSearchQueryByTerm): Promise<ProductSearchResult>;
10
+ protected parseFacetValue(facetValueIdentifier: FacetValueIdentifier, label: string, count: number): ProductSearchResultFacetValue;
11
+ protected parseFacet(facetIdentifier: FacetIdentifier, facetValue: unknown): ProductSearchResultFacet;
12
+ protected parseVariant(variant: unknown, product: unknown): ProductSearchResultItemVariant;
13
13
  protected childFunction(): number;
14
14
  }
@@ -3,9 +3,9 @@ import type z from 'zod';
3
3
  import type { FakeConfiguration } from '../schema/configuration.schema.js';
4
4
  export declare class FakeProductProvider<T extends Product = Product> extends ProductProvider<T> {
5
5
  protected config: FakeConfiguration;
6
- constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: ReactinaryCache);
7
- getById(payload: ProductQueryById, _reqCtx: RequestContext): Promise<T>;
8
- getBySlug(payload: ProductQueryBySlug, _reqCtx: RequestContext): Promise<T>;
9
- getBySKU(payload: ProductQueryBySKU, reqCtx: RequestContext): Promise<T>;
6
+ constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: ReactinaryCache, context: RequestContext);
7
+ getById(payload: ProductQueryById): Promise<T>;
8
+ getBySlug(payload: ProductQueryBySlug): Promise<T>;
9
+ getBySKU(payload: ProductQueryBySKU): Promise<T>;
10
10
  protected parseSingle(body: ProductQueryById | ProductQueryBySlug | ProductQueryBySKU): T;
11
11
  }
@@ -4,6 +4,6 @@ import type z from 'zod';
4
4
  import type { FakeConfiguration } from '../schema/configuration.schema.js';
5
5
  export declare class FakeStoreProvider<T extends Store = Store> extends StoreProvider<T> {
6
6
  protected config: FakeConfiguration;
7
- constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: Cache);
8
- queryByProximity(payload: StoreQueryByProximity, reqCtx: RequestContext): Promise<T[]>;
7
+ constructor(config: FakeConfiguration, schema: z.ZodType<T>, cache: Cache, context: RequestContext);
8
+ queryByProximity(payload: StoreQueryByProximity): Promise<T[]>;
9
9
  }