@salla.sa/twilight 2.11.91 → 2.11.93
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/dist/@salla.sa/twilight.min.js +2 -2
- package/dist/@salla.sa/twilight.min.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +4 -4
- package/types/api/product/index.d.ts +1 -0
- package/types/api/product/request.d.ts +7 -0
- package/types/api/product/response.d.ts +4 -0
- package/types/event/product.d.ts +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salla.sa/twilight",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.93",
|
|
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": [
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"homepage": "https://salla.dev",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@salla.sa/base": "^2.11.
|
|
36
|
+
"@salla.sa/base": "^2.11.93",
|
|
37
37
|
"axios": "^0.27.2",
|
|
38
38
|
"infinite-scroll": "^4.0.1",
|
|
39
39
|
"jwt-decode": "^3.1.2",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"webpack": "^4 || ^5"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "36bfedd678c6c20851bfc2976656c013e4ac031d"
|
|
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
|
}
|
package/types/event/product.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
}
|