@salla.sa/twilight 2.11.91 → 2.11.92

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight",
3
- "version": "2.11.91",
3
+ "version": "2.11.92",
4
4
  "description": "Salla Theme Toolkit, Webcomponents, Events, Requests, Utils",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -8,7 +8,7 @@
8
8
  "scripts": {
9
9
  "build": "npx rollup --config --preserveSymlinks=true",
10
10
  "watch": "npx rollup --watch --config --preserveSymlinks=true",
11
- "test": "jest --detectOpenHandles",
11
+ "test": "jest --detectOpenHandles -- product.test.js",
12
12
  "express": "node tests/server/index.js"
13
13
  },
14
14
  "keywords": [
@@ -67,5 +67,5 @@
67
67
  "peerDependencies": {
68
68
  "webpack": "^4 || ^5"
69
69
  },
70
- "gitHead": "c7a9bb51e9f143032e4ebb9dea37ff76040bf472"
70
+ "gitHead": "8da3cb22ccdec75291d69699e6be1b21d71a9e7c"
71
71
  }
@@ -17,4 +17,5 @@ export default interface ProductApi {
17
17
  uploadGiftImage: (multiPartData: FormData) => Promise<ProductResponse.giftImageUpload>;
18
18
  getDetails: (product_id: number, withItems: Array<'images' | 'brand' | 'tags' | 'notify_availability' | 'rating' | 'donation' | 'options' | 'sold_quantity' | 'category'>) => Promise<ProductResponse.detail>;
19
19
  getSizeGuides: (product_id: number) => Promise<ProductResponse.sizeGuides>;
20
+ fetch: (queryParam: ProductRequest.FetchProductsQueryParams) => Promise<ProductResponse.lists>
20
21
  }
@@ -50,4 +50,11 @@ export namespace ProductRequest {
50
50
  image_url: string;
51
51
  time_zone: string;
52
52
  }
53
+
54
+ export interface FetchProductsQueryParams {
55
+ source: 'categories' | 'latest' | 'related' | 'brands' | 'json' | 'search' | 'tags' | 'selected' | 'offers' | 'landing-page';
56
+ sourceValue: number | string | object | string[];
57
+ filters?: object;
58
+ limit?: number;
59
+ }
53
60
  }
@@ -278,4 +278,8 @@ export namespace ProductResponse {
278
278
  export interface detail extends SuccessResponse {
279
279
  data: ProductDetail
280
280
  }
281
+
282
+ export interface lists extends SuccessResponse {
283
+ data: Array<ProductDetail>
284
+ }
281
285
  }
@@ -1,6 +1,6 @@
1
- import { OfferSummary } from "../api/cart";
2
- import { ProductResponse } from "../api/product";
3
- import { RequestError, RequestErrorEvent, RequestErrorEventWithData, SuccessResponse } from "../common";
1
+ import {OfferSummary} from "../api/cart";
2
+ import {ProductResponse} from "../api/product";
3
+ import {RequestError, RequestErrorEvent, RequestErrorEventWithData, SuccessResponse} from "../common";
4
4
 
5
5
  export default interface ProductEvent {
6
6
  onPriceUpdated: (callback: (response: ProductResponse.getPrice, product_id: number) => void) => void;
@@ -30,4 +30,7 @@ export default interface ProductEvent {
30
30
 
31
31
  onGiftImageUploadSucceeded: (callback: (response: ProductResponse.giftImageUpload) => void) => void;
32
32
  onGiftImageUploadFailed: RequestErrorEvent;
33
+
34
+ onProductListFetchSucceeded: (callback: (response: ProductResponse.lists) => void) => void;
35
+ onProductListFetchFailed: RequestErrorEvent;
33
36
  }