fast-simon-sdk 1.2.55 → 1.2.59
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.js +1 -1
- package/lib/config.js.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/models/common.d.ts +7 -2
- package/lib/models/common.js.map +1 -1
- package/lib/models/exports.js +1 -1
- package/lib/models/exports.js.map +1 -1
- package/lib/sections/contentSearch/index.js +13 -18
- package/lib/sections/contentSearch/index.js.map +1 -1
- package/lib/sections/eventReporter/index.js +233 -180
- package/lib/sections/eventReporter/index.js.map +1 -1
- package/lib/sections/eventReporter/utils.js +9 -8
- package/lib/sections/eventReporter/utils.js.map +1 -1
- package/lib/sections/fullTextSearch/index.js +52 -26
- package/lib/sections/fullTextSearch/index.js.map +1 -1
- package/lib/sections/fullTextSearch/utils.d.ts +2 -2
- package/lib/sections/fullTextSearch/utils.js +56 -47
- package/lib/sections/fullTextSearch/utils.js.map +1 -1
- package/lib/sections/index.js +167 -96
- package/lib/sections/index.js.map +1 -1
- package/lib/sections/initialization/index.js +14 -13
- package/lib/sections/initialization/index.js.map +1 -1
- package/lib/sections/initialization/utils.js +83 -40
- package/lib/sections/initialization/utils.js.map +1 -1
- package/lib/sections/instantSearch/index.d.ts +1 -1
- package/lib/sections/instantSearch/index.js +39 -18
- package/lib/sections/instantSearch/index.js.map +1 -1
- package/lib/sections/instantSearch/utils.d.ts +4 -2
- package/lib/sections/instantSearch/utils.js +72 -56
- package/lib/sections/instantSearch/utils.js.map +1 -1
- package/lib/sections/landingPage/index.js +34 -15
- package/lib/sections/landingPage/index.js.map +1 -1
- package/lib/sections/landingPage/utils.js +28 -22
- package/lib/sections/landingPage/utils.js.map +1 -1
- package/lib/sections/lookAlikeProductRecommendation/index.js +5 -4
- package/lib/sections/lookAlikeProductRecommendation/index.js.map +1 -1
- package/lib/sections/recommendations/index.d.ts +1 -1
- package/lib/sections/recommendations/index.js +16 -14
- package/lib/sections/recommendations/index.js.map +1 -1
- package/lib/sections/recommendations/utils.js +8 -8
- package/lib/sections/recommendations/utils.js.map +1 -1
- package/lib/sections/smartCollections/index.js +58 -32
- package/lib/sections/smartCollections/index.js.map +1 -1
- package/lib/sections/smartCollections/utils.d.ts +14 -12
- package/lib/sections/smartCollections/utils.js +76 -61
- package/lib/sections/smartCollections/utils.js.map +1 -1
- package/lib/services/autocomplete.d.ts +2 -1
- package/lib/services/autocomplete.js +11 -8
- package/lib/services/autocomplete.js.map +1 -1
- package/lib/services/common.d.ts +2 -1
- package/lib/services/common.js +23 -17
- package/lib/services/common.js.map +1 -1
- package/lib/services/content.js +11 -10
- package/lib/services/content.js.map +1 -1
- package/lib/services/fullTextSearch.js +20 -14
- package/lib/services/fullTextSearch.js.map +1 -1
- package/lib/services/landingPage.js +10 -9
- package/lib/services/landingPage.js.map +1 -1
- package/lib/services/lookAlikeProductRecommendation.js +6 -5
- package/lib/services/lookAlikeProductRecommendation.js.map +1 -1
- package/lib/services/related.d.ts +2 -1
- package/lib/services/related.js +14 -11
- package/lib/services/related.js.map +1 -1
- package/lib/services/reporting.js +24 -17
- package/lib/services/reporting.js.map +1 -1
- package/lib/services/smartCollections.js +19 -14
- package/lib/services/smartCollections.js.map +1 -1
- package/lib/services/utils.js +6 -5
- package/lib/services/utils.js.map +1 -1
- package/lib/utils/API.js +63 -9
- package/lib/utils/API.js.map +1 -1
- package/lib/utils/ArrayUtils.js +1 -1
- package/lib/utils/cookies.js +36 -23
- package/lib/utils/cookies.js.map +1 -1
- package/lib/utils/debug.js +5 -5
- package/lib/utils/debug.js.map +1 -1
- package/lib/utils/klaviyo.js +4 -4
- package/lib/utils/klaviyo.js.map +1 -1
- package/lib/utils/options.d.ts +7 -0
- package/lib/utils/options.js +3 -3
- package/lib/utils/options.js.map +1 -1
- package/lib/utils/validation.js +9 -8
- package/lib/utils/validation.js.map +1 -1
- package/package.json +7 -2
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { SDKUtils } from "../../models/common";
|
|
2
|
-
import { RecentSmartCollectionProduct, smartCollectionsCallback, SmartCollectionsResponse } from "../../models/smartCollections";
|
|
2
|
+
import { RecentSmartCollectionProduct, smartCollectionsCallback, SmartCollectionsResponse, smartCollectionsResults } from "../../models/smartCollections";
|
|
3
3
|
import { Narrow, Product, SortBy } from "../../models/fullTextSearch";
|
|
4
4
|
export declare const emptyResults: (self: SDKUtils, categoryID: string) => void;
|
|
5
5
|
export declare const setInfiniteScroll: (self: SDKUtils, infiniteCount?: number | undefined, productsPerPage?: number | undefined) => void;
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
6
|
+
export declare const getData: (self: SDKUtils, response: SmartCollectionsResponse) => smartCollectionsResults;
|
|
7
|
+
interface HandleSmartCollectionProps {
|
|
8
8
|
self: SDKUtils;
|
|
9
9
|
personalized: boolean;
|
|
10
|
-
categoryID: string;
|
|
11
10
|
callback: smartCollectionsCallback;
|
|
12
11
|
event: "products" | "facets and products";
|
|
13
|
-
time?: number
|
|
14
|
-
isNoResults?: boolean
|
|
12
|
+
time?: number;
|
|
13
|
+
isNoResults?: boolean;
|
|
15
14
|
page: number;
|
|
16
|
-
narrow?: Narrow[]
|
|
17
|
-
sortBy?: SortBy
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
narrow?: Narrow[];
|
|
16
|
+
sortBy?: SortBy;
|
|
17
|
+
result: smartCollectionsResults;
|
|
18
|
+
}
|
|
19
|
+
export declare const handleSmartCollection: ({ event, callback, self, personalized, time, isNoResults, page, sortBy, narrow, result }: HandleSmartCollectionProps) => void;
|
|
20
|
+
export declare const getPersonalizedProducts: (self: SDKUtils, recent: Product[], products: Product[]) => Product[];
|
|
20
21
|
export declare const getCollectionName: (self: SDKUtils, id: string) => string;
|
|
21
|
-
export declare const getRecentCollectionProducts: (
|
|
22
|
+
export declare const getRecentCollectionProducts: () => RecentSmartCollectionProduct[];
|
|
22
23
|
export declare const updateRecentCollectionProducts: (productID: string, categoryID: string) => void;
|
|
23
24
|
export declare const facetNeeded: ({ self, newNarrow, newPage, newCategoryID }: {
|
|
24
25
|
self: SDKUtils;
|
|
@@ -26,4 +27,5 @@ export declare const facetNeeded: ({ self, newNarrow, newPage, newCategoryID }:
|
|
|
26
27
|
newPage: number;
|
|
27
28
|
newCategoryID: string;
|
|
28
29
|
}) => boolean;
|
|
29
|
-
export declare const isRecommendedProduct: (productId: string
|
|
30
|
+
export declare const isRecommendedProduct: (productId: string) => boolean;
|
|
31
|
+
export {};
|
|
@@ -1,131 +1,145 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isRecommendedProduct = exports.facetNeeded = exports.updateRecentCollectionProducts = exports.getRecentCollectionProducts = exports.getCollectionName = exports.getPersonalizedProducts = exports.handleSmartCollection = exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
exports.isRecommendedProduct = exports.facetNeeded = exports.updateRecentCollectionProducts = exports.getRecentCollectionProducts = exports.getCollectionName = exports.getPersonalizedProducts = exports.handleSmartCollection = exports.getData = exports.setInfiniteScroll = exports.emptyResults = void 0;
|
|
15
|
+
var ArrayUtils_1 = require("../../utils/ArrayUtils");
|
|
16
|
+
var related_1 = require("../../services/related");
|
|
17
|
+
var config_1 = require("../../config");
|
|
18
|
+
var utils_1 = require("../fullTextSearch/utils");
|
|
19
|
+
var emptyResults = function (self, categoryID) {
|
|
9
20
|
self.temp.smartCollections = {
|
|
10
21
|
ancestors: [],
|
|
11
22
|
totalResults: 0,
|
|
12
23
|
products: [],
|
|
13
|
-
categoryID,
|
|
24
|
+
categoryID: categoryID,
|
|
14
25
|
name: ""
|
|
15
26
|
};
|
|
16
27
|
};
|
|
17
28
|
exports.emptyResults = emptyResults;
|
|
18
|
-
|
|
29
|
+
var setInfiniteScroll = function (self, infiniteCount, productsPerPage) {
|
|
19
30
|
if (infiniteCount && productsPerPage) {
|
|
20
31
|
self.temp.smartCollections.pageCount = Math.ceil(self.temp.smartCollections.totalResults / (productsPerPage / infiniteCount));
|
|
21
32
|
}
|
|
22
33
|
};
|
|
23
34
|
exports.setInfiniteScroll = setInfiniteScroll;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
var getData = function (self, response) {
|
|
36
|
+
var result = {};
|
|
37
|
+
result.products = response.items;
|
|
38
|
+
result.totalResults = response.total_results;
|
|
27
39
|
if (response.ancestor_categories) {
|
|
28
|
-
|
|
40
|
+
result.ancestors = response.ancestor_categories;
|
|
29
41
|
}
|
|
30
42
|
if (response.narrow) {
|
|
31
|
-
|
|
43
|
+
result.narrow = utils_1.reformatNarrow(response.narrow);
|
|
32
44
|
}
|
|
33
45
|
if (response.sort_by) {
|
|
34
|
-
|
|
46
|
+
result.sortBy = response.sort_by;
|
|
35
47
|
}
|
|
36
48
|
if (response.pop_products_no_results) {
|
|
37
|
-
|
|
49
|
+
result.isNoResults = true;
|
|
38
50
|
}
|
|
39
51
|
if (response.total_p) {
|
|
40
|
-
|
|
52
|
+
result.pageCount = response.total_p;
|
|
41
53
|
}
|
|
42
54
|
if (response.avoid_tag_prefixes) {
|
|
43
|
-
|
|
55
|
+
result.avoidPrefixList = response.avoid_tag_prefixes.split(",");
|
|
44
56
|
}
|
|
45
57
|
if (response.merch) {
|
|
46
|
-
|
|
58
|
+
result.merch = response.merch;
|
|
47
59
|
}
|
|
48
60
|
if (response.banner_html) {
|
|
49
|
-
|
|
61
|
+
result.bannerHTML = response.banner_html;
|
|
50
62
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
63
|
+
result.page = response.p || 1;
|
|
64
|
+
result.categoryID = response.category_id;
|
|
65
|
+
result.name = response.category_name;
|
|
66
|
+
return result;
|
|
54
67
|
};
|
|
55
|
-
exports.
|
|
56
|
-
|
|
68
|
+
exports.getData = getData;
|
|
69
|
+
var handleSmartCollection = function (_a) {
|
|
70
|
+
var event = _a.event, callback = _a.callback, self = _a.self, personalized = _a.personalized, time = _a.time, isNoResults = _a.isNoResults, page = _a.page, sortBy = _a.sortBy, narrow = _a.narrow, result = _a.result;
|
|
57
71
|
if (personalized && !isNoResults && page === 1 && (!narrow || narrow.length === 0) && (!sortBy || sortBy === "relevency")) {
|
|
58
|
-
handlePersonalisedProducts(self,
|
|
72
|
+
handlePersonalisedProducts(self, result, callback, event, time !== null && time !== void 0 ? time : 356);
|
|
59
73
|
}
|
|
60
74
|
else {
|
|
61
75
|
callback({
|
|
62
76
|
action: event,
|
|
63
|
-
payload:
|
|
77
|
+
payload: result
|
|
64
78
|
});
|
|
65
79
|
}
|
|
66
80
|
};
|
|
67
81
|
exports.handleSmartCollection = handleSmartCollection;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
82
|
+
var handlePersonalisedProducts = function (self, payload, callback, event, time) {
|
|
83
|
+
var _a = self.data, storeID = _a.storeID, uuid = _a.uuid;
|
|
84
|
+
var now = Math.round(Date.now() / 1000);
|
|
85
|
+
var categoryID = payload.categoryID;
|
|
86
|
+
var recent = exports.getRecentCollectionProducts().filter(function (r) { return r.time + time * 360 > now; });
|
|
87
|
+
localStorage.setItem("" + config_1.RECENT_COLLECTION_PRODUCTS_KEY, JSON.stringify(recent));
|
|
88
|
+
var recentProducts = recent.map(function (r) { return r.id; });
|
|
74
89
|
if (recent.length > 0) {
|
|
75
90
|
related_1.Related.getRecentlyViewed({
|
|
76
|
-
uuid,
|
|
77
|
-
storeID,
|
|
91
|
+
uuid: uuid,
|
|
92
|
+
storeID: storeID,
|
|
78
93
|
recent: recentProducts,
|
|
79
|
-
categoryID,
|
|
94
|
+
categoryID: categoryID,
|
|
80
95
|
cartToken: self.data.cartToken
|
|
81
|
-
}).then(response
|
|
82
|
-
self.temp.smartCollections.products = exports.getPersonalizedProducts(self, response.widget_responses[0].products, categoryID);
|
|
96
|
+
}).then(function (response) {
|
|
83
97
|
callback({
|
|
84
98
|
action: event,
|
|
85
|
-
payload: self.
|
|
99
|
+
payload: __assign(__assign({}, payload), { products: exports.getPersonalizedProducts(self, response.widget_responses[0].products, payload.products) })
|
|
86
100
|
});
|
|
87
101
|
});
|
|
88
102
|
}
|
|
89
103
|
else {
|
|
90
104
|
callback({
|
|
91
105
|
action: event,
|
|
92
|
-
payload:
|
|
106
|
+
payload: payload
|
|
93
107
|
});
|
|
94
108
|
}
|
|
95
109
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
110
|
+
var getPersonalizedProducts = function (self, recent, products) {
|
|
111
|
+
var recentProducts = recent.filter(function (r, i) {
|
|
112
|
+
var newPosition = i * 2;
|
|
113
|
+
var oldPosition = products.findIndex(function (p) { return p.id === r.id; });
|
|
100
114
|
return oldPosition === -1 || (newPosition < oldPosition);
|
|
101
115
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
for (
|
|
105
|
-
ArrayUtils_1.insert(
|
|
116
|
+
var ids = new Set(recentProducts.map(function (p) { return p.id; }));
|
|
117
|
+
var newProducts = products.filter(function (p) { return !ids.has(p.id); });
|
|
118
|
+
for (var i = 0, pos = 1; i < recentProducts.length; i++, pos += 2) {
|
|
119
|
+
ArrayUtils_1.insert(newProducts, pos, __assign({ rec: true }, recentProducts[i]));
|
|
106
120
|
}
|
|
107
|
-
return
|
|
121
|
+
return newProducts;
|
|
108
122
|
};
|
|
109
123
|
exports.getPersonalizedProducts = getPersonalizedProducts;
|
|
110
|
-
|
|
111
|
-
|
|
124
|
+
var getCollectionName = function (self, id) {
|
|
125
|
+
var category = self.data.categories.find(function (category) { return category.id === id; });
|
|
112
126
|
if (!category) {
|
|
113
|
-
console.warn(
|
|
127
|
+
console.warn("can't find the collection / category name for id: " + id);
|
|
114
128
|
return id;
|
|
115
129
|
}
|
|
116
130
|
return category.l;
|
|
117
131
|
};
|
|
118
132
|
exports.getCollectionName = getCollectionName;
|
|
119
|
-
|
|
133
|
+
var getRecentCollectionProducts = function () {
|
|
120
134
|
if (config_1.RECENT_COLLECTION_PRODUCTS_KEY in localStorage) {
|
|
121
135
|
return JSON.parse(localStorage.getItem(config_1.RECENT_COLLECTION_PRODUCTS_KEY));
|
|
122
136
|
}
|
|
123
137
|
return [];
|
|
124
138
|
};
|
|
125
139
|
exports.getRecentCollectionProducts = getRecentCollectionProducts;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
140
|
+
var updateRecentCollectionProducts = function (productID, categoryID) {
|
|
141
|
+
var categories = exports.getRecentCollectionProducts();
|
|
142
|
+
var index = categories.findIndex(function (c) { return c.id === productID; });
|
|
129
143
|
if (index !== -1) {
|
|
130
144
|
moveAndUpdate(categories, index);
|
|
131
145
|
}
|
|
@@ -138,18 +152,19 @@ const updateRecentCollectionProducts = (productID, categoryID) => {
|
|
|
138
152
|
localStorage.setItem(config_1.RECENT_COLLECTION_PRODUCTS_KEY, JSON.stringify(categories.splice(0, config_1.MAX_RECENT_COLLECTION_PRODUCTS)));
|
|
139
153
|
};
|
|
140
154
|
exports.updateRecentCollectionProducts = updateRecentCollectionProducts;
|
|
141
|
-
|
|
155
|
+
var moveAndUpdate = function (categories, index) {
|
|
142
156
|
ArrayUtils_1.arrayMove(categories, index, categories.length - 1);
|
|
143
157
|
categories[categories.length - 1].time = Date.now();
|
|
144
158
|
};
|
|
145
|
-
|
|
146
|
-
|
|
159
|
+
var facetNeeded = function (_a) {
|
|
160
|
+
var self = _a.self, newNarrow = _a.newNarrow, newPage = _a.newPage, newCategoryID = _a.newCategoryID;
|
|
161
|
+
var _b = self.temp.smartCollections, narrow = _b.narrow, page = _b.page, categoryID = _b.categoryID;
|
|
147
162
|
return !(JSON.stringify(narrow) === JSON.stringify(newNarrow) && newPage === page && categoryID === newCategoryID);
|
|
148
163
|
};
|
|
149
164
|
exports.facetNeeded = facetNeeded;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
return Boolean(recent.find(r
|
|
165
|
+
var isRecommendedProduct = function (productId) {
|
|
166
|
+
var recent = exports.getRecentCollectionProducts();
|
|
167
|
+
return Boolean(recent.find(function (r) { return r.id === productId; }));
|
|
153
168
|
};
|
|
154
169
|
exports.isRecommendedProduct = isRecommendedProduct;
|
|
155
170
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/sections/smartCollections/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/sections/smartCollections/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,qDAAyD;AACzD,kDAA+C;AAE/C,uCAA4F;AAC5F,iDAAuD;AAEhD,IAAM,YAAY,GAAG,UAAC,IAAc,EAAE,UAAkB;IAC3D,IAAI,CAAC,IAAI,CAAC,gBAAgB,GAAG;QACzB,SAAS,EAAE,EAAE;QACb,YAAY,EAAE,CAAC;QACf,QAAQ,EAAE,EAAE;QACZ,UAAU,YAAA;QACV,IAAI,EAAE,EAAE;KACX,CAAA;AACL,CAAC,CAAC;AARW,QAAA,YAAY,gBAQvB;AAEK,IAAM,iBAAiB,GAAG,UAAC,IAAc,EAAE,aAAsB,EAAE,eAAwB;IAC9F,IAAI,aAAa,IAAI,eAAe,EAAE;QAClC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,YAAY,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YAAA,EAAE,IAAI,UAAA,EAAE,UAAU,gBAA8B,CAAC;IAE9D,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,OAAO,KAAK,IAAI,IAAI,UAAU,KAAK,aAAa,CAAC,CAAC;AACvH,CAAC,CAAC;AAJW,QAAA,WAAW,eAItB;AAEK,IAAM,oBAAoB,GAAG,UAAC,SAAiB;IAClD,IAAM,MAAM,GAAG,mCAA2B,EAAE,CAAC;IAE7C,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,EAAE,KAAK,SAAS,EAAlB,CAAkB,CAAC,CAAC,CAAC;AACzD,CAAC,CAAC;AAJW,QAAA,oBAAoB,wBAI/B"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { AutocompleteProductsResponse, PopularSearchesResponse } from "../models/autocomplete";
|
|
2
2
|
export declare const debugVersion: string;
|
|
3
3
|
export declare const Autocomplete: {
|
|
4
|
-
getProducts: ({ cdn, storeID, uuid, query }: {
|
|
4
|
+
getProducts: ({ cdn, storeID, uuid, query, withAttributes }: {
|
|
5
5
|
query: string;
|
|
6
6
|
uuid: string;
|
|
7
7
|
storeID: number;
|
|
8
8
|
cdn: number;
|
|
9
|
+
withAttributes?: boolean | undefined;
|
|
9
10
|
}) => Promise<AutocompleteProductsResponse>;
|
|
10
11
|
getPopularSearches: ({ cdn, storeID, uuid, query, site }: {
|
|
11
12
|
query: string;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Autocomplete = exports.debugVersion = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
var API_1 = require("../utils/API");
|
|
5
|
+
var debug_1 = require("../utils/debug");
|
|
6
|
+
var REPORT_BASE = "https://ping-dot-acp-magento.appspot.com";
|
|
7
|
+
var BASE_URL = "https://api.instantsearchplus.com";
|
|
8
|
+
var BASE_SUGGESTOR_URL = "https://suggest.instantsearchplus.com";
|
|
9
9
|
exports.debugVersion = debug_1.getDebugEndpoint();
|
|
10
10
|
exports.Autocomplete = {
|
|
11
|
-
getProducts: (
|
|
11
|
+
getProducts: function (_a) {
|
|
12
|
+
var cdn = _a.cdn, storeID = _a.storeID, uuid = _a.uuid, query = _a.query, withAttributes = _a.withAttributes;
|
|
12
13
|
return API_1.API.get({
|
|
13
14
|
url: exports.debugVersion || BASE_URL,
|
|
14
15
|
params: {
|
|
@@ -17,10 +18,12 @@ exports.Autocomplete = {
|
|
|
17
18
|
cdn_cache_key: cdn,
|
|
18
19
|
q: query,
|
|
19
20
|
m: debug_1.isDebugCaching() ? 1 : undefined,
|
|
21
|
+
with_product_attributes: withAttributes
|
|
20
22
|
}
|
|
21
23
|
});
|
|
22
24
|
},
|
|
23
|
-
getPopularSearches: (
|
|
25
|
+
getPopularSearches: function (_a) {
|
|
26
|
+
var cdn = _a.cdn, storeID = _a.storeID, uuid = _a.uuid, query = _a.query, site = _a.site;
|
|
24
27
|
return API_1.API.get({
|
|
25
28
|
url: BASE_SUGGESTOR_URL,
|
|
26
29
|
params: {
|
|
@@ -29,7 +32,7 @@ exports.Autocomplete = {
|
|
|
29
32
|
cdn_cache_key: cdn,
|
|
30
33
|
store_id: storeID,
|
|
31
34
|
uuid: uuid,
|
|
32
|
-
m: debug_1.isDebugCaching() ? 1 : undefined
|
|
35
|
+
m: debug_1.isDebugCaching() ? 1 : undefined
|
|
33
36
|
}
|
|
34
37
|
});
|
|
35
38
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.js","sourceRoot":"","sources":["../../src/services/autocomplete.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"autocomplete.js","sourceRoot":"","sources":["../../src/services/autocomplete.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
7
|
uuid: string;
|
|
8
8
|
storeID: number;
|
|
9
9
|
}) => Promise<DashboardResponse>;
|
|
10
|
-
getPopularProducts: ({ uuid, storeID, cdn }: {
|
|
10
|
+
getPopularProducts: ({ uuid, storeID, cdn, withAttributes }: {
|
|
11
11
|
uuid: string;
|
|
12
12
|
storeID: number;
|
|
13
13
|
cdn: number;
|
|
14
|
+
withAttributes?: boolean | undefined;
|
|
14
15
|
}) => Promise<PopResponse>;
|
|
15
16
|
getCategories: ({ uuid, storeID, cdn }: {
|
|
16
17
|
uuid: string;
|
package/lib/services/common.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Common = exports.debugVersion = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
var API_1 = require("../utils/API");
|
|
5
|
+
var debug_1 = require("../utils/debug");
|
|
6
|
+
var BASE_URL = "https://acp-magento.appspot.com";
|
|
7
|
+
var REPORT_BASE = "https://ping-dot-acp-magento.appspot.com";
|
|
8
|
+
var BASE_URL_CDN = "https://cdn1-gae-ssl-default.akamaized.net";
|
|
9
9
|
exports.debugVersion = debug_1.getDebugEndpoint();
|
|
10
10
|
exports.Common = {
|
|
11
|
-
getLoad: (
|
|
11
|
+
getLoad: function (_a) {
|
|
12
|
+
var uuid = _a.uuid, storeID = _a.storeID;
|
|
12
13
|
return API_1.API.get({
|
|
13
|
-
url:
|
|
14
|
+
url: (exports.debugVersion || BASE_URL_CDN) + "/load",
|
|
14
15
|
params: {
|
|
15
16
|
UUID: uuid,
|
|
16
17
|
store_id: storeID,
|
|
@@ -18,21 +19,24 @@ exports.Common = {
|
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
21
|
},
|
|
21
|
-
getPopularProducts: (
|
|
22
|
+
getPopularProducts: function (_a) {
|
|
23
|
+
var uuid = _a.uuid, storeID = _a.storeID, cdn = _a.cdn, withAttributes = _a.withAttributes;
|
|
22
24
|
return API_1.API.get({
|
|
23
|
-
url:
|
|
25
|
+
url: (exports.debugVersion || BASE_URL_CDN) + "/pop",
|
|
24
26
|
params: {
|
|
25
27
|
store_id: storeID,
|
|
26
28
|
UUID: uuid,
|
|
27
29
|
cdn_cache_key: cdn,
|
|
28
30
|
api_type: "json",
|
|
29
31
|
m: debug_1.isDebugCaching() ? 1 : undefined,
|
|
32
|
+
with_product_attributes: withAttributes
|
|
30
33
|
}
|
|
31
34
|
});
|
|
32
35
|
},
|
|
33
|
-
getCategories: (
|
|
36
|
+
getCategories: function (_a) {
|
|
37
|
+
var uuid = _a.uuid, storeID = _a.storeID, cdn = _a.cdn;
|
|
34
38
|
return API_1.API.get({
|
|
35
|
-
url:
|
|
39
|
+
url: (exports.debugVersion || BASE_URL_CDN) + "/pop",
|
|
36
40
|
params: {
|
|
37
41
|
store_id: storeID,
|
|
38
42
|
UUID: uuid,
|
|
@@ -43,9 +47,10 @@ exports.Common = {
|
|
|
43
47
|
}
|
|
44
48
|
});
|
|
45
49
|
},
|
|
46
|
-
getTurbolinks: (
|
|
50
|
+
getTurbolinks: function (_a) {
|
|
51
|
+
var uuid = _a.uuid, storeID = _a.storeID, cdn = _a.cdn;
|
|
47
52
|
return API_1.API.get({
|
|
48
|
-
url:
|
|
53
|
+
url: (exports.debugVersion || BASE_URL_CDN) + "/pop",
|
|
49
54
|
params: {
|
|
50
55
|
store_id: storeID,
|
|
51
56
|
UUID: uuid,
|
|
@@ -56,21 +61,22 @@ exports.Common = {
|
|
|
56
61
|
}
|
|
57
62
|
});
|
|
58
63
|
},
|
|
59
|
-
getPostLoad: (
|
|
64
|
+
getPostLoad: function (_a) {
|
|
65
|
+
var uuid = _a.uuid, storeID = _a.storeID;
|
|
60
66
|
return API_1.API.get({
|
|
61
|
-
url:
|
|
67
|
+
url: (exports.debugVersion || REPORT_BASE) + "/post_load",
|
|
62
68
|
params: {
|
|
63
69
|
store_id: storeID,
|
|
64
70
|
UUID: uuid,
|
|
65
71
|
}
|
|
66
72
|
});
|
|
67
73
|
},
|
|
68
|
-
getBigcommerceCartToken: ()
|
|
74
|
+
getBigcommerceCartToken: function () {
|
|
69
75
|
return API_1.API.get({
|
|
70
76
|
url: location.origin + '/api/storefront/cart'
|
|
71
77
|
});
|
|
72
78
|
},
|
|
73
|
-
getShopifyCartToken: ()
|
|
79
|
+
getShopifyCartToken: function () {
|
|
74
80
|
return API_1.API.get({
|
|
75
81
|
url: location.origin + '/cart.js'
|
|
76
82
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/services/common.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/services/common.ts"],"names":[],"mappings":";;;AAAA,oCAAiC;AAGjC,wCAAgE;AAGhE,IAAM,QAAQ,GAAG,iCAAiC,CAAC;AACnD,IAAM,WAAW,GAAG,0CAA0C,CAAC;AAC/D,IAAM,YAAY,GAAG,4CAA4C,CAAC;AAErD,QAAA,YAAY,GAAG,wBAAgB,EAAE,CAAC;AAElC,QAAA,MAAM,GAAG;IAClB,OAAO,EAAE,UAAC,EAAkD;YAAjD,IAAI,UAAA,EAAE,OAAO,aAAA;QACpB,OAAO,SAAG,CAAC,GAAG,CAAoB;YAC9B,GAAG,EAAE,CAAG,oBAAY,IAAI,YAAY,WAAO;YAC3C,MAAM,EAAE;gBACJ,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,OAAO;gBACjB,CAAC,EAAE,sBAAc,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;aACtC;SACJ,CAAC,CAAC;IACP,CAAC;IAED,kBAAkB,EAAE,UAAC,EAA8G;YAA7G,IAAI,UAAA,EAAE,OAAO,aAAA,EAAE,GAAG,SAAA,EAAE,cAAc,oBAAA;QACpD,OAAO,SAAG,CAAC,GAAG,CAAc;YACxB,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EAAE,OAAO,aAAA;QACxB,OAAO,SAAG,CAAC,GAAG,CAAmB;YAC7B,GAAG,EAAE,CAAG,oBAAY,IAAI,WAAW,gBAAY;YAC/C,MAAM,EAAE;gBACJ,QAAQ,EAAE,OAAO;gBACjB,IAAI,EAAE,IAAI;aACb;SACJ,CAAC,CAAC;IACP,CAAC;IAED,uBAAuB,EAAE;QACrB,OAAO,SAAG,CAAC,GAAG,CAAoB;YAC9B,GAAG,EAAE,QAAQ,CAAC,MAAM,GAAG,sBAAsB;SAChD,CAAC,CAAA;IACN,CAAC;IAED,mBAAmB,EAAE;QACjB,OAAO,SAAG,CAAC,GAAG,CAAuB;YACjC,GAAG,EAAE,QAAQ,CAAC,MAAM,GAAG,UAAU;SACpC,CAAC,CAAA;IACN,CAAC;CACJ,CAAC"}
|
package/lib/services/content.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Content = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
var API_1 = require("../utils/API");
|
|
5
|
+
var debug_1 = require("../utils/debug");
|
|
6
|
+
var BASE_URL = "https://api.instantsearchplus.com";
|
|
7
|
+
var debugVersion = debug_1.getDebugEndpoint();
|
|
8
8
|
exports.Content = {
|
|
9
|
-
search: (
|
|
10
|
-
|
|
11
|
-
|
|
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,
|
|
12
13
|
store_id: storeID,
|
|
13
14
|
cdn_cache_key: cdn,
|
|
14
|
-
cursor,
|
|
15
|
+
cursor: cursor,
|
|
15
16
|
q: query,
|
|
16
17
|
source: "fast-simon-sdk",
|
|
17
18
|
content_is_norm: true
|
|
18
19
|
};
|
|
19
20
|
return API_1.API.get({
|
|
20
|
-
url:
|
|
21
|
-
params
|
|
21
|
+
url: (debugVersion || BASE_URL) + "/cms_content_get_next",
|
|
22
|
+
params: params
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/services/content.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/services/content.ts"],"names":[],"mappings":";;;AACA,oCAAiC;AACjC,wCAAgD;AAEhD,IAAM,QAAQ,GAAG,mCAAmC,CAAC;AAErD,IAAM,YAAY,GAAG,wBAAgB,EAAE,CAAC;AAE3B,QAAA,OAAO,GAAG;IACnB,MAAM,EAAE,UAAC,EAA8D;YAA7D,OAAO,aAAA,EAAE,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAA,EAAE,GAAG,SAAA;QACvC,IAAM,MAAM,GAAG;YACX,IAAI,MAAA;YACJ,QAAQ,EAAE,OAAO;YACjB,aAAa,EAAE,GAAG;YAClB,MAAM,QAAA;YACN,CAAC,EAAE,KAAK;YACR,MAAM,EAAE,gBAAgB;YACxB,eAAe,EAAE,IAAI;SACxB,CAAA;QAED,OAAO,SAAG,CAAC,GAAG,CAAwB;YAClC,GAAG,EAAE,CAAG,YAAY,IAAI,QAAQ,2BAAuB;YACvD,MAAM,QAAA;SACT,CAAC,CAAC;IACP,CAAC;CACJ,CAAA"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FullTextSearch = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
var API_1 = require("../utils/API");
|
|
5
|
+
var debug_1 = require("../utils/debug");
|
|
6
|
+
var options_1 = require("../utils/options");
|
|
7
|
+
var BASE_URL = "https://api.instantsearchplus.com";
|
|
8
|
+
var debugVersion = debug_1.getDebugEndpoint();
|
|
9
9
|
exports.FullTextSearch = {
|
|
10
|
-
getFullTextSearch: (
|
|
11
|
-
|
|
10
|
+
getFullTextSearch: function (_a) {
|
|
11
|
+
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, withAttributes = _a.withAttributes, recent = _a.recent, searchWithinSearch = _a.searchWithinSearch;
|
|
12
|
+
var params = {
|
|
12
13
|
UUID: uuid,
|
|
13
14
|
store_id: storeID,
|
|
14
15
|
cdn_cache_key: cdn,
|
|
@@ -24,15 +25,20 @@ exports.FullTextSearch = {
|
|
|
24
25
|
m: debug_1.isDebugCaching() ? 1 : undefined,
|
|
25
26
|
// ab_testing
|
|
26
27
|
disable_personalization: options_1.getSDKABTestingOptionExist("ab_test_disable_search_personalization"),
|
|
27
|
-
disable_merchandising: options_1.getSDKABTestingOptionExist("ab_test_disable_merchandising"),
|
|
28
|
-
disable_merchandising_rules: options_1.getSDKABTestingOptionExist("ab_test_disable_merchandising_rules"),
|
|
29
|
-
disable_strategies: options_1.getSDKABTestingOptionExist("ab_test_disable_merchandising_strategies"),
|
|
28
|
+
disable_merchandising: options_1.getSDKABTestingOptionExist("ab_test_disable_merchandising") || options_1.getSDKABTestingOption("disable_merchandising"),
|
|
29
|
+
disable_merchandising_rules: options_1.getSDKABTestingOptionExist("ab_test_disable_merchandising_rules") || options_1.getSDKABTestingOption("disable_merchandising_rules"),
|
|
30
|
+
disable_strategies: options_1.getSDKABTestingOptionExist("ab_test_disable_merchandising_strategies") || options_1.getSDKABTestingOption("disable_strategies"),
|
|
30
31
|
disable_semantics: options_1.getSDKABTestingOptionExist("ab_test_disable_semantics"),
|
|
32
|
+
//preview stuff
|
|
33
|
+
merchandising_rules: options_1.getSDKABTestingOption("merchandising_rules"),
|
|
34
|
+
strategy: options_1.getSDKABTestingOption("strategy"),
|
|
35
|
+
request_serial_number: options_1.getSDKABTestingOption("request_serial_number"),
|
|
36
|
+
related_search: options_1.getSDKABTestingOption("related_search"),
|
|
31
37
|
};
|
|
32
38
|
if (options_1.getSDKABTestingOption("reasoning")) {
|
|
33
39
|
return API_1.API.get({
|
|
34
|
-
url:
|
|
35
|
-
params,
|
|
40
|
+
url: (debugVersion || BASE_URL) + "/full_text_search_reasoning",
|
|
41
|
+
params: params,
|
|
36
42
|
config: {
|
|
37
43
|
headers: {
|
|
38
44
|
sid: options_1.getSDKABTestingOption("reasoning").split(":")[0],
|
|
@@ -42,8 +48,8 @@ exports.FullTextSearch = {
|
|
|
42
48
|
});
|
|
43
49
|
}
|
|
44
50
|
return API_1.API.get({
|
|
45
|
-
url:
|
|
46
|
-
params
|
|
51
|
+
url: (debugVersion || BASE_URL) + "/full_text_search",
|
|
52
|
+
params: params
|
|
47
53
|
});
|
|
48
54
|
},
|
|
49
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fullTextSearch.js","sourceRoot":"","sources":["../../src/services/fullTextSearch.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"fullTextSearch.js","sourceRoot":"","sources":["../../src/services/fullTextSearch.ts"],"names":[],"mappings":";;;AAAA,oCAAiC;AAEjC,wCAAgE;AAChE,4CAAmF;AAEnF,IAAM,QAAQ,GAAG,mCAAmC,CAAC;AAErD,IAAM,YAAY,GAAG,wBAAgB,EAAE,CAAC;AAE3B,QAAA,cAAc,GAAG;IAC1B,iBAAiB,EAAE,UAAC,EAKsB;YAJlB,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,EAC3B,cAAc,oBAAA,EAAE,MAAM,YAAA,EAAE,kBAAkB,wBAAA;QAGhE,IAAM,MAAM,G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