fast-simon-sdk 1.6.4 → 1.6.9
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/lib/config.d.ts +25 -22
- package/lib/config.js +30 -27
- package/lib/config.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js +72 -71
- package/lib/index.js.map +1 -1
- package/lib/models/autocomplete.d.ts +73 -70
- package/lib/models/autocomplete.js +2 -2
- package/lib/models/common.d.ts +267 -208
- package/lib/models/common.js +65 -63
- package/lib/models/common.js.map +1 -1
- package/lib/models/content.d.ts +37 -37
- package/lib/models/content.js +2 -2
- package/lib/models/events.d.ts +113 -87
- package/lib/models/events.js +2 -2
- package/lib/models/exports.d.ts +6 -6
- package/lib/models/exports.js +5 -5
- package/lib/models/fullTextSearch.d.ts +130 -126
- package/lib/models/fullTextSearch.js +17 -17
- package/lib/models/fullTextSearch.js.map +1 -1
- package/lib/models/lookAlikeProductRecommendation.d.ts +8 -8
- package/lib/models/lookAlikeProductRecommendation.js +2 -2
- package/lib/models/productsInventory.d.ts +10 -10
- package/lib/models/productsInventory.js +2 -2
- package/lib/models/related.d.ts +35 -35
- package/lib/models/related.js +2 -2
- package/lib/models/smartCollections.d.ts +94 -90
- package/lib/models/smartCollections.js +2 -2
- package/lib/models/visualDiscovery.d.ts +129 -0
- package/lib/models/visualDiscovery.js +31 -0
- package/lib/models/visualDiscovery.js.map +1 -0
- package/lib/sections/contentSearch/index.d.ts +7 -7
- package/lib/sections/contentSearch/index.js +44 -44
- package/lib/sections/contentSearch/index.js.map +1 -1
- package/lib/sections/enums/index.d.ts +47 -45
- package/lib/sections/enums/index.js +50 -48
- package/lib/sections/enums/index.js.map +1 -1
- package/lib/sections/eventReporter/index.d.ts +10 -10
- package/lib/sections/eventReporter/index.js +628 -501
- package/lib/sections/eventReporter/index.js.map +1 -1
- package/lib/sections/eventReporter/utils.d.ts +9 -9
- package/lib/sections/eventReporter/utils.js +31 -29
- package/lib/sections/eventReporter/utils.js.map +1 -1
- package/lib/sections/fullTextSearch/index.d.ts +6 -6
- package/lib/sections/fullTextSearch/index.js +178 -171
- package/lib/sections/fullTextSearch/index.js.map +1 -1
- package/lib/sections/fullTextSearch/utils.d.ts +17 -17
- package/lib/sections/fullTextSearch/utils.js +185 -177
- package/lib/sections/fullTextSearch/utils.js.map +1 -1
- package/lib/sections/index.d.ts +3 -3
- package/lib/sections/index.js +432 -342
- package/lib/sections/index.js.map +1 -1
- package/lib/sections/initialization/index.d.ts +8 -8
- package/lib/sections/initialization/index.js +150 -150
- package/lib/sections/initialization/index.js.map +1 -1
- package/lib/sections/initialization/utils.d.ts +11 -11
- package/lib/sections/initialization/utils.js +200 -196
- package/lib/sections/initialization/utils.js.map +1 -1
- package/lib/sections/instantSearch/index.d.ts +6 -6
- package/lib/sections/instantSearch/index.js +66 -66
- package/lib/sections/instantSearch/index.js.map +1 -1
- package/lib/sections/instantSearch/utils.d.ts +21 -21
- package/lib/sections/instantSearch/utils.js +232 -232
- package/lib/sections/instantSearch/utils.js.map +1 -1
- package/lib/sections/landingPage/index.d.ts +6 -6
- package/lib/sections/landingPage/index.js +95 -95
- package/lib/sections/landingPage/index.js.map +1 -1
- package/lib/sections/landingPage/utils.d.ts +14 -14
- package/lib/sections/landingPage/utils.js +96 -90
- package/lib/sections/landingPage/utils.js.map +1 -1
- package/lib/sections/lookAlikeProductRecommendation/index.d.ts +6 -6
- package/lib/sections/lookAlikeProductRecommendation/index.js +23 -23
- package/lib/sections/recommendations/index.d.ts +10 -6
- package/lib/sections/recommendations/index.js +95 -48
- package/lib/sections/recommendations/index.js.map +1 -1
- package/lib/sections/recommendations/utils.d.ts +6 -7
- package/lib/sections/recommendations/utils.js +82 -91
- package/lib/sections/recommendations/utils.js.map +1 -1
- package/lib/sections/smartCollections/index.d.ts +6 -6
- package/lib/sections/smartCollections/index.js +169 -163
- package/lib/sections/smartCollections/index.js.map +1 -1
- package/lib/sections/smartCollections/utils.d.ts +41 -40
- package/lib/sections/smartCollections/utils.js +286 -269
- package/lib/sections/smartCollections/utils.js.map +1 -1
- package/lib/sections/visualDiscovery/index.d.ts +22 -0
- package/lib/sections/visualDiscovery/index.js +262 -0
- package/lib/sections/visualDiscovery/index.js.map +1 -0
- package/lib/services/autocomplete.d.ts +24 -24
- package/lib/services/autocomplete.js +50 -50
- package/lib/services/common.d.ts +35 -35
- package/lib/services/common.js +94 -94
- package/lib/services/content.d.ts +4 -4
- package/lib/services/content.js +25 -25
- package/lib/services/fullTextSearch.d.ts +4 -4
- package/lib/services/fullTextSearch.js +87 -84
- package/lib/services/fullTextSearch.js.map +1 -1
- package/lib/services/landingPage.d.ts +21 -21
- package/lib/services/landingPage.js +44 -44
- package/lib/services/lookAlikeProductRecommendation.d.ts +13 -13
- package/lib/services/lookAlikeProductRecommendation.js +23 -23
- package/lib/services/related.d.ts +48 -29
- package/lib/services/related.js +114 -72
- package/lib/services/related.js.map +1 -1
- package/lib/services/reporting.d.ts +80 -68
- package/lib/services/reporting.js +258 -208
- package/lib/services/reporting.js.map +1 -1
- package/lib/services/smartCollections.d.ts +5 -5
- package/lib/services/smartCollections.js +93 -82
- package/lib/services/smartCollections.js.map +1 -1
- package/lib/services/utils.d.ts +5 -5
- package/lib/services/utils.js +25 -25
- package/lib/services/utils.js.map +1 -1
- package/lib/services/visualDiscovery.d.ts +9 -0
- package/lib/services/visualDiscovery.js +167 -0
- package/lib/services/visualDiscovery.js.map +1 -0
- package/lib/utils/ABTesting.d.ts +2 -1
- package/lib/utils/ABTesting.js +27 -14
- package/lib/utils/ABTesting.js.map +1 -1
- package/lib/utils/API.d.ts +19 -19
- package/lib/utils/API.js +81 -81
- package/lib/utils/API.js.map +1 -1
- package/lib/utils/ArrayUtils.d.ts +2 -2
- package/lib/utils/ArrayUtils.js +16 -17
- package/lib/utils/ArrayUtils.js.map +1 -1
- package/lib/utils/bindingBoxes.d.ts +23 -0
- package/lib/utils/bindingBoxes.js +89 -0
- package/lib/utils/bindingBoxes.js.map +1 -0
- package/lib/utils/cookies.d.ts +13 -13
- package/lib/utils/cookies.js +50 -50
- package/lib/utils/debug.d.ts +4 -4
- package/lib/utils/debug.js +31 -31
- package/lib/utils/debug.js.map +1 -1
- package/lib/utils/duplicationsHandler.d.ts +19 -0
- package/lib/utils/duplicationsHandler.js +70 -0
- package/lib/utils/duplicationsHandler.js.map +1 -0
- package/lib/utils/filtersPersonalization.d.ts +3 -3
- package/lib/utils/filtersPersonalization.js +39 -39
- package/lib/utils/filtersPersonalization.js.map +1 -1
- package/lib/utils/image.d.ts +6 -0
- package/lib/utils/image.js +154 -0
- package/lib/utils/image.js.map +1 -0
- package/lib/utils/klaviyo.js +1 -1
- package/lib/utils/location.d.ts +1 -1
- package/lib/utils/location.js +11 -11
- package/lib/utils/location.js.map +1 -1
- package/lib/utils/mappingUtil.d.ts +4 -4
- package/lib/utils/mappingUtil.js +16 -16
- package/lib/utils/options.d.ts +23 -23
- package/lib/utils/options.js +16 -16
- package/lib/utils/personalization.d.ts +2 -0
- package/lib/utils/personalization.js +21 -0
- package/lib/utils/personalization.js.map +1 -0
- package/lib/utils/segments.d.ts +2 -2
- package/lib/utils/segments.js +19 -20
- package/lib/utils/segments.js.map +1 -1
- package/lib/utils/shopifyMarkets.d.ts +3 -3
- package/lib/utils/shopifyMarkets.js +12 -12
- package/lib/utils/sortUtil.d.ts +1 -0
- package/lib/utils/sortUtil.js +25 -0
- package/lib/utils/sortUtil.js.map +1 -0
- package/lib/utils/updateRecentSearches.d.ts +2 -1
- package/lib/utils/updateRecentSearches.js +56 -26
- package/lib/utils/updateRecentSearches.js.map +1 -1
- package/lib/utils/validation.d.ts +5 -5
- package/lib/utils/validation.js +46 -46
- package/lib/utils/validation.js.map +1 -1
- package/package.json +3 -2
package/lib/services/common.js
CHANGED
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Common = exports.debugVersion = void 0;
|
|
4
|
-
var API_1 = require("../utils/API");
|
|
5
|
-
var debug_1 = require("../utils/debug");
|
|
6
|
-
var segments_1 = require("../utils/segments");
|
|
7
|
-
var shopifyMarkets_1 = require("../utils/shopifyMarkets");
|
|
8
|
-
var REPORT_BASE = "https://ping.fastsimon.com";
|
|
9
|
-
var BASE_URL_API = "https://api.fastsimon.com";
|
|
10
|
-
exports.debugVersion = (0, debug_1.getDebugEndpoint)();
|
|
11
|
-
exports.Common = {
|
|
12
|
-
getLoad: function (_a) {
|
|
13
|
-
var uuid = _a.uuid, storeID = _a.storeID;
|
|
14
|
-
return API_1.API.get({
|
|
15
|
-
url: "".concat(exports.debugVersion || BASE_URL_API, "/load"),
|
|
16
|
-
params: {
|
|
17
|
-
UUID: uuid,
|
|
18
|
-
store_id: storeID,
|
|
19
|
-
m: (0, debug_1.isDebugCaching)() ? 1 : undefined
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
getPopularProducts: function (_a) {
|
|
24
|
-
var uuid = _a.uuid, storeID = _a.storeID, cdn = _a.cdn, withAttributes = _a.withAttributes, hasShopifyMarkets = _a.hasShopifyMarkets, withProductVariants = _a.withProductVariants, companyLocationContext = _a.companyLocationContext;
|
|
25
|
-
return API_1.API.get({
|
|
26
|
-
url: "".concat(exports.debugVersion || BASE_URL_API, "/pop"),
|
|
27
|
-
params: {
|
|
28
|
-
store_id: storeID,
|
|
29
|
-
src: "JSSDK",
|
|
30
|
-
UUID: uuid,
|
|
31
|
-
cdn_cache_key: cdn,
|
|
32
|
-
api_type: "json",
|
|
33
|
-
m: (0, debug_1.isDebugCaching)() ? 1 : undefined,
|
|
34
|
-
with_product_attributes: withAttributes ? withAttributes : undefined,
|
|
35
|
-
st: (0, segments_1.getSegments)(),
|
|
36
|
-
market_context: hasShopifyMarkets ? shopifyMarkets_1.default.getCountry() : undefined,
|
|
37
|
-
with_product_variants: withProductVariants ? withProductVariants : undefined,
|
|
38
|
-
company_location_context: companyLocationContext ? companyLocationContext : undefined
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
getCategories: function (_a) {
|
|
43
|
-
var uuid = _a.uuid, storeID = _a.storeID, cdn = _a.cdn;
|
|
44
|
-
return API_1.API.get({
|
|
45
|
-
url: "".concat(exports.debugVersion || BASE_URL_API, "/pop"),
|
|
46
|
-
params: {
|
|
47
|
-
store_id: storeID,
|
|
48
|
-
src: "JSSDK",
|
|
49
|
-
UUID: uuid,
|
|
50
|
-
cdn_cache_key: cdn,
|
|
51
|
-
c: 1,
|
|
52
|
-
api_type: "json",
|
|
53
|
-
m: (0, debug_1.isDebugCaching)() ? 1 : undefined,
|
|
54
|
-
st: (0, segments_1.getSegments)()
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
},
|
|
58
|
-
getTurbolinks: function (_a) {
|
|
59
|
-
var uuid = _a.uuid, storeID = _a.storeID, cdn = _a.cdn;
|
|
60
|
-
return API_1.API.get({
|
|
61
|
-
url: "".concat(exports.debugVersion || BASE_URL_API, "/pop"),
|
|
62
|
-
params: {
|
|
63
|
-
store_id: storeID,
|
|
64
|
-
src: "JSSDK",
|
|
65
|
-
UUID: uuid,
|
|
66
|
-
cdn_cache_key: cdn,
|
|
67
|
-
t: 1,
|
|
68
|
-
api_type: "json",
|
|
69
|
-
m: (0, debug_1.isDebugCaching)() ? 1 : undefined,
|
|
70
|
-
st: (0, segments_1.getSegments)()
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
},
|
|
74
|
-
getPostLoad: function (_a) {
|
|
75
|
-
var uuid = _a.uuid, storeID = _a.storeID;
|
|
76
|
-
return API_1.API.get({
|
|
77
|
-
url: "".concat(exports.debugVersion || REPORT_BASE, "/post_load"),
|
|
78
|
-
params: {
|
|
79
|
-
store_id: storeID,
|
|
80
|
-
UUID: uuid,
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
},
|
|
84
|
-
getBigcommerceCartToken: function () {
|
|
85
|
-
return API_1.API.get({
|
|
86
|
-
url: location.origin + '/api/storefront/cart'
|
|
87
|
-
});
|
|
88
|
-
},
|
|
89
|
-
getShopifyCartToken: function () {
|
|
90
|
-
return API_1.API.get({
|
|
91
|
-
url: location.origin + '/cart.js'
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Common = exports.debugVersion = void 0;
|
|
4
|
+
var API_1 = require("../utils/API");
|
|
5
|
+
var debug_1 = require("../utils/debug");
|
|
6
|
+
var segments_1 = require("../utils/segments");
|
|
7
|
+
var shopifyMarkets_1 = require("../utils/shopifyMarkets");
|
|
8
|
+
var REPORT_BASE = "https://ping.fastsimon.com";
|
|
9
|
+
var BASE_URL_API = "https://api.fastsimon.com";
|
|
10
|
+
exports.debugVersion = (0, debug_1.getDebugEndpoint)();
|
|
11
|
+
exports.Common = {
|
|
12
|
+
getLoad: function (_a) {
|
|
13
|
+
var uuid = _a.uuid, storeID = _a.storeID;
|
|
14
|
+
return API_1.API.get({
|
|
15
|
+
url: "".concat(exports.debugVersion || BASE_URL_API, "/load"),
|
|
16
|
+
params: {
|
|
17
|
+
UUID: uuid,
|
|
18
|
+
store_id: storeID,
|
|
19
|
+
m: (0, debug_1.isDebugCaching)() ? 1 : undefined
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
getPopularProducts: function (_a) {
|
|
24
|
+
var uuid = _a.uuid, storeID = _a.storeID, cdn = _a.cdn, withAttributes = _a.withAttributes, hasShopifyMarkets = _a.hasShopifyMarkets, withProductVariants = _a.withProductVariants, companyLocationContext = _a.companyLocationContext;
|
|
25
|
+
return API_1.API.get({
|
|
26
|
+
url: "".concat(exports.debugVersion || BASE_URL_API, "/pop"),
|
|
27
|
+
params: {
|
|
28
|
+
store_id: storeID,
|
|
29
|
+
src: "JSSDK",
|
|
30
|
+
UUID: uuid,
|
|
31
|
+
cdn_cache_key: cdn,
|
|
32
|
+
api_type: "json",
|
|
33
|
+
m: (0, debug_1.isDebugCaching)() ? 1 : undefined,
|
|
34
|
+
with_product_attributes: withAttributes ? withAttributes : undefined,
|
|
35
|
+
st: (0, segments_1.getSegments)(),
|
|
36
|
+
market_context: hasShopifyMarkets ? shopifyMarkets_1.default.getCountry() : undefined,
|
|
37
|
+
with_product_variants: withProductVariants ? withProductVariants : undefined,
|
|
38
|
+
company_location_context: companyLocationContext ? companyLocationContext : undefined
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
getCategories: function (_a) {
|
|
43
|
+
var uuid = _a.uuid, storeID = _a.storeID, cdn = _a.cdn;
|
|
44
|
+
return API_1.API.get({
|
|
45
|
+
url: "".concat(exports.debugVersion || BASE_URL_API, "/pop"),
|
|
46
|
+
params: {
|
|
47
|
+
store_id: storeID,
|
|
48
|
+
src: "JSSDK",
|
|
49
|
+
UUID: uuid,
|
|
50
|
+
cdn_cache_key: cdn,
|
|
51
|
+
c: 1,
|
|
52
|
+
api_type: "json",
|
|
53
|
+
m: (0, debug_1.isDebugCaching)() ? 1 : undefined,
|
|
54
|
+
st: (0, segments_1.getSegments)()
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
getTurbolinks: function (_a) {
|
|
59
|
+
var uuid = _a.uuid, storeID = _a.storeID, cdn = _a.cdn;
|
|
60
|
+
return API_1.API.get({
|
|
61
|
+
url: "".concat(exports.debugVersion || BASE_URL_API, "/pop"),
|
|
62
|
+
params: {
|
|
63
|
+
store_id: storeID,
|
|
64
|
+
src: "JSSDK",
|
|
65
|
+
UUID: uuid,
|
|
66
|
+
cdn_cache_key: cdn,
|
|
67
|
+
t: 1,
|
|
68
|
+
api_type: "json",
|
|
69
|
+
m: (0, debug_1.isDebugCaching)() ? 1 : undefined,
|
|
70
|
+
st: (0, segments_1.getSegments)()
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
getPostLoad: function (_a) {
|
|
75
|
+
var uuid = _a.uuid, storeID = _a.storeID;
|
|
76
|
+
return API_1.API.get({
|
|
77
|
+
url: "".concat(exports.debugVersion || REPORT_BASE, "/post_load"),
|
|
78
|
+
params: {
|
|
79
|
+
store_id: storeID,
|
|
80
|
+
UUID: uuid,
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
getBigcommerceCartToken: function () {
|
|
85
|
+
return API_1.API.get({
|
|
86
|
+
url: location.origin + '/api/storefront/cart'
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
getShopifyCartToken: function () {
|
|
90
|
+
return API_1.API.get({
|
|
91
|
+
url: location.origin + '/cart.js'
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
95
|
//# sourceMappingURL=common.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentSearchResponse, ContentSearchServiceProps } from "../models/content";
|
|
2
|
-
export declare const Content: {
|
|
3
|
-
search: ({ storeID, uuid, query, cursor, cdn }: ContentSearchServiceProps) => Promise<ContentSearchResponse>;
|
|
4
|
-
};
|
|
1
|
+
import { ContentSearchResponse, ContentSearchServiceProps } from "../models/content";
|
|
2
|
+
export declare const Content: {
|
|
3
|
+
search: ({ storeID, uuid, query, cursor, cdn }: ContentSearchServiceProps) => Promise<ContentSearchResponse>;
|
|
4
|
+
};
|
package/lib/services/content.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Content = void 0;
|
|
4
|
-
var API_1 = require("../utils/API");
|
|
5
|
-
var debug_1 = require("../utils/debug");
|
|
6
|
-
var BASE_URL = "https://api.fastsimon.com";
|
|
7
|
-
var debugVersion = (0, debug_1.getDebugEndpoint)();
|
|
8
|
-
exports.Content = {
|
|
9
|
-
search: function (_a) {
|
|
10
|
-
var storeID = _a.storeID, uuid = _a.uuid, query = _a.query, cursor = _a.cursor, cdn = _a.cdn;
|
|
11
|
-
var params = {
|
|
12
|
-
uuid: uuid,
|
|
13
|
-
store_id: storeID,
|
|
14
|
-
cdn_cache_key: cdn,
|
|
15
|
-
cursor: cursor,
|
|
16
|
-
q: query,
|
|
17
|
-
source: "fast-simon-sdk",
|
|
18
|
-
content_is_norm: true
|
|
19
|
-
};
|
|
20
|
-
return API_1.API.get({
|
|
21
|
-
url: "".concat(debugVersion || BASE_URL, "/cms_content_get_next"),
|
|
22
|
-
params: params
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Content = void 0;
|
|
4
|
+
var API_1 = require("../utils/API");
|
|
5
|
+
var debug_1 = require("../utils/debug");
|
|
6
|
+
var BASE_URL = "https://api.fastsimon.com";
|
|
7
|
+
var debugVersion = (0, debug_1.getDebugEndpoint)();
|
|
8
|
+
exports.Content = {
|
|
9
|
+
search: function (_a) {
|
|
10
|
+
var storeID = _a.storeID, uuid = _a.uuid, query = _a.query, cursor = _a.cursor, cdn = _a.cdn;
|
|
11
|
+
var params = {
|
|
12
|
+
uuid: uuid,
|
|
13
|
+
store_id: storeID,
|
|
14
|
+
cdn_cache_key: cdn,
|
|
15
|
+
cursor: cursor,
|
|
16
|
+
q: query,
|
|
17
|
+
source: "fast-simon-sdk",
|
|
18
|
+
content_is_norm: true
|
|
19
|
+
};
|
|
20
|
+
return API_1.API.get({
|
|
21
|
+
url: "".concat(debugVersion || BASE_URL, "/cms_content_get_next"),
|
|
22
|
+
params: params
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
26
|
//# sourceMappingURL=content.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fullTextSearchProps, fullTextSearchResponse } from "../models/fullTextSearch";
|
|
2
|
-
export declare const FullTextSearch: {
|
|
3
|
-
getFullTextSearch: ({ uuid, storeID, cdn, facetRequired, narrowBy, page, productsPerPage, term, sortBy, isPersonalizedFiltersActive, withAttributes, recent, searchWithinSearch, segments, hasShopifyMarkets, companyLocationContext, withProductTypes, userToken, abTestingVariations, disableMerchandisingRules, disableMerchandising, disableStrategies }: fullTextSearchProps) => Promise<fullTextSearchResponse>;
|
|
4
|
-
};
|
|
1
|
+
import { fullTextSearchProps, fullTextSearchResponse } from "../models/fullTextSearch";
|
|
2
|
+
export declare const FullTextSearch: {
|
|
3
|
+
getFullTextSearch: ({ uuid, storeID, cdn, facetRequired, narrowBy, page, productsPerPage, term, sortBy, isPersonalizedFiltersActive, withAttributes, recent, searchWithinSearch, segments, hasShopifyMarkets, companyLocationContext, withProductTypes, userToken, abTestingVariations, disableMerchandisingRules, disableMerchandising, disableStrategies, disableTurbolinks, searchPersonalization }: fullTextSearchProps) => Promise<fullTextSearchResponse>;
|
|
4
|
+
};
|
|
@@ -1,85 +1,88 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FullTextSearch = void 0;
|
|
4
|
-
var API_1 = require("../utils/API");
|
|
5
|
-
var debug_1 = require("../utils/debug");
|
|
6
|
-
var options_1 = require("../utils/options");
|
|
7
|
-
var segments_1 = require("../utils/segments");
|
|
8
|
-
var utils_1 = require("../sections/initialization/utils");
|
|
9
|
-
var bigcommerce_customer_1 = require("@fast-simon/bigcommerce_customer");
|
|
10
|
-
var location_1 = require("../utils/location");
|
|
11
|
-
var shopifyMarkets_1 = require("../utils/shopifyMarkets");
|
|
12
|
-
var config_1 = require("../config");
|
|
13
|
-
var ABTesting_1 = require("../utils/ABTesting");
|
|
14
|
-
var filtersPersonalization_1 = require("../utils/filtersPersonalization");
|
|
15
|
-
var BASE_URL = "https://api.fastsimon.com";
|
|
16
|
-
var debugVersion = (0, debug_1.getDebugEndpoint)();
|
|
17
|
-
exports.FullTextSearch = {
|
|
18
|
-
getFullTextSearch: function (_a) {
|
|
19
|
-
var _b;
|
|
20
|
-
var uuid = _a.uuid, storeID = _a.storeID, cdn = _a.cdn, facetRequired = _a.facetRequired, narrowBy = _a.narrowBy, page = _a.page, productsPerPage = _a.productsPerPage, term = _a.term, sortBy = _a.sortBy, isPersonalizedFiltersActive = _a.isPersonalizedFiltersActive, withAttributes = _a.withAttributes, recent = _a.recent, searchWithinSearch = _a.searchWithinSearch, segments = _a.segments, hasShopifyMarkets = _a.hasShopifyMarkets, companyLocationContext = _a.companyLocationContext, withProductTypes = _a.withProductTypes, userToken = _a.userToken, abTestingVariations = _a.abTestingVariations, disableMerchandisingRules = _a.disableMerchandisingRules, disableMerchandising = _a.disableMerchandising, disableStrategies = _a.disableStrategies;
|
|
21
|
-
var platform = (0, utils_1.getPlatform)();
|
|
22
|
-
var segmentsToken = (0, segments_1.getSegments)();
|
|
23
|
-
var stToken = (userToken ? userToken : (localStorage.getItem(config_1.USER_SESSION_TOKEN_LS_KEY) ? localStorage.getItem(config_1.USER_SESSION_TOKEN_LS_KEY) : undefined));
|
|
24
|
-
var variant_id = (0, ABTesting_1.
|
|
25
|
-
var hasVariant = false;
|
|
26
|
-
if (variant_id && (abTestingVariations === null || abTestingVariations === void 0 ? void 0 : abTestingVariations[variant_id])) {
|
|
27
|
-
hasVariant = true;
|
|
28
|
-
}
|
|
29
|
-
(0, filtersPersonalization_1.handleFiltersPersonalization)(narrowBy, isPersonalizedFiltersActive);
|
|
30
|
-
var filtersPersonalization = (0, filtersPersonalization_1.isFiltersPersonalization)(!!(narrowBy === null || narrowBy === void 0 ? void 0 : narrowBy.length), isPersonalizedFiltersActive);
|
|
31
|
-
var params = {
|
|
32
|
-
src: "JSSDK",
|
|
33
|
-
UUID: uuid,
|
|
34
|
-
store_id: storeID,
|
|
35
|
-
cdn_cache_key: cdn,
|
|
36
|
-
facets_required: facetRequired,
|
|
37
|
-
q: term,
|
|
38
|
-
page_num: page,
|
|
39
|
-
with_product_attributes: withAttributes,
|
|
40
|
-
narrow: JSON.stringify(narrowBy),
|
|
41
|
-
products_per_page: productsPerPage,
|
|
42
|
-
sort_by: sortBy,
|
|
43
|
-
sp: recent,
|
|
44
|
-
search_within_search: searchWithinSearch,
|
|
45
|
-
m: (0, debug_1.isDebugCaching)() ? 1 : undefined,
|
|
46
|
-
// ab_testing
|
|
47
|
-
disable_personalization: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_search_personalization"),
|
|
48
|
-
disable_merchandising: disableMerchandising ? "1" : undefined,
|
|
49
|
-
disable_merchandising_rules: disableMerchandisingRules ? "1" : undefined,
|
|
50
|
-
disable_strategies: disableStrategies ? "1" : undefined,
|
|
51
|
-
disable_semantics: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_semantics"),
|
|
52
|
-
//preview stuff
|
|
53
|
-
merchandising_rules: (0, options_1.getSDKABTestingOption)("merchandising_rules"),
|
|
54
|
-
strategy: (0, options_1.getSDKABTestingOption)("strategy"),
|
|
55
|
-
request_serial_number: (0, options_1.getSDKABTestingOption)("request_serial_number"),
|
|
56
|
-
related_search: (0, options_1.getSDKABTestingOption)("related_search"),
|
|
57
|
-
st: segmentsToken ? segmentsToken : (stToken && (recent || filtersPersonalization
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FullTextSearch = void 0;
|
|
4
|
+
var API_1 = require("../utils/API");
|
|
5
|
+
var debug_1 = require("../utils/debug");
|
|
6
|
+
var options_1 = require("../utils/options");
|
|
7
|
+
var segments_1 = require("../utils/segments");
|
|
8
|
+
var utils_1 = require("../sections/initialization/utils");
|
|
9
|
+
var bigcommerce_customer_1 = require("@fast-simon/bigcommerce_customer");
|
|
10
|
+
var location_1 = require("../utils/location");
|
|
11
|
+
var shopifyMarkets_1 = require("../utils/shopifyMarkets");
|
|
12
|
+
var config_1 = require("../config");
|
|
13
|
+
var ABTesting_1 = require("../utils/ABTesting");
|
|
14
|
+
var filtersPersonalization_1 = require("../utils/filtersPersonalization");
|
|
15
|
+
var BASE_URL = "https://api.fastsimon.com";
|
|
16
|
+
var debugVersion = (0, debug_1.getDebugEndpoint)();
|
|
17
|
+
exports.FullTextSearch = {
|
|
18
|
+
getFullTextSearch: function (_a) {
|
|
19
|
+
var _b;
|
|
20
|
+
var uuid = _a.uuid, storeID = _a.storeID, cdn = _a.cdn, facetRequired = _a.facetRequired, narrowBy = _a.narrowBy, page = _a.page, productsPerPage = _a.productsPerPage, term = _a.term, sortBy = _a.sortBy, isPersonalizedFiltersActive = _a.isPersonalizedFiltersActive, withAttributes = _a.withAttributes, recent = _a.recent, searchWithinSearch = _a.searchWithinSearch, segments = _a.segments, hasShopifyMarkets = _a.hasShopifyMarkets, companyLocationContext = _a.companyLocationContext, withProductTypes = _a.withProductTypes, userToken = _a.userToken, abTestingVariations = _a.abTestingVariations, disableMerchandisingRules = _a.disableMerchandisingRules, disableMerchandising = _a.disableMerchandising, disableStrategies = _a.disableStrategies, disableTurbolinks = _a.disableTurbolinks, searchPersonalization = _a.searchPersonalization;
|
|
21
|
+
var platform = (0, utils_1.getPlatform)();
|
|
22
|
+
var segmentsToken = (0, segments_1.getSegments)();
|
|
23
|
+
var stToken = (userToken ? userToken : (localStorage.getItem(config_1.USER_SESSION_TOKEN_LS_KEY) ? localStorage.getItem(config_1.USER_SESSION_TOKEN_LS_KEY) : undefined));
|
|
24
|
+
var variant_id = (0, ABTesting_1.getUserVariation)();
|
|
25
|
+
var hasVariant = false;
|
|
26
|
+
if (variant_id && ((abTestingVariations === null || abTestingVariations === void 0 ? void 0 : abTestingVariations[variant_id]) || variant_id === 'fs_no_variation')) {
|
|
27
|
+
hasVariant = true;
|
|
28
|
+
}
|
|
29
|
+
(0, filtersPersonalization_1.handleFiltersPersonalization)(narrowBy, isPersonalizedFiltersActive);
|
|
30
|
+
var filtersPersonalization = (0, filtersPersonalization_1.isFiltersPersonalization)(!!(narrowBy === null || narrowBy === void 0 ? void 0 : narrowBy.length), isPersonalizedFiltersActive);
|
|
31
|
+
var params = {
|
|
32
|
+
src: "JSSDK",
|
|
33
|
+
UUID: uuid,
|
|
34
|
+
store_id: storeID,
|
|
35
|
+
cdn_cache_key: cdn,
|
|
36
|
+
facets_required: facetRequired,
|
|
37
|
+
q: term,
|
|
38
|
+
page_num: page,
|
|
39
|
+
with_product_attributes: withAttributes,
|
|
40
|
+
narrow: JSON.stringify(narrowBy),
|
|
41
|
+
products_per_page: productsPerPage,
|
|
42
|
+
sort_by: sortBy,
|
|
43
|
+
sp: searchPersonalization ? recent : undefined,
|
|
44
|
+
search_within_search: searchWithinSearch,
|
|
45
|
+
m: (0, debug_1.isDebugCaching)() ? 1 : undefined,
|
|
46
|
+
// ab_testing
|
|
47
|
+
disable_personalization: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_search_personalization"),
|
|
48
|
+
disable_merchandising: disableMerchandising ? "1" : undefined,
|
|
49
|
+
disable_merchandising_rules: disableMerchandisingRules ? "1" : undefined,
|
|
50
|
+
disable_strategies: disableStrategies ? "1" : undefined,
|
|
51
|
+
disable_semantics: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_semantics"),
|
|
52
|
+
//preview stuff
|
|
53
|
+
merchandising_rules: (0, options_1.getSDKABTestingOption)("merchandising_rules"),
|
|
54
|
+
strategy: (0, options_1.getSDKABTestingOption)("strategy"),
|
|
55
|
+
request_serial_number: (0, options_1.getSDKABTestingOption)("request_serial_number"),
|
|
56
|
+
related_search: (0, options_1.getSDKABTestingOption)("related_search"),
|
|
57
|
+
st: segmentsToken !== null && segmentsToken !== void 0 ? segmentsToken : (stToken && searchPersonalization && (recent || filtersPersonalization || hasVariant)
|
|
58
|
+
? stToken
|
|
59
|
+
: undefined),
|
|
60
|
+
customer_group_id: platform === "Bigcommerce" ? bigcommerce_customer_1.bigcommerceCustomer.getBigcommerceCustomerGroupId() : undefined,
|
|
61
|
+
location: (0, location_1.default)(uuid) || undefined,
|
|
62
|
+
market_context: hasShopifyMarkets ? shopifyMarkets_1.default.getCountry() : undefined,
|
|
63
|
+
company_location_context: companyLocationContext ? companyLocationContext : undefined,
|
|
64
|
+
with_product_types: withProductTypes ? 1 : undefined,
|
|
65
|
+
variation_id: hasVariant ? variant_id : undefined,
|
|
66
|
+
disable_turbolinks: disableTurbolinks ? "1" : undefined
|
|
67
|
+
};
|
|
68
|
+
if ((0, options_1.getSDKABTestingOption)("reasoning")) {
|
|
69
|
+
params["vector_search_reasoning"] = (0, options_1.getReasoningVectorSearch)();
|
|
70
|
+
params["segments"] = (_b = JSON.stringify(segments)) !== null && _b !== void 0 ? _b : (0, segments_1.getSegments)();
|
|
71
|
+
return API_1.API.get({
|
|
72
|
+
url: "".concat(debugVersion || BASE_URL, "/full_text_search_reasoning"),
|
|
73
|
+
params: params,
|
|
74
|
+
config: {
|
|
75
|
+
headers: {
|
|
76
|
+
sid: (0, options_1.getSDKABTestingOption)("reasoning").split(":")[0],
|
|
77
|
+
site_key: (0, options_1.getSDKABTestingOption)("reasoning").split(":")[1],
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return API_1.API.get({
|
|
83
|
+
url: "".concat(debugVersion || BASE_URL, "/full_text_search"),
|
|
84
|
+
params: params
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
};
|
|
85
88
|
//# sourceMappingURL=fullTextSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fullTextSearch.js","sourceRoot":"","sources":["../../src/services/fullTextSearch.ts"],"names":[],"mappings":";;;AAAA,oCAAiC;AAEjC,wCAAgE;AAChE,4CAA6G;AAC7G,8CAA8C;AAC9C,0DAA6D;AAC7D,yEAAqE;AACrE,8CAAgD;AAChD,0DAAqD;AACrD,oCAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"fullTextSearch.js","sourceRoot":"","sources":["../../src/services/fullTextSearch.ts"],"names":[],"mappings":";;;AAAA,oCAAiC;AAEjC,wCAAgE;AAChE,4CAA6G;AAC7G,8CAA8C;AAC9C,0DAA6D;AAC7D,yEAAqE;AACrE,8CAAgD;AAChD,0DAAqD;AACrD,oCAAsD;AACtD,gDAAoD;AACpD,0EAAuG;AAEvG,IAAM,QAAQ,GAAG,2BAA2B,CAAC;AAE7C,IAAM,YAAY,GAAG,IAAA,wBAAgB,GAAE,CAAC;AAE3B,QAAA,cAAc,GAAG;IAC1B,iBAAiB,EAAE,UAAC,EAQsB;;YAPlB,IAAI,UAAA,EAAE,OAAO,aAAA,EAAE,GAAG,SAAA,EAClB,aAAa,mBAAA,EAAE,QAAQ,cAAA,EAAE,IAAI,UAAA,EAC7B,eAAe,qBAAA,EAAE,IAAI,UAAA,EAAE,MAAM,YAAA,EAAE,2BAA2B,iCAAA,EAC1D,cAAc,oBAAA,EAAE,MAAM,YAAA,EAAE,kBAAkB,wBAAA,EAAE,QAAQ,cAAA,EACpD,iBAAiB,uBAAA,EAAE,sBAAsB,4BAAA,EAAE,gBAAgB,sBAAA,EAAE,SAAS,eAAA,EACtE,mBAAmB,yBAAA,EAAE,yBAAyB,+BAAA,EAAE,oBAAoB,0BAAA,EAAE,iBAAiB,uBAAA,EACvF,iBAAiB,uBAAA,EAAE,qBAAqB,2BAAA;QAE5D,IAAM,QAAQ,GAAG,IAAA,mBAAW,GAAE,CAAC;QAC/B,IAAM,aAAa,GAAG,IAAA,sBAAW,GAAE,CAAC;QACpC,IAAM,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,kCAAyB,CAAC,CAAA,CAAC,CAAA,YAAY,CAAC,OAAO,CAAC,kCAAyB,CAAC,CAAA,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QACvJ,IAAM,UAAU,GAAG,IAAA,4BAAgB,GAAE,CAAC;QACtC,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,IAAI,UAAU,IAAI,CAAC,CAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAG,UAAU,CAAC,KAAI,UAAU,KAAK,iBAAiB,CAAC,EAAE,CAAC;YACxF,UAAU,GAAG,IAAI,CAAC;QACtB,CAAC;QACD,IAAA,qDAA4B,EAAC,QAAQ,EAAE,2BAA2B,CAAC,CAAC;QACpE,IAAM,sBAAsB,GAAG,IAAA,iDAAwB,EAAC,CAAC,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAA,EAAE,2BAA2B,CAAC,CAAC;QAEzG,IAAM,MAAM,GAAwB;YAChC,GAAG,EAAE,OAAO;YACZ,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,OAAO;YACjB,aAAa,EAAE,GAAG;YAClB,eAAe,EAAE,aAAa;YAC9B,CAAC,EAAE,IAAI;YACP,QAAQ,EAAE,IAAI;YACd,uBAAuB,EAAE,cAAc;YACvC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;YAChC,iBAAiB,EAAE,eAAe;YAClC,OAAO,EAAE,MAAM;YACf,EAAE,EAAE,qBAAqB,CAAA,CAAC,CAAC,MAAM,CAAA,CAAC,CAAC,SAAS;YAC5C,oBAAoB,EAAE,kBAAkB;YACxC,CAAC,EAAE,IAAA,sBAAc,GAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;YACnC,aAAa;YACb,uBAAuB,EAAE,IAAA,oCAA0B,EAAC,wCAAwC,CAAC;YAC7F,qBAAqB,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;YAC7D,2BAA2B,EAAE,yBAAyB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;YACxE,kBAAkB,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;YACvD,iBAAiB,EAAE,IAAA,oCAA0B,EAAC,2BAA2B,CAAC;YAC1E,eAAe;YACf,mBAAmB,EAAE,IAAA,+BAAqB,EAAC,qBAAqB,CAAC;YACjE,QAAQ,EAAE,IAAA,+BAAqB,EAAC,UAAU,CAAC;YAC3C,qBAAqB,EAAE,IAAA,+BAAqB,EAAC,uBAAuB,CAAC;YACrE,cAAc,EAAE,IAAA,+BAAqB,EAAC,gBAAgB,CAAC;YACvD,EAAE,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GACV,CAAC,OAAO,IAAI,qBAAqB,IAAI,CAAC,MAAM,IAAI,sBAAsB,IAAI,UAAU,CAAC;gBACpF,CAAC,CAAC,OAAO;gBACT,CAAC,CAAC,SAAS,CAAC;YACpB,iBAAiB,EAAE,QAAQ,KAAK,aAAa,CAAA,CAAC,CAAC,0CAAmB,CAAC,6BAA6B,EAAE,CAAC,CAAC,CAAC,SAAS;YAC9G,QAAQ,EAAE,IAAA,kBAAe,EAAC,IAAI,CAAC,IAAI,SAAS;YAC5C,cAAc,EAAE,iBAAiB,CAAC,CAAC,CAAC,wBAAc,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS;YAC3E,wBAAwB,EAAE,sBAAsB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,SAAS;YACrF,kBAAkB,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;YACpD,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;YACjD,kBAAkB,EAAE,iBAAiB,CAAA,CAAC,CAAC,GAAG,CAAA,CAAC,CAAC,SAAS;SACxD,CAAC;QAEF,IAAI,IAAA,+BAAqB,EAAC,WAAW,CAAC,EAAE,CAAC;YACrC,MAAM,CAAC,yBAAyB,CAAC,GAAG,IAAA,kCAAwB,GAAE,CAAC;YAC/D,MAAM,CAAC,UAAU,CAAC,GAAG,MAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,mCAAI,IAAA,sBAAW,GAAE,CAAC;YAC/D,OAAO,SAAG,CAAC,GAAG,CAAyB;gBACnC,GAAG,EAAE,UAAG,YAAY,IAAI,QAAQ,gCAA6B;gBAC7D,MAAM,QAAA;gBACN,MAAM,EAAE;oBACJ,OAAO,EAAE;wBACL,GAAG,EAAE,IAAA,+BAAqB,EAAC,WAAW,CAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;wBACtD,QAAQ,EAAE,IAAA,+BAAqB,EAAC,WAAW,CAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;qBAC9D;iBACJ;aACJ,CAAC,CAAC;QACP,CAAC;QAED,OAAO,SAAG,CAAC,GAAG,CAAyB;YACnC,GAAG,EAAE,UAAG,YAAY,IAAI,QAAQ,sBAAmB;YACnD,MAAM,QAAA;SACT,CAAC,CAAC;IACP,CAAC;CACJ,CAAC"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { FacetRequired, fullTextSearchResponse, Narrow, SortBy } from "../models/fullTextSearch";
|
|
2
|
-
interface LandingPageProps {
|
|
3
|
-
slug: string;
|
|
4
|
-
storeID: number;
|
|
5
|
-
uuid: string;
|
|
6
|
-
cdn: number;
|
|
7
|
-
userToken: string;
|
|
8
|
-
sessionStart: number;
|
|
9
|
-
page?: number;
|
|
10
|
-
productsPerPage?: number;
|
|
11
|
-
sortBy?: SortBy;
|
|
12
|
-
narrowBy?: Narrow[];
|
|
13
|
-
facetRequired?: FacetRequired;
|
|
14
|
-
withAttributes?: boolean;
|
|
15
|
-
hasShopifyMarkets?: boolean;
|
|
16
|
-
companyLocationContext?: number;
|
|
17
|
-
}
|
|
18
|
-
export declare const LandingPage: {
|
|
19
|
-
getLandingPage: ({ uuid, storeID, cdn, facetRequired, narrowBy, page, productsPerPage, slug, sortBy, withAttributes, hasShopifyMarkets, companyLocationContext }: LandingPageProps) => Promise<fullTextSearchResponse>;
|
|
20
|
-
};
|
|
21
|
-
export {};
|
|
1
|
+
import { FacetRequired, fullTextSearchResponse, Narrow, SortBy } from "../models/fullTextSearch";
|
|
2
|
+
interface LandingPageProps {
|
|
3
|
+
slug: string;
|
|
4
|
+
storeID: number;
|
|
5
|
+
uuid: string;
|
|
6
|
+
cdn: number;
|
|
7
|
+
userToken: string;
|
|
8
|
+
sessionStart: number;
|
|
9
|
+
page?: number;
|
|
10
|
+
productsPerPage?: number;
|
|
11
|
+
sortBy?: SortBy;
|
|
12
|
+
narrowBy?: Narrow[];
|
|
13
|
+
facetRequired?: FacetRequired;
|
|
14
|
+
withAttributes?: boolean;
|
|
15
|
+
hasShopifyMarkets?: boolean;
|
|
16
|
+
companyLocationContext?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const LandingPage: {
|
|
19
|
+
getLandingPage: ({ uuid, storeID, cdn, facetRequired, narrowBy, page, productsPerPage, slug, sortBy, withAttributes, hasShopifyMarkets, companyLocationContext }: LandingPageProps) => Promise<fullTextSearchResponse>;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LandingPage = void 0;
|
|
4
|
-
var API_1 = require("../utils/API");
|
|
5
|
-
var debug_1 = require("../utils/debug");
|
|
6
|
-
var options_1 = require("../utils/options");
|
|
7
|
-
var utils_1 = require("../sections/initialization/utils");
|
|
8
|
-
var bigcommerce_customer_1 = require("@fast-simon/bigcommerce_customer");
|
|
9
|
-
var shopifyMarkets_1 = require("../utils/shopifyMarkets");
|
|
10
|
-
var BASE_URL = "https://api.fastsimon.com";
|
|
11
|
-
var debugVersion = (0, debug_1.getDebugEndpoint)();
|
|
12
|
-
exports.LandingPage = {
|
|
13
|
-
getLandingPage: function (_a) {
|
|
14
|
-
var uuid = _a.uuid, storeID = _a.storeID, cdn = _a.cdn, facetRequired = _a.facetRequired, narrowBy = _a.narrowBy, page = _a.page, productsPerPage = _a.productsPerPage, slug = _a.slug, sortBy = _a.sortBy, withAttributes = _a.withAttributes, hasShopifyMarkets = _a.hasShopifyMarkets, companyLocationContext = _a.companyLocationContext;
|
|
15
|
-
var platform = (0, utils_1.getPlatform)();
|
|
16
|
-
var params = {
|
|
17
|
-
UUID: uuid,
|
|
18
|
-
store_id: storeID,
|
|
19
|
-
cdn_cache_key: cdn,
|
|
20
|
-
facets_required: facetRequired,
|
|
21
|
-
lp: slug,
|
|
22
|
-
page_num: page,
|
|
23
|
-
with_product_attributes: withAttributes,
|
|
24
|
-
narrow: JSON.stringify(narrowBy),
|
|
25
|
-
products_per_page: productsPerPage,
|
|
26
|
-
sort_by: sortBy,
|
|
27
|
-
// ab_testing
|
|
28
|
-
disable_personalization: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_search_personalization"),
|
|
29
|
-
disable_merchandising: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_merchandising"),
|
|
30
|
-
disable_merchandising_rules: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_merchandising_rules"),
|
|
31
|
-
disable_strategies: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_merchandising_strategies"),
|
|
32
|
-
disable_semantics: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_semantics"),
|
|
33
|
-
// custom keys
|
|
34
|
-
reasoning: (0, options_1.getSDKABTestingOptionExist)("reasoning"),
|
|
35
|
-
customer_group_id: platform === "Bigcommerce" ? bigcommerce_customer_1.bigcommerceCustomer.getBigcommerceCustomerGroupId() : undefined,
|
|
36
|
-
market_context: hasShopifyMarkets ? shopifyMarkets_1.default.getCountry() : undefined,
|
|
37
|
-
company_location_context: companyLocationContext ? companyLocationContext : undefined
|
|
38
|
-
};
|
|
39
|
-
return API_1.API.get({
|
|
40
|
-
url: "".concat(debugVersion || BASE_URL, "/landing_page"),
|
|
41
|
-
params: params
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LandingPage = void 0;
|
|
4
|
+
var API_1 = require("../utils/API");
|
|
5
|
+
var debug_1 = require("../utils/debug");
|
|
6
|
+
var options_1 = require("../utils/options");
|
|
7
|
+
var utils_1 = require("../sections/initialization/utils");
|
|
8
|
+
var bigcommerce_customer_1 = require("@fast-simon/bigcommerce_customer");
|
|
9
|
+
var shopifyMarkets_1 = require("../utils/shopifyMarkets");
|
|
10
|
+
var BASE_URL = "https://api.fastsimon.com";
|
|
11
|
+
var debugVersion = (0, debug_1.getDebugEndpoint)();
|
|
12
|
+
exports.LandingPage = {
|
|
13
|
+
getLandingPage: function (_a) {
|
|
14
|
+
var uuid = _a.uuid, storeID = _a.storeID, cdn = _a.cdn, facetRequired = _a.facetRequired, narrowBy = _a.narrowBy, page = _a.page, productsPerPage = _a.productsPerPage, slug = _a.slug, sortBy = _a.sortBy, withAttributes = _a.withAttributes, hasShopifyMarkets = _a.hasShopifyMarkets, companyLocationContext = _a.companyLocationContext;
|
|
15
|
+
var platform = (0, utils_1.getPlatform)();
|
|
16
|
+
var params = {
|
|
17
|
+
UUID: uuid,
|
|
18
|
+
store_id: storeID,
|
|
19
|
+
cdn_cache_key: cdn,
|
|
20
|
+
facets_required: facetRequired,
|
|
21
|
+
lp: slug,
|
|
22
|
+
page_num: page,
|
|
23
|
+
with_product_attributes: withAttributes,
|
|
24
|
+
narrow: JSON.stringify(narrowBy),
|
|
25
|
+
products_per_page: productsPerPage,
|
|
26
|
+
sort_by: sortBy,
|
|
27
|
+
// ab_testing
|
|
28
|
+
disable_personalization: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_search_personalization"),
|
|
29
|
+
disable_merchandising: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_merchandising"),
|
|
30
|
+
disable_merchandising_rules: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_merchandising_rules"),
|
|
31
|
+
disable_strategies: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_merchandising_strategies"),
|
|
32
|
+
disable_semantics: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_semantics"),
|
|
33
|
+
// custom keys
|
|
34
|
+
reasoning: (0, options_1.getSDKABTestingOptionExist)("reasoning"),
|
|
35
|
+
customer_group_id: platform === "Bigcommerce" ? bigcommerce_customer_1.bigcommerceCustomer.getBigcommerceCustomerGroupId() : undefined,
|
|
36
|
+
market_context: hasShopifyMarkets ? shopifyMarkets_1.default.getCountry() : undefined,
|
|
37
|
+
company_location_context: companyLocationContext ? companyLocationContext : undefined
|
|
38
|
+
};
|
|
39
|
+
return API_1.API.get({
|
|
40
|
+
url: "".concat(debugVersion || BASE_URL, "/landing_page"),
|
|
41
|
+
params: params
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
45
|
//# sourceMappingURL=landingPage.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Product } from "../models/fullTextSearch";
|
|
2
|
-
interface GetLookALikeProps {
|
|
3
|
-
viewedProductId: string | number;
|
|
4
|
-
uuid: string;
|
|
5
|
-
storeID: number;
|
|
6
|
-
hasShopifyMarkets?: boolean;
|
|
7
|
-
companyLocationContext?: number;
|
|
8
|
-
}
|
|
9
|
-
export declare const debugVersion: string;
|
|
10
|
-
export declare const LookAlikeProductRecommendation: {
|
|
11
|
-
getLookALike: ({ viewedProductId, storeID, uuid, hasShopifyMarkets, companyLocationContext }: GetLookALikeProps) => Promise<Product[]>;
|
|
12
|
-
};
|
|
13
|
-
export {};
|
|
1
|
+
import { Product } from "../models/fullTextSearch";
|
|
2
|
+
interface GetLookALikeProps {
|
|
3
|
+
viewedProductId: string | number;
|
|
4
|
+
uuid: string;
|
|
5
|
+
storeID: number;
|
|
6
|
+
hasShopifyMarkets?: boolean;
|
|
7
|
+
companyLocationContext?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const debugVersion: string;
|
|
10
|
+
export declare const LookAlikeProductRecommendation: {
|
|
11
|
+
getLookALike: ({ viewedProductId, storeID, uuid, hasShopifyMarkets, companyLocationContext }: GetLookALikeProps) => Promise<Product[]>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|