fast-simon-sdk 1.6.10 → 1.6.80
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/README.md +68 -58
- package/lib/config.d.ts +3 -0
- package/lib/config.js +4 -1
- package/lib/config.js.map +1 -1
- package/lib/index.js +19 -8
- package/lib/index.js.map +1 -1
- package/lib/models/autocomplete.d.ts +11 -0
- package/lib/models/common.d.ts +60 -2
- package/lib/models/common.js +4 -0
- package/lib/models/common.js.map +1 -1
- package/lib/models/content.d.ts +2 -0
- package/lib/models/events.d.ts +10 -1
- package/lib/models/fullTextSearch.d.ts +5 -2
- package/lib/models/fullTextSearch.js.map +1 -1
- package/lib/models/related.d.ts +3 -0
- package/lib/models/smartCollections.d.ts +5 -1
- package/lib/models/visualDiscovery.d.ts +19 -2
- package/lib/models/visualDiscovery.js.map +1 -1
- package/lib/sections/contentSearch/index.js +1 -1
- package/lib/sections/contentSearch/index.js.map +1 -1
- package/lib/sections/enums/index.d.ts +2 -0
- package/lib/sections/enums/index.js +2 -0
- package/lib/sections/enums/index.js.map +1 -1
- package/lib/sections/eventReporter/index.js +189 -68
- package/lib/sections/eventReporter/index.js.map +1 -1
- package/lib/sections/eventReporter/utils.d.ts +3 -2
- package/lib/sections/eventReporter/utils.js +9 -3
- package/lib/sections/eventReporter/utils.js.map +1 -1
- package/lib/sections/fullTextSearch/index.js +44 -10
- package/lib/sections/fullTextSearch/index.js.map +1 -1
- package/lib/sections/fullTextSearch/utils.d.ts +0 -1
- package/lib/sections/fullTextSearch/utils.js +11 -5
- package/lib/sections/fullTextSearch/utils.js.map +1 -1
- package/lib/sections/index.js +57 -7
- package/lib/sections/index.js.map +1 -1
- package/lib/sections/initialization/index.d.ts +4 -2
- package/lib/sections/initialization/index.js +69 -14
- package/lib/sections/initialization/index.js.map +1 -1
- package/lib/sections/initialization/utils.js +27 -10
- package/lib/sections/initialization/utils.js.map +1 -1
- package/lib/sections/instantSearch/index.d.ts +1 -1
- package/lib/sections/instantSearch/index.js +57 -7
- package/lib/sections/instantSearch/index.js.map +1 -1
- package/lib/sections/instantSearch/utils.d.ts +2 -1
- package/lib/sections/instantSearch/utils.js +4 -4
- package/lib/sections/instantSearch/utils.js.map +1 -1
- package/lib/sections/landingPage/index.js +15 -5
- package/lib/sections/landingPage/index.js.map +1 -1
- package/lib/sections/recommendations/index.d.ts +14 -0
- package/lib/sections/recommendations/index.js +75 -5
- package/lib/sections/recommendations/index.js.map +1 -1
- package/lib/sections/recommendations/utils.js +12 -7
- package/lib/sections/recommendations/utils.js.map +1 -1
- package/lib/sections/smartCollections/index.js +41 -8
- package/lib/sections/smartCollections/index.js.map +1 -1
- package/lib/sections/smartCollections/utils.d.ts +4 -4
- package/lib/sections/smartCollections/utils.js +52 -94
- package/lib/sections/smartCollections/utils.js.map +1 -1
- package/lib/sections/visualDiscovery/index.d.ts +23 -3
- package/lib/sections/visualDiscovery/index.js +194 -33
- package/lib/sections/visualDiscovery/index.js.map +1 -1
- package/lib/services/ViewportImpressionTracker.d.ts +37 -0
- package/lib/services/ViewportImpressionTracker.js +218 -0
- package/lib/services/ViewportImpressionTracker.js.map +1 -0
- package/lib/services/autocomplete.d.ts +5 -2
- package/lib/services/autocomplete.js +6 -4
- package/lib/services/autocomplete.js.map +1 -1
- package/lib/services/common.d.ts +24 -5
- package/lib/services/common.js +57 -11
- package/lib/services/common.js.map +1 -1
- package/lib/services/content.d.ts +7 -1
- package/lib/services/content.js +16 -2
- package/lib/services/content.js.map +1 -1
- package/lib/services/fullTextSearch.d.ts +1 -1
- package/lib/services/fullTextSearch.js +43 -6
- package/lib/services/fullTextSearch.js.map +1 -1
- package/lib/services/landingPage.d.ts +3 -1
- package/lib/services/landingPage.js +3 -2
- package/lib/services/landingPage.js.map +1 -1
- package/lib/services/lookAlikeProductRecommendation.d.ts +3 -1
- package/lib/services/lookAlikeProductRecommendation.js +3 -2
- package/lib/services/lookAlikeProductRecommendation.js.map +1 -1
- package/lib/services/related.d.ts +27 -3
- package/lib/services/related.js +43 -6
- package/lib/services/related.js.map +1 -1
- package/lib/services/reporting.d.ts +20 -12
- package/lib/services/reporting.js +37 -38
- package/lib/services/reporting.js.map +1 -1
- package/lib/services/smartCollections.d.ts +1 -1
- package/lib/services/smartCollections.js +46 -13
- package/lib/services/smartCollections.js.map +1 -1
- package/lib/services/viewportImpressions.d.ts +12 -0
- package/lib/services/viewportImpressions.js +211 -0
- package/lib/services/viewportImpressions.js.map +1 -0
- package/lib/services/visualDiscovery.d.ts +5 -6
- package/lib/services/visualDiscovery.js +10 -29
- package/lib/services/visualDiscovery.js.map +1 -1
- package/lib/services/visualDiscoveryReporting.d.ts +43 -0
- package/lib/services/visualDiscoveryReporting.js +135 -0
- package/lib/services/visualDiscoveryReporting.js.map +1 -0
- package/lib/utils/API.js +19 -4
- package/lib/utils/API.js.map +1 -1
- package/lib/utils/attentive.d.ts +1 -0
- package/lib/utils/attentive.js +36 -0
- package/lib/utils/attentive.js.map +1 -0
- package/lib/utils/debug.d.ts +1 -0
- package/lib/utils/debug.js +13 -1
- package/lib/utils/debug.js.map +1 -1
- package/lib/utils/location.d.ts +1 -0
- package/lib/utils/location.js +10 -0
- package/lib/utils/location.js.map +1 -1
- package/lib/utils/logger.d.ts +2 -0
- package/lib/utils/logger.js +26 -0
- package/lib/utils/logger.js.map +1 -0
- package/lib/utils/personalization.d.ts +5 -0
- package/lib/utils/personalization.js +18 -3
- package/lib/utils/personalization.js.map +1 -1
- package/lib/utils/personalizationSegment.d.ts +2 -0
- package/lib/utils/personalizationSegment.js +17 -0
- package/lib/utils/personalizationSegment.js.map +1 -0
- package/lib/utils/siteStateValidator.d.ts +25 -0
- package/lib/utils/siteStateValidator.js +45 -0
- package/lib/utils/siteStateValidator.js.map +1 -0
- package/lib/utils/updateRecentSearches.d.ts +9 -0
- package/lib/utils/updateRecentSearches.js +50 -26
- package/lib/utils/updateRecentSearches.js.map +1 -1
- package/lib/utils/validation.d.ts +1 -0
- package/lib/utils/validation.js +13 -1
- package/lib/utils/validation.js.map +1 -1
- package/package.json +44 -41
package/README.md
CHANGED
|
@@ -1,59 +1,69 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 1
|
|
3
|
-
title: Introduction
|
|
4
|
-
---
|
|
5
|
-
## JavaScript SDK Library
|
|
6
|
-
For developer seeking to integrate the best E-commerce collections, filters, search, personalization and merchandising into their Frontend
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
The following document is for web developers seeking to utilize Fast Simon’s cloud service for Search, Collections and product recommendations.
|
|
10
|
-
By using the described JavaScript SDK web developers can easily retrieve data to populate their search, collections and product recommendations.
|
|
11
|
-
|
|
12
|
-
## Pre Installation Steps
|
|
13
|
-
1. Go to Filters & Instant Search App Dashboard.
|
|
14
|
-
2. Choose the Sync tab on the left.
|
|
15
|
-
3. Main Settings > turn on "REST API".
|
|
16
|
-
|
|
17
|
-
## Installation
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
npm
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 1
|
|
3
|
+
title: Introduction
|
|
4
|
+
---
|
|
5
|
+
## JavaScript SDK Library
|
|
6
|
+
For developer seeking to integrate the best E-commerce collections, filters, search, personalization and merchandising into their Frontend
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
The following document is for web developers seeking to utilize Fast Simon’s cloud service for Search, Collections and product recommendations.
|
|
10
|
+
By using the described JavaScript SDK web developers can easily retrieve data to populate their search, collections and product recommendations.
|
|
11
|
+
|
|
12
|
+
## Pre Installation Steps
|
|
13
|
+
1. Go to Filters & Instant Search App Dashboard.
|
|
14
|
+
2. Choose the Sync tab on the left.
|
|
15
|
+
3. Main Settings > turn on "REST API".
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
### Authenticate with Fast Simon private NPM packages
|
|
20
|
+
|
|
21
|
+
Before installation, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm config set "//registry.npmjs.org/:_authToken" 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
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### CDN Global Script
|
|
28
|
+
```html title="Latest Version"
|
|
29
|
+
<script src="https://assets.fastsimon.com/sdk/latest/fast_simon_sdk.js" async/>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### NPM Package **(Recommended)**
|
|
33
|
+
```shell
|
|
34
|
+
npm install fast-simon-sdk
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Initialization - CDN
|
|
38
|
+
Insert the following script at the **head** of your site as an **async** script after the original script injection
|
|
39
|
+
```javascript
|
|
40
|
+
// using a cdn script will bind FastSimonSDK to window
|
|
41
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
42
|
+
window.FastSimonSDK.initialization({
|
|
43
|
+
storeID: 123, // store-id,
|
|
44
|
+
uuid: "this-is-my-uuid", // uuid
|
|
45
|
+
type: "SPA", // multi page application ("MPA") or single page application("SPA") (for reporting)
|
|
46
|
+
onReady: () => {
|
|
47
|
+
// do stuff
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Initialization - NPM Package
|
|
54
|
+
```typescript
|
|
55
|
+
import {FastSimonSDK} from "fast-simon-sdk"
|
|
56
|
+
|
|
57
|
+
// using a cdn script will bind FastSimonSDK to window
|
|
58
|
+
FastSimonSDK.initialization({
|
|
59
|
+
storeID: 123, // store-id,
|
|
60
|
+
uuid: "this-is-my-uuid", // uuid
|
|
61
|
+
type: "SPA", // multi page application ("MPA") or single page application("SPA") (for reporting)
|
|
62
|
+
onReady: () => {
|
|
63
|
+
// do stuff
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Full Docs can be found here:
|
|
59
69
|
[https://docs.fastsimon.com/sdk]('https://docs.fastsimon.com/sdk')
|
package/lib/config.d.ts
CHANGED
|
@@ -5,9 +5,12 @@ export declare const RECENT_COLLECTION_PRODUCTS_KEY = "isp-recent-product-collec
|
|
|
5
5
|
export declare const RECENT_SERP_PRODUCTS_KEY = "isp-recent-product-serp";
|
|
6
6
|
export declare const RECENT_RESPONSE_SERP_PRODUCTS_KEY = "isp-recent-response-product-serp";
|
|
7
7
|
export declare const RECENT_RESPONSE_COLLECTION_PRODUCTS_KEY = "isp-recent-response-product-collection";
|
|
8
|
+
export declare const PERSONALIZED_PRODUCT_IDS = "PERSONALIZED_PRODUCT_IDS";
|
|
8
9
|
export declare const POST_LOAD_EVENT_KEY = "post-load-event";
|
|
10
|
+
export declare const POST_LOAD_EVENT_SELF_KEY = "post-load-event-self";
|
|
9
11
|
export declare const SDK_DEBUG_LS_LEY = "isp-sdk-version";
|
|
10
12
|
export declare const SDK_NO_CACHING_LS_KEY = "isp-sdk-caching";
|
|
13
|
+
export declare const SDK_VERBOSE_LS_KEY = "fs-sdk-verbose";
|
|
11
14
|
export declare const CART_TOKEN_LS_KEY = "isp-cart-token";
|
|
12
15
|
export declare const CART_TOKEN_COOKIE_NAME = "cart";
|
|
13
16
|
export declare const SESSION_TOKEN_LIFE = 1800;
|
package/lib/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RECENT_PRODUCTS_LENGTH_LIMIT = exports.RECENT_PRODUCTS_EXPIRY_DAYS = exports.ISP_LOCAL_STORAGE_LOAD_ERROR_MSG = exports.INITIALIZATION_ERROR_MSG = exports.PROMOTED_PRODUCTS_BY_PERSONALIZATION = exports.API_ERROR_MSG = exports.POST_LOAD_WAIT_TIME = exports.MIN_RECENT_SERP_PRODUCTS = exports.MAX_RECENT_SERP_PRODUCT_LIFE = exports.MAX_RECENT_SERP_PRODUCTS_PRODUCTS = exports.MAX_RECENT_COLLECTION_PRODUCTS = exports.MAX_RECENT_PRODUCTS = exports.SESSION_TOKEN_LIFE = exports.CART_TOKEN_COOKIE_NAME = exports.CART_TOKEN_LS_KEY = exports.SDK_NO_CACHING_LS_KEY = exports.SDK_DEBUG_LS_LEY = exports.POST_LOAD_EVENT_KEY = exports.RECENT_RESPONSE_COLLECTION_PRODUCTS_KEY = exports.RECENT_RESPONSE_SERP_PRODUCTS_KEY = exports.RECENT_SERP_PRODUCTS_KEY = exports.RECENT_COLLECTION_PRODUCTS_KEY = exports.RECENT_PRODUCT_LS_KEY = exports.USER_SESSION_TOKEN_LS_KEY = exports.SESSION_TOKEN_LS_KEY = void 0;
|
|
3
|
+
exports.RECENT_PRODUCTS_LENGTH_LIMIT = exports.RECENT_PRODUCTS_EXPIRY_DAYS = exports.ISP_LOCAL_STORAGE_LOAD_ERROR_MSG = exports.INITIALIZATION_ERROR_MSG = exports.PROMOTED_PRODUCTS_BY_PERSONALIZATION = exports.API_ERROR_MSG = exports.POST_LOAD_WAIT_TIME = exports.MIN_RECENT_SERP_PRODUCTS = exports.MAX_RECENT_SERP_PRODUCT_LIFE = exports.MAX_RECENT_SERP_PRODUCTS_PRODUCTS = exports.MAX_RECENT_COLLECTION_PRODUCTS = exports.MAX_RECENT_PRODUCTS = exports.SESSION_TOKEN_LIFE = exports.CART_TOKEN_COOKIE_NAME = exports.CART_TOKEN_LS_KEY = exports.SDK_VERBOSE_LS_KEY = exports.SDK_NO_CACHING_LS_KEY = exports.SDK_DEBUG_LS_LEY = exports.POST_LOAD_EVENT_SELF_KEY = exports.POST_LOAD_EVENT_KEY = exports.PERSONALIZED_PRODUCT_IDS = exports.RECENT_RESPONSE_COLLECTION_PRODUCTS_KEY = exports.RECENT_RESPONSE_SERP_PRODUCTS_KEY = exports.RECENT_SERP_PRODUCTS_KEY = exports.RECENT_COLLECTION_PRODUCTS_KEY = exports.RECENT_PRODUCT_LS_KEY = exports.USER_SESSION_TOKEN_LS_KEY = exports.SESSION_TOKEN_LS_KEY = void 0;
|
|
4
4
|
//Local Storage Keys
|
|
5
5
|
exports.SESSION_TOKEN_LS_KEY = "isp-session-token";
|
|
6
6
|
exports.USER_SESSION_TOKEN_LS_KEY = "isp-user-session-token";
|
|
@@ -9,9 +9,12 @@ exports.RECENT_COLLECTION_PRODUCTS_KEY = "isp-recent-product-collection";
|
|
|
9
9
|
exports.RECENT_SERP_PRODUCTS_KEY = "isp-recent-product-serp";
|
|
10
10
|
exports.RECENT_RESPONSE_SERP_PRODUCTS_KEY = "isp-recent-response-product-serp";
|
|
11
11
|
exports.RECENT_RESPONSE_COLLECTION_PRODUCTS_KEY = "isp-recent-response-product-collection";
|
|
12
|
+
exports.PERSONALIZED_PRODUCT_IDS = "PERSONALIZED_PRODUCT_IDS";
|
|
12
13
|
exports.POST_LOAD_EVENT_KEY = "post-load-event";
|
|
14
|
+
exports.POST_LOAD_EVENT_SELF_KEY = "post-load-event-self";
|
|
13
15
|
exports.SDK_DEBUG_LS_LEY = "isp-sdk-version";
|
|
14
16
|
exports.SDK_NO_CACHING_LS_KEY = "isp-sdk-caching";
|
|
17
|
+
exports.SDK_VERBOSE_LS_KEY = "fs-sdk-verbose";
|
|
15
18
|
exports.CART_TOKEN_LS_KEY = "isp-cart-token";
|
|
16
19
|
exports.CART_TOKEN_COOKIE_NAME = "cart";
|
|
17
20
|
//constants
|
package/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;AAAA,oBAAoB;AACP,QAAA,oBAAoB,GAAG,mBAAmB,CAAC;AAC3C,QAAA,yBAAyB,GAAG,wBAAwB,CAAC;AAErD,QAAA,qBAAqB,GAAG,+BAA+B,CAAC;AACxD,QAAA,8BAA8B,GAAG,+BAA+B,CAAC;AAEjE,QAAA,wBAAwB,GAAG,yBAAyB,CAAC;AACrD,QAAA,iCAAiC,GAAG,kCAAkC,CAAC;AACvE,QAAA,uCAAuC,GAAG,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;AAAA,oBAAoB;AACP,QAAA,oBAAoB,GAAG,mBAAmB,CAAC;AAC3C,QAAA,yBAAyB,GAAG,wBAAwB,CAAC;AAErD,QAAA,qBAAqB,GAAG,+BAA+B,CAAC;AACxD,QAAA,8BAA8B,GAAG,+BAA+B,CAAC;AAEjE,QAAA,wBAAwB,GAAG,yBAAyB,CAAC;AACrD,QAAA,iCAAiC,GAAG,kCAAkC,CAAC;AACvE,QAAA,uCAAuC,GAAG,wCAAwC,CAAC;AACnF,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AACtD,QAAA,mBAAmB,GAAG,iBAAiB,CAAC;AACxC,QAAA,wBAAwB,GAAG,sBAAsB,CAAC;AAElD,QAAA,gBAAgB,GAAG,iBAAiB,CAAC;AACrC,QAAA,qBAAqB,GAAG,iBAAiB,CAAC;AAC1C,QAAA,kBAAkB,GAAG,gBAAgB,CAAC;AAEtC,QAAA,iBAAiB,GAAG,gBAAgB,CAAC;AACrC,QAAA,sBAAsB,GAAG,MAAM,CAAA;AAE5C,WAAW;AACE,QAAA,kBAAkB,GAAG,IAAI,CAAC;AAE1B,QAAA,mBAAmB,GAAG,EAAE,CAAC;AACzB,QAAA,8BAA8B,GAAG,CAAC,CAAC;AAEnC,QAAA,iCAAiC,GAAG,EAAE,CAAC;AACvC,QAAA,4BAA4B,GAAG,GAAG,CAAC;AACnC,QAAA,wBAAwB,GAAG,CAAC,CAAC;AAE7B,QAAA,mBAAmB,GAAG,IAAI,CAAC;AAE3B,QAAA,aAAa,GAAG,8GAAuG,CAAC;AAExH,QAAA,oCAAoC,GAAG,0CAA0C,CAAC;AAElF,QAAA,wBAAwB,GAAG,gDAA2C,CAAC;AAEvE,QAAA,gCAAgC,GAAG,6DAAwD,CAAC;AAE5F,QAAA,2BAA2B,GAAG,CAAC,CAAC;AAChC,QAAA,4BAA4B,GAAG,EAAE,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -20,6 +20,8 @@ Object.defineProperty(exports, "FastSimonSDK", { enumerable: true, get: function
|
|
|
20
20
|
var enums_1 = require("./sections/enums");
|
|
21
21
|
var debug_1 = require("./utils/debug");
|
|
22
22
|
var utilities_1 = require("@fast-simon/utilities");
|
|
23
|
+
var config_1 = require("./config");
|
|
24
|
+
var logger_1 = require("./utils/logger");
|
|
23
25
|
// Insert a debug script with the specified handle
|
|
24
26
|
function insertDebugScript(handle) {
|
|
25
27
|
var script = document.createElement('script');
|
|
@@ -40,7 +42,7 @@ window._debugSDKVersion = function (version) {
|
|
|
40
42
|
};
|
|
41
43
|
// Immediately-invoked function to initialize the SDK or load the debug version
|
|
42
44
|
(function () {
|
|
43
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
44
46
|
var testVersion = localStorage.getItem(utilities_1.FSKeys.ISP_SDK_TEST_VERSION_HANDLE);
|
|
45
47
|
var testVersionLoaded = localStorage.getItem(utilities_1.FSKeys.ISP_SDK_TEST_VERSION_LOADED);
|
|
46
48
|
if (testVersion && !testVersionLoaded) {
|
|
@@ -55,17 +57,26 @@ window._debugSDKVersion = function (version) {
|
|
|
55
57
|
window.FastSimonRecommendationsSource = enums_1.FastRecommendationsSource;
|
|
56
58
|
window.debugSDK = debug_1.debugSDK;
|
|
57
59
|
window.clearDebugSDK = debug_1.clearDebugSDK;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
window._verboseSDK = debug_1.verboseSDK;
|
|
61
|
+
if ((_a = window.__fast_simon_sdk_config) === null || _a === void 0 ? void 0 : _a.verbose) {
|
|
62
|
+
localStorage.setItem(config_1.SDK_VERBOSE_LS_KEY, 'true');
|
|
63
|
+
}
|
|
64
|
+
(0, logger_1.verboseLog)('Verbose logging enabled');
|
|
65
|
+
if ((((_b = window.__fast_simon_sdk_config) === null || _b === void 0 ? void 0 : _b.store_uuid) || ((_c = window.__fast_simon_sdk_config) === null || _c === void 0 ? void 0 : _c.uuid)) && (((_d = window.__fast_simon_sdk_config) === null || _d === void 0 ? void 0 : _d.store_id) || ((_e = window.__fast_simon_sdk_config) === null || _e === void 0 ? void 0 : _e.storeID)) &&
|
|
66
|
+
((_f = window.__fast_simon_sdk_config) === null || _f === void 0 ? void 0 : _f.onReady)) {
|
|
60
67
|
window.FastSimonSDK.initialization({
|
|
61
|
-
storeID: (
|
|
62
|
-
uuid: (
|
|
63
|
-
type: (
|
|
64
|
-
withAttributes: (
|
|
68
|
+
storeID: (_h = (_g = window.__fast_simon_sdk_config) === null || _g === void 0 ? void 0 : _g.store_id) !== null && _h !== void 0 ? _h : (_j = window.__fast_simon_sdk_config) === null || _j === void 0 ? void 0 : _j.storeID,
|
|
69
|
+
uuid: (_l = (_k = window.__fast_simon_sdk_config) === null || _k === void 0 ? void 0 : _k.store_uuid) !== null && _l !== void 0 ? _l : (_m = window.__fast_simon_sdk_config) === null || _m === void 0 ? void 0 : _m.uuid,
|
|
70
|
+
type: (_o = window.__fast_simon_sdk_config) === null || _o === void 0 ? void 0 : _o.type,
|
|
71
|
+
withAttributes: (_p = window.__fast_simon_sdk_config) === null || _p === void 0 ? void 0 : _p.withAttributes,
|
|
72
|
+
withProductVariants: (_q = window.__fast_simon_sdk_config) === null || _q === void 0 ? void 0 : _q.withProductVariants,
|
|
73
|
+
channel: (_r = window.__fast_simon_sdk_config) === null || _r === void 0 ? void 0 : _r.channel,
|
|
74
|
+
verbose: (_s = window.__fast_simon_sdk_config) === null || _s === void 0 ? void 0 : _s.verbose,
|
|
65
75
|
onReady: function () {
|
|
66
76
|
var _a;
|
|
67
77
|
(_a = window.__fast_simon_sdk_config) === null || _a === void 0 ? void 0 : _a.onReady();
|
|
68
|
-
}
|
|
78
|
+
},
|
|
79
|
+
onError: (_t = window.__fast_simon_sdk_config) === null || _t === void 0 ? void 0 : _t.onError
|
|
69
80
|
});
|
|
70
81
|
}
|
|
71
82
|
})();
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAmC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAmC;AAoEpB,6FApEP,kBAAO,OAoEY;AAnE3B,0CAAmG;AACnG,uCAAkE;AAClE,mDAA6C;AAC7C,mCAA4C;AAC5C,yCAA0C;AAE1C,kDAAkD;AAClD,SAAS,iBAAiB,CAAC,MAAc;IACrC,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,CAAC,GAAG,GAAG,2CAAoC,MAAM,uBAAoB,CAAC;IAC5E,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,MAAM,CAAC,MAAM,GAAG,cAAM,UAAU,CAAC,cAAM,YAAY,CAAC,UAAU,CAAC,kBAAM,CAAC,2BAA2B,CAAC,CAAC,CAAA,CAAC,EAAC,GAAG,CAAC,CAAC,CAAA,CAAC,CAAC;IAC5G,QAAQ,CAA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,mDAAiC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { AutocompleteResults, CollectionsPersonalization } from "./common";
|
|
2
2
|
import { Product } from "./fullTextSearch";
|
|
3
|
+
import { ArticleResponse } from "../services/content";
|
|
3
4
|
export interface DashboardResponse extends DashboardKeys {
|
|
4
5
|
cdn_cache_key: number;
|
|
5
6
|
platform: string;
|
|
7
|
+
state?: number;
|
|
6
8
|
}
|
|
7
9
|
export interface DashboardKeys {
|
|
8
10
|
site_url: string;
|
|
@@ -31,6 +33,8 @@ export interface DashboardKeys {
|
|
|
31
33
|
has_visual_discovery_tapcart?: boolean;
|
|
32
34
|
collectionsPersonalization?: CollectionsPersonalization;
|
|
33
35
|
searchPersonalization?: boolean;
|
|
36
|
+
is_attentive_recommendations?: boolean;
|
|
37
|
+
isp_attentive?: boolean;
|
|
34
38
|
}
|
|
35
39
|
export interface PopResponse {
|
|
36
40
|
products: Product[];
|
|
@@ -71,3 +75,10 @@ export type AutocompleteCallback = ({}: {
|
|
|
71
75
|
action: "instantSearch";
|
|
72
76
|
payload: AutocompleteResults;
|
|
73
77
|
}) => void;
|
|
78
|
+
export type AutocompleteContentCallback = ({}: {
|
|
79
|
+
action: "instantSearchArticles";
|
|
80
|
+
payload: {
|
|
81
|
+
articles: ArticleResponse[];
|
|
82
|
+
query: string;
|
|
83
|
+
};
|
|
84
|
+
}) => void;
|
package/lib/models/common.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { AutocompleteCallback, DashboardKeys, FastCategory, FastTurbolinks, PopularSearch } from "./autocomplete";
|
|
1
|
+
import { AutocompleteCallback, AutocompleteContentCallback, DashboardKeys, FastCategory, FastTurbolinks, PopularSearch } from "./autocomplete";
|
|
2
2
|
import { Facet, fullTextCallback, fullTextFacetsCallback, fullTextProductsCallback, Narrow, Product, SortBy } from "./fullTextSearch";
|
|
3
3
|
import { CategoryAncestor, RelatedCategory, smartCollectionsCallback, smartCollectionsResults } from "./smartCollections";
|
|
4
4
|
import { Report } from "./events";
|
|
5
5
|
import { Specs, SRC_TYPES, WidgetCallback } from "./related";
|
|
6
6
|
import { ContentSearchProps } from "./content";
|
|
7
7
|
import { inventoryCallback } from "./productsInventory";
|
|
8
|
-
import { AppReference, DiscoveryCallback, ImageSearchCallback, ImageSendCallback, ProductsByImageCallback, ProductsDiscoveryCallback, ResultType } from "./visualDiscovery";
|
|
8
|
+
import { AppReference, DiscoveryCallback, ImageSearchCallback, ImageSendCallback, ProductsByImageCallback, ProductsDiscoveryCallback, ResultType, SimilarStylesCallback } from "./visualDiscovery";
|
|
9
|
+
import { DiscoveryProductVisitType } from "../services/visualDiscoveryReporting";
|
|
10
|
+
import { ArticleResponse } from "../services/content";
|
|
9
11
|
export type AppType = "SPA" | "MPA";
|
|
10
12
|
export type SDKStatus = "loading" | "error" | "ready";
|
|
11
13
|
type ContentPage = number;
|
|
@@ -21,6 +23,7 @@ export interface SDKData {
|
|
|
21
23
|
popularProducts: Product[];
|
|
22
24
|
categories: FastCategory[];
|
|
23
25
|
turbolinks: FastTurbolinks[];
|
|
26
|
+
articles: ArticleResponse[];
|
|
24
27
|
contentData: Record<ContentPage, ContentCursor>;
|
|
25
28
|
withProductVariants?: boolean;
|
|
26
29
|
withAttributes?: boolean;
|
|
@@ -33,6 +36,13 @@ export interface SDKData {
|
|
|
33
36
|
personalizedProducts?: string | undefined;
|
|
34
37
|
collectionsPersonalization?: CollectionsPersonalization;
|
|
35
38
|
searchPersonalization?: boolean;
|
|
39
|
+
channel?: Channel;
|
|
40
|
+
collectionProductIds?: {
|
|
41
|
+
[key: string]: boolean;
|
|
42
|
+
};
|
|
43
|
+
spv?: string | undefined;
|
|
44
|
+
spv_post_load?: string | undefined;
|
|
45
|
+
siteState?: number;
|
|
36
46
|
}
|
|
37
47
|
export interface AutocompleteResults {
|
|
38
48
|
totalResults: number;
|
|
@@ -58,6 +68,7 @@ export interface FullTextResults {
|
|
|
58
68
|
turbolink?: FastTurbolinks;
|
|
59
69
|
relatedCategories?: RelatedCategory[];
|
|
60
70
|
relatedResults?: boolean;
|
|
71
|
+
error?: boolean;
|
|
61
72
|
}
|
|
62
73
|
export interface LandingPageResults {
|
|
63
74
|
slug: string;
|
|
@@ -74,18 +85,24 @@ export interface LandingPageResults {
|
|
|
74
85
|
bannerHTML?: string;
|
|
75
86
|
title?: string;
|
|
76
87
|
}
|
|
88
|
+
export interface CustomData {
|
|
89
|
+
productsPerPage?: number;
|
|
90
|
+
}
|
|
77
91
|
export interface SDKTemp {
|
|
78
92
|
autocomplete: AutocompleteResults;
|
|
79
93
|
fullTextSearch: FullTextResults;
|
|
80
94
|
smartCollections: smartCollectionsResults;
|
|
81
95
|
landingPage: LandingPageResults;
|
|
96
|
+
customData: CustomData;
|
|
82
97
|
}
|
|
83
98
|
export interface initProps {
|
|
84
99
|
storeID: number;
|
|
85
100
|
uuid: string;
|
|
86
101
|
type: AppType;
|
|
87
102
|
onReady?: VoidFunction;
|
|
103
|
+
onError?: (error: any) => void;
|
|
88
104
|
cartToken?: string;
|
|
105
|
+
verbose?: boolean;
|
|
89
106
|
}
|
|
90
107
|
export interface instantSearchProps {
|
|
91
108
|
query: string;
|
|
@@ -93,6 +110,8 @@ export interface instantSearchProps {
|
|
|
93
110
|
withAttributes?: boolean;
|
|
94
111
|
withCategories?: boolean;
|
|
95
112
|
withProductTypes?: boolean;
|
|
113
|
+
withProductVariants?: boolean;
|
|
114
|
+
articlesCallback?: AutocompleteContentCallback;
|
|
96
115
|
}
|
|
97
116
|
export interface FullTextSearchProps {
|
|
98
117
|
term: string;
|
|
@@ -189,6 +208,7 @@ export interface SDKUtils {
|
|
|
189
208
|
status: "loading" | "done";
|
|
190
209
|
data: Record<string, any>;
|
|
191
210
|
} | Record<string, any>;
|
|
211
|
+
viewportImpressions?: any;
|
|
192
212
|
}
|
|
193
213
|
export interface PopularProductsProps {
|
|
194
214
|
withAttributes?: boolean;
|
|
@@ -216,6 +236,8 @@ export interface SDK {
|
|
|
216
236
|
sendImage: ({}: ImageSendInternalProps) => void;
|
|
217
237
|
ProductsByImage: ({}: ProductsByImageInternalProps) => void;
|
|
218
238
|
visualSearch: ({}: ImageSearchInternalProps) => void;
|
|
239
|
+
similarStyles: ({}: SimilarStylesInternalProps) => void;
|
|
240
|
+
trackViewportImpression: (element: HTMLElement, productId: string, position: number) => void;
|
|
219
241
|
}
|
|
220
242
|
export declare const defaultSDKTemp: SDKTemp;
|
|
221
243
|
export declare const defaultDashboardData: DashboardKeys;
|
|
@@ -250,11 +272,20 @@ export interface ProductsByImageInternalProps {
|
|
|
250
272
|
callback: ProductsByImageCallback;
|
|
251
273
|
reference?: AppReference;
|
|
252
274
|
imageBase64?: string | null;
|
|
275
|
+
bboxCallback: ProductsByImageCallback;
|
|
276
|
+
itemName?: string | undefined;
|
|
253
277
|
}
|
|
254
278
|
export interface ImageSearchInternalProps {
|
|
255
279
|
fileData: File;
|
|
256
280
|
itemName: string | undefined;
|
|
257
281
|
callback: ImageSearchCallback;
|
|
282
|
+
bboxCallback: ImageSearchCallback;
|
|
283
|
+
}
|
|
284
|
+
export interface SimilarStylesInternalProps {
|
|
285
|
+
productId: string;
|
|
286
|
+
imageUrl: string;
|
|
287
|
+
cdnCacheKey: string;
|
|
288
|
+
callback: SimilarStylesCallback;
|
|
258
289
|
}
|
|
259
290
|
export interface CollectionsPersonalization {
|
|
260
291
|
active: boolean;
|
|
@@ -264,4 +295,31 @@ export interface CollectionsPersonalization {
|
|
|
264
295
|
recencyLimit: number;
|
|
265
296
|
maxRecencyLimit: number;
|
|
266
297
|
}
|
|
298
|
+
export interface DiscoveryOpenInternalProps {
|
|
299
|
+
reference: AppReference;
|
|
300
|
+
}
|
|
301
|
+
export interface DiscoveryProductVisitInternalProps {
|
|
302
|
+
type: DiscoveryProductVisitType;
|
|
303
|
+
origin: string;
|
|
304
|
+
productId: string;
|
|
305
|
+
position: number;
|
|
306
|
+
reference: AppReference;
|
|
307
|
+
}
|
|
308
|
+
export interface ProductAddedToCartPropsInternalProps {
|
|
309
|
+
origin: string;
|
|
310
|
+
productId: string;
|
|
311
|
+
position: number;
|
|
312
|
+
reference: AppReference;
|
|
313
|
+
}
|
|
314
|
+
export interface GalleryImageClickedPropsInternalProps {
|
|
315
|
+
imageId: string;
|
|
316
|
+
reference: AppReference;
|
|
317
|
+
}
|
|
318
|
+
export interface SearchPersonalization {
|
|
319
|
+
active: boolean;
|
|
320
|
+
avoidProducts: string[] | null;
|
|
321
|
+
recencyLimit: number;
|
|
322
|
+
maxRecencyLimit: number;
|
|
323
|
+
}
|
|
324
|
+
export type Channel = "tapcart";
|
|
267
325
|
export {};
|
package/lib/models/common.js
CHANGED
|
@@ -30,6 +30,9 @@ exports.defaultSDKTemp = {
|
|
|
30
30
|
products: [],
|
|
31
31
|
facets: [],
|
|
32
32
|
totalResults: 0
|
|
33
|
+
},
|
|
34
|
+
customData: {
|
|
35
|
+
productsPerPage: 0
|
|
33
36
|
}
|
|
34
37
|
};
|
|
35
38
|
exports.defaultDashboardData = {
|
|
@@ -60,6 +63,7 @@ exports.defaultSDKData = {
|
|
|
60
63
|
popularProducts: [],
|
|
61
64
|
categories: [],
|
|
62
65
|
turbolinks: [],
|
|
66
|
+
articles: [],
|
|
63
67
|
contentData: { 0: "" },
|
|
64
68
|
abTestingVariations: {}
|
|
65
69
|
};
|
package/lib/models/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/models/common.ts"],"names":[],"mappings":";;;AAaA,oCAAsD;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/models/common.ts"],"names":[],"mappings":";;;AAaA,oCAAsD;AAoQzC,QAAA,cAAc,GAAY;IACnC,YAAY,EAAE;QACV,YAAY,EAAE,CAAC;QACf,UAAU,EAAE,EAAE;QACd,eAAe,EAAE,EAAE;QACnB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,KAAK,EAAE,EAAE;K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,EAAE;IACd,QAAQ,EAAE,EAAE;IACZ,WAAW,EAAE,EAAC,CAAC,EAAE,EAAE,EAAC;IACpB,mBAAmB,EAAE,EAAE;CAC1B,CAAC"}
|
package/lib/models/content.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { Channel } from "./common";
|
|
1
2
|
export interface ContentSearchServiceProps {
|
|
2
3
|
storeID: number;
|
|
3
4
|
uuid: string;
|
|
4
5
|
cdn: number;
|
|
5
6
|
query: string;
|
|
6
7
|
cursor?: string;
|
|
8
|
+
channel?: Channel;
|
|
7
9
|
}
|
|
8
10
|
export type ContentItem = [contentTitle, contentURL, contentDescription, null, contentImage];
|
|
9
11
|
type contentTitle = string;
|
package/lib/models/events.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface Report<T> {
|
|
|
11
11
|
payload: any;
|
|
12
12
|
}) => void;
|
|
13
13
|
}
|
|
14
|
-
export type EventName = "instantsearch-product" | "instantsearch-popular-search" | "instantsearch-category" | "search" | "collection" | "productFromSearch" | "productFromCollection" | "promoTileFromSearch" | "promoTileFromCollection" | "productFromRecommendation" | "productDirect" | "lookALikeViewSerp" | "quickViewSerp" | "lookALikeViewCollection" | "quickViewCollection" | "productFromLookALike" | "productFromQuickView" | "cartVisited" | "cartPerformed" | "collectionPreformedFromTurbolink";
|
|
14
|
+
export type EventName = "instantsearch-product" | "instantsearch-popular-search" | "instantsearch-category" | "search" | "collection" | "productFromSearch" | "productFromCollection" | "promoTileFromSearch" | "promoTileFromCollection" | "productFromRecommendation" | "productDirect" | "lookALikeViewSerp" | "quickViewSerp" | "lookALikeViewCollection" | "quickViewCollection" | "productFromLookALike" | "productFromQuickView" | "cartVisited" | "cartPerformed" | "collectionPreformedFromTurbolink" | "discoveryOpen" | "discoveryProductVisit" | "vsProductAddedToCart" | "galleryImageClicked" | "recommendationsProductsShown" | "quickViewWidget";
|
|
15
15
|
export interface ProductSeenAutocompleteData {
|
|
16
16
|
query: string;
|
|
17
17
|
productID: string;
|
|
@@ -42,6 +42,7 @@ export interface PromotileSeenSerpData {
|
|
|
42
42
|
export interface ProductSeenRecommendations {
|
|
43
43
|
productID: string;
|
|
44
44
|
sourceProductID: string;
|
|
45
|
+
widget_id?: string;
|
|
45
46
|
position?: number;
|
|
46
47
|
}
|
|
47
48
|
export interface ProductSeenFromLookALike {
|
|
@@ -101,9 +102,17 @@ export interface QuickViewCollectionData {
|
|
|
101
102
|
productID: string;
|
|
102
103
|
position: number;
|
|
103
104
|
}
|
|
105
|
+
export interface QuickViewWidgetData {
|
|
106
|
+
widget_id: string;
|
|
107
|
+
productID: string;
|
|
108
|
+
position: number;
|
|
109
|
+
}
|
|
104
110
|
export interface PostLoadResponse {
|
|
105
111
|
isp_token: string;
|
|
112
|
+
variation_id?: string;
|
|
113
|
+
location?: string;
|
|
106
114
|
isp_segments_serving?: boolean;
|
|
115
|
+
personalization_segment?: string;
|
|
107
116
|
}
|
|
108
117
|
export interface DirectProductViewData {
|
|
109
118
|
productID: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Currency } from "./autocomplete";
|
|
2
2
|
import { CategoryAncestor } from "./smartCollections";
|
|
3
|
-
import { FullTextResults } from "./common";
|
|
3
|
+
import { Channel, FullTextResults, SDKUtils } from "./common";
|
|
4
4
|
export interface fullTextSearchResponse {
|
|
5
5
|
items: Product[];
|
|
6
6
|
facets: Facet[];
|
|
@@ -35,6 +35,7 @@ export interface fullTextSearchProps {
|
|
|
35
35
|
facetRequired?: FacetRequired;
|
|
36
36
|
withAttributes?: boolean;
|
|
37
37
|
recent?: string;
|
|
38
|
+
recentTimestamps?: Record<string, number>;
|
|
38
39
|
searchWithinSearch?: string;
|
|
39
40
|
segments?: string[];
|
|
40
41
|
hasShopifyMarkets?: boolean;
|
|
@@ -42,7 +43,7 @@ export interface fullTextSearchProps {
|
|
|
42
43
|
withProductTypes?: boolean;
|
|
43
44
|
abTestingVariations?: {
|
|
44
45
|
[key: string]: {
|
|
45
|
-
[key: string]:
|
|
46
|
+
[key: string]: any;
|
|
46
47
|
};
|
|
47
48
|
};
|
|
48
49
|
disableMerchandising?: boolean;
|
|
@@ -51,6 +52,8 @@ export interface fullTextSearchProps {
|
|
|
51
52
|
isPersonalizedFiltersActive?: boolean;
|
|
52
53
|
disableTurbolinks?: boolean;
|
|
53
54
|
searchPersonalization?: boolean;
|
|
55
|
+
channel?: Channel;
|
|
56
|
+
self?: SDKUtils;
|
|
54
57
|
}
|
|
55
58
|
export type SortBy = "price_min_to_max" | "price_max_to_min" | "creation_date" | "creation_date_oldest" | "popularity" | "reviews" | "a_to_z" | "z_to_a" | 'relevency';
|
|
56
59
|
export declare function isSortBy(sort: string | undefined): sort is SortBy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fullTextSearch.js","sourceRoot":"","sources":["../../src/models/fullTextSearch.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fullTextSearch.js","sourceRoot":"","sources":["../../src/models/fullTextSearch.ts"],"names":[],"mappings":";;;AAuEA,4BAMC;AAND,SAAgB,QAAQ,CAAC,IAAwB;IAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,CAAC,CAAC,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,sBAAsB,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxK,CAAC;AAQD,IAAY,eAKX;AALD,WAAY,eAAe;IACvB,6EAAgB,CAAA;IAChB,yFAAsB,CAAA;IACtB,qFAAoB,CAAA;IACpB,mFAAmB,CAAA;AACvB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B"}
|
package/lib/models/related.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export interface Widget {
|
|
|
14
14
|
categoriesIDs: string[];
|
|
15
15
|
payload: Product[];
|
|
16
16
|
sources: string;
|
|
17
|
+
title?: string;
|
|
18
|
+
similarByAttributesTiers?: Record<string, string[]>;
|
|
17
19
|
}
|
|
18
20
|
export type WidgetCallback = (response: RecommendationsResponse) => void;
|
|
19
21
|
export interface RecommendationsResponse {
|
|
@@ -31,5 +33,6 @@ interface WidgetResponse {
|
|
|
31
33
|
widget_id: string;
|
|
32
34
|
products: Product[];
|
|
33
35
|
promoted_by_personalization?: number[];
|
|
36
|
+
similar_by_attributes_tiers?: Record<string, string[]>;
|
|
34
37
|
}
|
|
35
38
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FacetRequired, Narrow, Product, RelatedCategoryServer, SortBy } from "./fullTextSearch";
|
|
2
2
|
import { ServerFacet } from "@fast-simon/utilities";
|
|
3
|
-
import { CollectionsPersonalization } from "./common";
|
|
3
|
+
import { Channel, CollectionsPersonalization, SDKUtils } from "./common";
|
|
4
4
|
export interface SmartCollectionsResponse {
|
|
5
5
|
ancestor_categories: CategoryAncestor[];
|
|
6
6
|
category_description: string;
|
|
@@ -43,6 +43,7 @@ export interface smartCollections {
|
|
|
43
43
|
facetRequired?: FacetRequired;
|
|
44
44
|
withAttributes?: boolean;
|
|
45
45
|
recent?: string;
|
|
46
|
+
recentTimestamps?: Record<string, number>;
|
|
46
47
|
rec?: boolean;
|
|
47
48
|
searchWithinSearch?: string;
|
|
48
49
|
segments?: string[];
|
|
@@ -60,6 +61,8 @@ export interface smartCollections {
|
|
|
60
61
|
isPersonalizedFiltersActive?: boolean;
|
|
61
62
|
disableTurbolinks?: boolean;
|
|
62
63
|
collectionPersonalization?: CollectionsPersonalization;
|
|
64
|
+
channel?: Channel;
|
|
65
|
+
self?: SDKUtils;
|
|
63
66
|
}
|
|
64
67
|
export interface smartCollectionsResults {
|
|
65
68
|
ancestors: CategoryAncestor[];
|
|
@@ -77,6 +80,7 @@ export interface smartCollectionsResults {
|
|
|
77
80
|
merch?: any;
|
|
78
81
|
bannerHTML?: string;
|
|
79
82
|
relatedCategories?: RelatedCategory[];
|
|
83
|
+
error?: boolean;
|
|
80
84
|
}
|
|
81
85
|
export type smartCollectionsCallback = ({}: {
|
|
82
86
|
action: "products" | "facets and products";
|