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.
Files changed (167) hide show
  1. package/lib/config.d.ts +25 -22
  2. package/lib/config.js +30 -27
  3. package/lib/config.js.map +1 -1
  4. package/lib/index.d.ts +3 -3
  5. package/lib/index.js +72 -71
  6. package/lib/index.js.map +1 -1
  7. package/lib/models/autocomplete.d.ts +73 -70
  8. package/lib/models/autocomplete.js +2 -2
  9. package/lib/models/common.d.ts +267 -208
  10. package/lib/models/common.js +65 -63
  11. package/lib/models/common.js.map +1 -1
  12. package/lib/models/content.d.ts +37 -37
  13. package/lib/models/content.js +2 -2
  14. package/lib/models/events.d.ts +113 -87
  15. package/lib/models/events.js +2 -2
  16. package/lib/models/exports.d.ts +6 -6
  17. package/lib/models/exports.js +5 -5
  18. package/lib/models/fullTextSearch.d.ts +130 -126
  19. package/lib/models/fullTextSearch.js +17 -17
  20. package/lib/models/fullTextSearch.js.map +1 -1
  21. package/lib/models/lookAlikeProductRecommendation.d.ts +8 -8
  22. package/lib/models/lookAlikeProductRecommendation.js +2 -2
  23. package/lib/models/productsInventory.d.ts +10 -10
  24. package/lib/models/productsInventory.js +2 -2
  25. package/lib/models/related.d.ts +35 -35
  26. package/lib/models/related.js +2 -2
  27. package/lib/models/smartCollections.d.ts +94 -90
  28. package/lib/models/smartCollections.js +2 -2
  29. package/lib/models/visualDiscovery.d.ts +129 -0
  30. package/lib/models/visualDiscovery.js +31 -0
  31. package/lib/models/visualDiscovery.js.map +1 -0
  32. package/lib/sections/contentSearch/index.d.ts +7 -7
  33. package/lib/sections/contentSearch/index.js +44 -44
  34. package/lib/sections/contentSearch/index.js.map +1 -1
  35. package/lib/sections/enums/index.d.ts +47 -45
  36. package/lib/sections/enums/index.js +50 -48
  37. package/lib/sections/enums/index.js.map +1 -1
  38. package/lib/sections/eventReporter/index.d.ts +10 -10
  39. package/lib/sections/eventReporter/index.js +628 -501
  40. package/lib/sections/eventReporter/index.js.map +1 -1
  41. package/lib/sections/eventReporter/utils.d.ts +9 -9
  42. package/lib/sections/eventReporter/utils.js +31 -29
  43. package/lib/sections/eventReporter/utils.js.map +1 -1
  44. package/lib/sections/fullTextSearch/index.d.ts +6 -6
  45. package/lib/sections/fullTextSearch/index.js +178 -171
  46. package/lib/sections/fullTextSearch/index.js.map +1 -1
  47. package/lib/sections/fullTextSearch/utils.d.ts +17 -17
  48. package/lib/sections/fullTextSearch/utils.js +185 -177
  49. package/lib/sections/fullTextSearch/utils.js.map +1 -1
  50. package/lib/sections/index.d.ts +3 -3
  51. package/lib/sections/index.js +432 -342
  52. package/lib/sections/index.js.map +1 -1
  53. package/lib/sections/initialization/index.d.ts +8 -8
  54. package/lib/sections/initialization/index.js +150 -150
  55. package/lib/sections/initialization/index.js.map +1 -1
  56. package/lib/sections/initialization/utils.d.ts +11 -11
  57. package/lib/sections/initialization/utils.js +200 -196
  58. package/lib/sections/initialization/utils.js.map +1 -1
  59. package/lib/sections/instantSearch/index.d.ts +6 -6
  60. package/lib/sections/instantSearch/index.js +66 -66
  61. package/lib/sections/instantSearch/index.js.map +1 -1
  62. package/lib/sections/instantSearch/utils.d.ts +21 -21
  63. package/lib/sections/instantSearch/utils.js +232 -232
  64. package/lib/sections/instantSearch/utils.js.map +1 -1
  65. package/lib/sections/landingPage/index.d.ts +6 -6
  66. package/lib/sections/landingPage/index.js +95 -95
  67. package/lib/sections/landingPage/index.js.map +1 -1
  68. package/lib/sections/landingPage/utils.d.ts +14 -14
  69. package/lib/sections/landingPage/utils.js +96 -90
  70. package/lib/sections/landingPage/utils.js.map +1 -1
  71. package/lib/sections/lookAlikeProductRecommendation/index.d.ts +6 -6
  72. package/lib/sections/lookAlikeProductRecommendation/index.js +23 -23
  73. package/lib/sections/recommendations/index.d.ts +10 -6
  74. package/lib/sections/recommendations/index.js +95 -48
  75. package/lib/sections/recommendations/index.js.map +1 -1
  76. package/lib/sections/recommendations/utils.d.ts +6 -7
  77. package/lib/sections/recommendations/utils.js +82 -91
  78. package/lib/sections/recommendations/utils.js.map +1 -1
  79. package/lib/sections/smartCollections/index.d.ts +6 -6
  80. package/lib/sections/smartCollections/index.js +169 -163
  81. package/lib/sections/smartCollections/index.js.map +1 -1
  82. package/lib/sections/smartCollections/utils.d.ts +41 -40
  83. package/lib/sections/smartCollections/utils.js +286 -269
  84. package/lib/sections/smartCollections/utils.js.map +1 -1
  85. package/lib/sections/visualDiscovery/index.d.ts +22 -0
  86. package/lib/sections/visualDiscovery/index.js +262 -0
  87. package/lib/sections/visualDiscovery/index.js.map +1 -0
  88. package/lib/services/autocomplete.d.ts +24 -24
  89. package/lib/services/autocomplete.js +50 -50
  90. package/lib/services/common.d.ts +35 -35
  91. package/lib/services/common.js +94 -94
  92. package/lib/services/content.d.ts +4 -4
  93. package/lib/services/content.js +25 -25
  94. package/lib/services/fullTextSearch.d.ts +4 -4
  95. package/lib/services/fullTextSearch.js +87 -84
  96. package/lib/services/fullTextSearch.js.map +1 -1
  97. package/lib/services/landingPage.d.ts +21 -21
  98. package/lib/services/landingPage.js +44 -44
  99. package/lib/services/lookAlikeProductRecommendation.d.ts +13 -13
  100. package/lib/services/lookAlikeProductRecommendation.js +23 -23
  101. package/lib/services/related.d.ts +48 -29
  102. package/lib/services/related.js +114 -72
  103. package/lib/services/related.js.map +1 -1
  104. package/lib/services/reporting.d.ts +80 -68
  105. package/lib/services/reporting.js +258 -208
  106. package/lib/services/reporting.js.map +1 -1
  107. package/lib/services/smartCollections.d.ts +5 -5
  108. package/lib/services/smartCollections.js +93 -82
  109. package/lib/services/smartCollections.js.map +1 -1
  110. package/lib/services/utils.d.ts +5 -5
  111. package/lib/services/utils.js +25 -25
  112. package/lib/services/utils.js.map +1 -1
  113. package/lib/services/visualDiscovery.d.ts +9 -0
  114. package/lib/services/visualDiscovery.js +167 -0
  115. package/lib/services/visualDiscovery.js.map +1 -0
  116. package/lib/utils/ABTesting.d.ts +2 -1
  117. package/lib/utils/ABTesting.js +27 -14
  118. package/lib/utils/ABTesting.js.map +1 -1
  119. package/lib/utils/API.d.ts +19 -19
  120. package/lib/utils/API.js +81 -81
  121. package/lib/utils/API.js.map +1 -1
  122. package/lib/utils/ArrayUtils.d.ts +2 -2
  123. package/lib/utils/ArrayUtils.js +16 -17
  124. package/lib/utils/ArrayUtils.js.map +1 -1
  125. package/lib/utils/bindingBoxes.d.ts +23 -0
  126. package/lib/utils/bindingBoxes.js +89 -0
  127. package/lib/utils/bindingBoxes.js.map +1 -0
  128. package/lib/utils/cookies.d.ts +13 -13
  129. package/lib/utils/cookies.js +50 -50
  130. package/lib/utils/debug.d.ts +4 -4
  131. package/lib/utils/debug.js +31 -31
  132. package/lib/utils/debug.js.map +1 -1
  133. package/lib/utils/duplicationsHandler.d.ts +19 -0
  134. package/lib/utils/duplicationsHandler.js +70 -0
  135. package/lib/utils/duplicationsHandler.js.map +1 -0
  136. package/lib/utils/filtersPersonalization.d.ts +3 -3
  137. package/lib/utils/filtersPersonalization.js +39 -39
  138. package/lib/utils/filtersPersonalization.js.map +1 -1
  139. package/lib/utils/image.d.ts +6 -0
  140. package/lib/utils/image.js +154 -0
  141. package/lib/utils/image.js.map +1 -0
  142. package/lib/utils/klaviyo.js +1 -1
  143. package/lib/utils/location.d.ts +1 -1
  144. package/lib/utils/location.js +11 -11
  145. package/lib/utils/location.js.map +1 -1
  146. package/lib/utils/mappingUtil.d.ts +4 -4
  147. package/lib/utils/mappingUtil.js +16 -16
  148. package/lib/utils/options.d.ts +23 -23
  149. package/lib/utils/options.js +16 -16
  150. package/lib/utils/personalization.d.ts +2 -0
  151. package/lib/utils/personalization.js +21 -0
  152. package/lib/utils/personalization.js.map +1 -0
  153. package/lib/utils/segments.d.ts +2 -2
  154. package/lib/utils/segments.js +19 -20
  155. package/lib/utils/segments.js.map +1 -1
  156. package/lib/utils/shopifyMarkets.d.ts +3 -3
  157. package/lib/utils/shopifyMarkets.js +12 -12
  158. package/lib/utils/sortUtil.d.ts +1 -0
  159. package/lib/utils/sortUtil.js +25 -0
  160. package/lib/utils/sortUtil.js.map +1 -0
  161. package/lib/utils/updateRecentSearches.d.ts +2 -1
  162. package/lib/utils/updateRecentSearches.js +56 -26
  163. package/lib/utils/updateRecentSearches.js.map +1 -1
  164. package/lib/utils/validation.d.ts +5 -5
  165. package/lib/utils/validation.js +46 -46
  166. package/lib/utils/validation.js.map +1 -1
  167. package/package.json +3 -2
@@ -1,24 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LookAlikeProductRecommendation = exports.debugVersion = void 0;
4
- var API_1 = require("../utils/API");
5
- var debug_1 = require("../utils/debug");
6
- var shopifyMarkets_1 = require("../utils/shopifyMarkets");
7
- var BASE_URL = "https://api.fastsimon.com";
8
- exports.debugVersion = (0, debug_1.getDebugEndpoint)();
9
- exports.LookAlikeProductRecommendation = {
10
- getLookALike: function (_a) {
11
- var viewedProductId = _a.viewedProductId, storeID = _a.storeID, uuid = _a.uuid, hasShopifyMarkets = _a.hasShopifyMarkets, companyLocationContext = _a.companyLocationContext;
12
- return API_1.API.get({
13
- url: "".concat(exports.debugVersion || BASE_URL, "/lookalike"),
14
- params: {
15
- UUID: uuid,
16
- store_id: storeID,
17
- product_id: parseInt(viewedProductId),
18
- market_context: hasShopifyMarkets ? shopifyMarkets_1.default.getCountry() : undefined,
19
- company_location_context: companyLocationContext ? companyLocationContext : undefined
20
- }
21
- });
22
- },
23
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LookAlikeProductRecommendation = exports.debugVersion = void 0;
4
+ var API_1 = require("../utils/API");
5
+ var debug_1 = require("../utils/debug");
6
+ var shopifyMarkets_1 = require("../utils/shopifyMarkets");
7
+ var BASE_URL = "https://api.fastsimon.com";
8
+ exports.debugVersion = (0, debug_1.getDebugEndpoint)();
9
+ exports.LookAlikeProductRecommendation = {
10
+ getLookALike: function (_a) {
11
+ var viewedProductId = _a.viewedProductId, storeID = _a.storeID, uuid = _a.uuid, hasShopifyMarkets = _a.hasShopifyMarkets, companyLocationContext = _a.companyLocationContext;
12
+ return API_1.API.get({
13
+ url: "".concat(exports.debugVersion || BASE_URL, "/lookalike"),
14
+ params: {
15
+ UUID: uuid,
16
+ store_id: storeID,
17
+ product_id: parseInt(viewedProductId),
18
+ market_context: hasShopifyMarkets ? shopifyMarkets_1.default.getCountry() : undefined,
19
+ company_location_context: companyLocationContext ? companyLocationContext : undefined
20
+ }
21
+ });
22
+ },
23
+ };
24
24
  //# sourceMappingURL=lookAlikeProductRecommendation.js.map
@@ -1,29 +1,48 @@
1
- import { RelatedResponse, Specs, SRC_TYPES } from "../models/related";
2
- export declare const debugVersion: string;
3
- export declare const Related: {
4
- getProducts: ({ storeID, uuid, productID, recent, specs, cartToken, withAttributes, src, hasShopifyMarkets, companyLocationContext, isPersonalizedFiltersActive, userToken }: {
5
- productID: string;
6
- storeID: number;
7
- uuid: string;
8
- recent: string[];
9
- specs: Specs[];
10
- cartToken: string;
11
- withAttributes?: boolean | undefined;
12
- src?: SRC_TYPES | undefined;
13
- hasShopifyMarkets?: boolean | undefined;
14
- companyLocationContext?: number | undefined;
15
- isPersonalizedFiltersActive?: boolean | undefined;
16
- userToken?: string | undefined;
17
- }) => Promise<RelatedResponse>;
18
- getRecentlyViewed: ({ recent, uuid, storeID, categoryID, cartToken, hasShopifyMarkets, companyLocationContext, isPersonalizedFiltersActive, userToken }: {
19
- storeID: number;
20
- uuid: string;
21
- recent: string[];
22
- categoryID?: string | undefined;
23
- cartToken: string;
24
- hasShopifyMarkets?: boolean | undefined;
25
- companyLocationContext?: number | undefined;
26
- isPersonalizedFiltersActive?: boolean | undefined;
27
- userToken?: string | undefined;
28
- }) => Promise<RelatedResponse>;
29
- };
1
+ import { RelatedResponse, Specs, SRC_TYPES } from "../models/related";
2
+ export declare const debugVersion: string;
3
+ export declare const Related: {
4
+ getProducts: ({ storeID, uuid, productID, recent, specs, cartToken, withAttributes, src, hasShopifyMarkets, companyLocationContext, isPersonalizedFiltersActive, userToken }: {
5
+ productID: string;
6
+ storeID: number;
7
+ uuid: string;
8
+ recent: string[];
9
+ specs: Specs[];
10
+ cartToken: string;
11
+ withAttributes?: boolean;
12
+ src?: SRC_TYPES;
13
+ hasShopifyMarkets?: boolean;
14
+ companyLocationContext?: number;
15
+ isPersonalizedFiltersActive?: boolean;
16
+ userToken?: string;
17
+ }) => Promise<RelatedResponse>;
18
+ getRecentlyViewed: ({ recent, uuid, storeID, categoryID, cartToken, hasShopifyMarkets, companyLocationContext, isPersonalizedFiltersActive, userToken }: {
19
+ storeID: number;
20
+ uuid: string;
21
+ recent: string[];
22
+ categoryID?: string;
23
+ cartToken: string;
24
+ hasShopifyMarkets?: boolean;
25
+ companyLocationContext?: number;
26
+ isPersonalizedFiltersActive?: boolean;
27
+ userToken?: string;
28
+ }) => Promise<RelatedResponse>;
29
+ getWidgetProducts: ({ storeID, uuid, productID, recent, widgetsIDS, cartToken, withAttributes, src, hasShopifyMarkets, companyLocationContext, isPersonalizedFiltersActive, userToken, abTestingVariations }: {
30
+ productID: string;
31
+ storeID: number;
32
+ uuid: string;
33
+ recent: string[];
34
+ widgetsIDS: string[];
35
+ cartToken: string;
36
+ withAttributes?: boolean;
37
+ src?: SRC_TYPES;
38
+ hasShopifyMarkets?: boolean;
39
+ companyLocationContext?: number;
40
+ isPersonalizedFiltersActive?: boolean;
41
+ userToken?: string;
42
+ abTestingVariations?: {
43
+ [key: string]: {
44
+ [key: string]: object;
45
+ };
46
+ };
47
+ }) => Promise<unknown>;
48
+ };
@@ -1,73 +1,115 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Related = exports.debugVersion = void 0;
4
- var API_1 = require("../utils/API");
5
- var config_1 = require("../config");
6
- var debug_1 = require("../utils/debug");
7
- var options_1 = require("../utils/options");
8
- var shopifyMarkets_1 = require("../utils/shopifyMarkets");
9
- var filtersPersonalization_1 = require("../utils/filtersPersonalization");
10
- var BASE_URL = "https://api.fastsimon.com";
11
- exports.debugVersion = (0, debug_1.getDebugEndpoint)();
12
- exports.Related = {
13
- getProducts: function (_a) {
14
- var storeID = _a.storeID, uuid = _a.uuid, productID = _a.productID, _b = _a.recent, recent = _b === void 0 ? [] : _b, _c = _a.specs, specs = _c === void 0 ? [] : _c, cartToken = _a.cartToken, withAttributes = _a.withAttributes, src = _a.src, hasShopifyMarkets = _a.hasShopifyMarkets, companyLocationContext = _a.companyLocationContext, isPersonalizedFiltersActive = _a.isPersonalizedFiltersActive, userToken = _a.userToken;
15
- var st = userToken || localStorage.getItem(config_1.USER_SESSION_TOKEN_LS_KEY) || localStorage.getItem('isp_token_1') || undefined;
16
- var filtersPersonalization = (0, filtersPersonalization_1.isFiltersPersonalization)(false, isPersonalizedFiltersActive);
17
- return API_1.API.get({
18
- url: "".concat(exports.debugVersion || BASE_URL, "/related_products_suggest"),
19
- params: {
20
- src: src !== null && src !== void 0 ? src : "JSSDK",
21
- product_id: productID,
22
- UUID: uuid,
23
- store_id: storeID,
24
- products: JSON.stringify(recent),
25
- specs: JSON.stringify(serializeSpecs(specs)),
26
- cart_token: cartToken,
27
- // ab_testing
28
- disable_personalization: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_recommendations_personalization"),
29
- with_product_attributes: withAttributes,
30
- market_context: hasShopifyMarkets ? shopifyMarkets_1.default.getCountry() : undefined,
31
- company_location_context: companyLocationContext ? companyLocationContext : undefined,
32
- st: (st && filtersPersonalization) ? st : undefined
33
- }
34
- });
35
- },
36
- getRecentlyViewed: function (_a) {
37
- var _b = _a.recent, recent = _b === void 0 ? [] : _b, uuid = _a.uuid, storeID = _a.storeID, categoryID = _a.categoryID, cartToken = _a.cartToken, hasShopifyMarkets = _a.hasShopifyMarkets, companyLocationContext = _a.companyLocationContext, isPersonalizedFiltersActive = _a.isPersonalizedFiltersActive, userToken = _a.userToken;
38
- var st = userToken || localStorage.getItem(config_1.USER_SESSION_TOKEN_LS_KEY) || localStorage.getItem('isp_token_1') || undefined;
39
- var filtersPersonalization = (0, filtersPersonalization_1.isFiltersPersonalization)(false, isPersonalizedFiltersActive);
40
- return API_1.API.get({
41
- url: "".concat(exports.debugVersion || BASE_URL, "/related_products_suggest"),
42
- params: {
43
- UUID: uuid,
44
- store_id: storeID,
45
- products: JSON.stringify(recent),
46
- specs: JSON.stringify([
47
- {
48
- sources: "related_recently_viewed",
49
- max_suggest: config_1.MAX_RECENT_COLLECTION_PRODUCTS,
50
- widget_id: "isp-recently-viewed",
51
- categories: categoryID,
52
- personalization: true,
53
- }
54
- ]),
55
- cart_token: cartToken,
56
- market_context: hasShopifyMarkets ? shopifyMarkets_1.default.getCountry() : undefined,
57
- company_location_context: companyLocationContext ? companyLocationContext : undefined,
58
- st: (st && filtersPersonalization) ? st : undefined
59
- }
60
- });
61
- },
62
- };
63
- var serializeSpecs = function (specs) { return specs.map(function (spec) {
64
- var _a, _b;
65
- return ({
66
- sources: spec.sources.join ? spec.sources.join(",") : spec.sources,
67
- max_suggest: String(spec.maxSuggestions),
68
- categories: ((_b = (_a = spec.collectionIDs) !== null && _a !== void 0 ? _a : spec.categoriesIDs) !== null && _b !== void 0 ? _b : []).join(","),
69
- widget_id: spec.widgetID,
70
- title: ""
71
- });
72
- }); };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Related = exports.debugVersion = void 0;
4
+ var API_1 = require("../utils/API");
5
+ var config_1 = require("../config");
6
+ var debug_1 = require("../utils/debug");
7
+ var options_1 = require("../utils/options");
8
+ var shopifyMarkets_1 = require("../utils/shopifyMarkets");
9
+ var filtersPersonalization_1 = require("../utils/filtersPersonalization");
10
+ var ABTesting_1 = require("../utils/ABTesting");
11
+ var BASE_URL = "https://api.fastsimon.com";
12
+ exports.debugVersion = (0, debug_1.getDebugEndpoint)();
13
+ exports.Related = {
14
+ getProducts: function (_a) {
15
+ var storeID = _a.storeID, uuid = _a.uuid, productID = _a.productID, _b = _a.recent, recent = _b === void 0 ? [] : _b, _c = _a.specs, specs = _c === void 0 ? [] : _c, cartToken = _a.cartToken, withAttributes = _a.withAttributes, src = _a.src, hasShopifyMarkets = _a.hasShopifyMarkets, companyLocationContext = _a.companyLocationContext, isPersonalizedFiltersActive = _a.isPersonalizedFiltersActive, userToken = _a.userToken;
16
+ var st = userToken || localStorage.getItem(config_1.USER_SESSION_TOKEN_LS_KEY) || localStorage.getItem('isp_token_1') || undefined;
17
+ var filtersPersonalization = (0, filtersPersonalization_1.isFiltersPersonalization)(false, isPersonalizedFiltersActive);
18
+ return API_1.API.get({
19
+ url: "".concat(exports.debugVersion || BASE_URL, "/related_products_suggest"),
20
+ params: {
21
+ src: src !== null && src !== void 0 ? src : "JSSDK",
22
+ product_id: productID,
23
+ UUID: uuid,
24
+ store_id: storeID,
25
+ products: JSON.stringify(recent),
26
+ specs: JSON.stringify(serializeSpecs(specs)),
27
+ cart_token: cartToken,
28
+ // ab_testing
29
+ disable_personalization: (0, options_1.getSDKABTestingOptionExist)("ab_test_disable_recommendations_personalization"),
30
+ with_product_attributes: withAttributes,
31
+ market_context: hasShopifyMarkets ? shopifyMarkets_1.default.getCountry() : undefined,
32
+ company_location_context: companyLocationContext ? companyLocationContext : undefined,
33
+ st: (st && filtersPersonalization) ? st : undefined
34
+ }
35
+ });
36
+ },
37
+ getRecentlyViewed: function (_a) {
38
+ var _b = _a.recent, recent = _b === void 0 ? [] : _b, uuid = _a.uuid, storeID = _a.storeID, categoryID = _a.categoryID, cartToken = _a.cartToken, hasShopifyMarkets = _a.hasShopifyMarkets, companyLocationContext = _a.companyLocationContext, isPersonalizedFiltersActive = _a.isPersonalizedFiltersActive, userToken = _a.userToken;
39
+ var st = userToken || localStorage.getItem(config_1.USER_SESSION_TOKEN_LS_KEY) || localStorage.getItem('isp_token_1') || undefined;
40
+ var filtersPersonalization = (0, filtersPersonalization_1.isFiltersPersonalization)(false, isPersonalizedFiltersActive);
41
+ return API_1.API.get({
42
+ url: "".concat(exports.debugVersion || BASE_URL, "/related_products_suggest"),
43
+ params: {
44
+ UUID: uuid,
45
+ store_id: storeID,
46
+ products: JSON.stringify(recent),
47
+ specs: JSON.stringify([
48
+ {
49
+ sources: "related_recently_viewed",
50
+ max_suggest: config_1.MAX_RECENT_COLLECTION_PRODUCTS,
51
+ widget_id: "isp-recently-viewed",
52
+ categories: categoryID,
53
+ personalization: true,
54
+ }
55
+ ]),
56
+ cart_token: cartToken,
57
+ market_context: hasShopifyMarkets ? shopifyMarkets_1.default.getCountry() : undefined,
58
+ company_location_context: companyLocationContext ? companyLocationContext : undefined,
59
+ st: (st && filtersPersonalization) ? st : undefined
60
+ }
61
+ });
62
+ },
63
+ getWidgetProducts: function (_a) {
64
+ var storeID = _a.storeID, uuid = _a.uuid, productID = _a.productID, _b = _a.recent, recent = _b === void 0 ? [] : _b, _c = _a.widgetsIDS, widgetsIDS = _c === void 0 ? [] : _c, cartToken = _a.cartToken, withAttributes = _a.withAttributes, src = _a.src, hasShopifyMarkets = _a.hasShopifyMarkets, companyLocationContext = _a.companyLocationContext, isPersonalizedFiltersActive = _a.isPersonalizedFiltersActive, userToken = _a.userToken, abTestingVariations = _a.abTestingVariations;
65
+ var st = userToken || localStorage.getItem(config_1.USER_SESSION_TOKEN_LS_KEY) || localStorage.getItem("isp_token_1") || undefined;
66
+ var filtersPersonalization = (0, filtersPersonalization_1.isFiltersPersonalization)(false, isPersonalizedFiltersActive);
67
+ var variant_id = (0, ABTesting_1.getUserVariation)();
68
+ var formatedWidgetsIDS = widgetsIDS;
69
+ var ABTestFlag = false;
70
+ if (variant_id && (abTestingVariations === null || abTestingVariations === void 0 ? void 0 : abTestingVariations[variant_id]) && (abTestingVariations === null || abTestingVariations === void 0 ? void 0 : abTestingVariations[variant_id]["recommendation_widgets"])) {
71
+ var recommendationWidgets_1 = abTestingVariations === null || abTestingVariations === void 0 ? void 0 : abTestingVariations[variant_id]["recommendation_widgets"];
72
+ widgetsIDS.forEach(function (widgetid, index) {
73
+ if (recommendationWidgets_1[widgetid]) {
74
+ var mappedTo = recommendationWidgets_1[widgetid];
75
+ formatedWidgetsIDS[index] = mappedTo;
76
+ ABTestFlag = true;
77
+ }
78
+ });
79
+ }
80
+ if (ABTestFlag) {
81
+ console.log("%cAB Testing taking affect on the upsell & cross-sell widgets", 'font-weight: bold; font-size: 12px; color: darkgreen');
82
+ }
83
+ if (!(widgetsIDS === null || widgetsIDS === void 0 ? void 0 : widgetsIDS.length)) {
84
+ console.log("%c\u274C IS+ SDK Error | Widget Ids Has Not Been Provided", 'font-weight: bold; font-size: 12px; color: red');
85
+ return new Promise(function (resolve) { return (resolve(null)); });
86
+ }
87
+ return API_1.API.get({
88
+ url: "".concat(exports.debugVersion || BASE_URL, "/upsell_cross_sell_recommendation"),
89
+ params: {
90
+ request_source: src !== null && src !== void 0 ? src : "JSSDK",
91
+ cart_token: cartToken,
92
+ widgets_ids: JSON.stringify(formatedWidgetsIDS),
93
+ product_id: productID ? productID : undefined,
94
+ products: JSON.stringify(recent),
95
+ UUID: uuid,
96
+ store_id: storeID,
97
+ market_context: hasShopifyMarkets ? shopifyMarkets_1.default.getCountry() : undefined,
98
+ with_product_attributes: withAttributes,
99
+ company_location_context: companyLocationContext ? companyLocationContext : undefined,
100
+ st: (st && filtersPersonalization) ? st : undefined
101
+ }
102
+ });
103
+ }
104
+ };
105
+ var serializeSpecs = function (specs) { return specs.map(function (spec) {
106
+ var _a, _b;
107
+ return ({
108
+ sources: spec.sources.join ? spec.sources.join(",") : spec.sources,
109
+ max_suggest: String(spec.maxSuggestions),
110
+ categories: ((_b = (_a = spec.collectionIDs) !== null && _a !== void 0 ? _a : spec.categoriesIDs) !== null && _b !== void 0 ? _b : []).join(","),
111
+ widget_id: spec.widgetID,
112
+ title: ""
113
+ });
114
+ }); };
73
115
  //# sourceMappingURL=related.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"related.js","sourceRoot":"","sources":["../../src/services/related.ts"],"names":[],"mappings":";;;AAAA,oCAAiC;AAE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AAC,UAAA,IAAI;;IAAI,OAAA,CAAC;QAC1D,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;QAClE,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC;QACxC,UAAU,EAAE,CAAC,MAAA,MAAA,IAAI,CAAC,aAAa,mCAAI,IAAI,CAAC,aAAa,mCAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QACtE,SAAS,EAAE,IAAI,CAAC,QAAQ;QACxB,KAAK,EAAE,EAAE;KACZ,CAAC,CAAA;CAAA,CAAC,EANwC,CAMxC,CAAC"}
@@ -1,68 +1,80 @@
1
- import { Narrow, SortBy } from "../models/fullTextSearch";
2
- import { LookAlikeEventType } from "../models/lookAlikeProductRecommendation";
3
- interface RequestKey {
4
- uuid: string;
5
- storeID: number;
6
- userToken: string;
7
- sessionStart: number;
8
- cartToken: string;
9
- }
10
- type source = "autocomplete" | "search" | "category" | "quick view" | "look a like" | "direct" | "related";
11
- interface ProductVisitedProps extends RequestKey {
12
- type: source;
13
- productId: string;
14
- originId?: string;
15
- term?: string;
16
- query?: string;
17
- recommended?: boolean;
18
- position?: number;
19
- reference?: string;
20
- originProduct?: string;
21
- categoryName?: string;
22
- categoryID?: string;
23
- imageID?: string;
24
- sourceProduct?: string;
25
- rec?: number | undefined;
26
- rec_src?: number | undefined;
27
- }
28
- interface CategorySearchSeenProps extends Omit<ProductVisitedProps, "productId" | "type"> {
29
- categoryID: string;
30
- }
31
- interface SearchPreformedProps extends RequestKey {
32
- query: string;
33
- narrow?: Narrow[];
34
- sortBy?: SortBy;
35
- products?: string[];
36
- pagenum?: string;
37
- rescount?: string;
38
- }
39
- interface collectionPreformedProps extends RequestKey {
40
- collectionID: string;
41
- query: string;
42
- narrow?: Narrow[];
43
- sortBy?: SortBy;
44
- products?: string[];
45
- pagenum?: string;
46
- rescount?: string;
47
- }
48
- interface PopUpUsedProps extends RequestKey {
49
- type: LookAlikeEventType;
50
- position: number;
51
- productId: string;
52
- query?: string;
53
- categoryID?: string;
54
- categoryName?: string;
55
- }
56
- interface AddToCartProps extends RequestKey {
57
- productID?: string;
58
- }
59
- export declare const Reporting: {
60
- productSeen: ({ type, categoryID, categoryName, cartToken, originId, originProduct, productId, reference, term, sessionStart, storeID, userToken, uuid, position, recommended, imageID, sourceProduct, rec_src }: ProductVisitedProps) => Promise<any>;
61
- popularSearchSeen: ({ originId, userToken, storeID, sessionStart, cartToken, uuid, term }: Omit<ProductVisitedProps, "productId" | "type" | "query">) => Promise<any>;
62
- categorySearchSeen: ({ uuid, storeID, term, categoryID, sessionStart, userToken, cartToken }: CategorySearchSeenProps) => Promise<any>;
63
- searchPerformed: ({ storeID, uuid, query, sortBy, narrow, sessionStart, userToken, cartToken, products, pagenum, rescount }: SearchPreformedProps) => Promise<any>;
64
- collectionPerformed: ({ sortBy, query, narrow, sessionStart, userToken, uuid, storeID, collectionID, cartToken, products, pagenum, rescount }: collectionPreformedProps) => Promise<any>;
65
- popUpUsed: ({ cartToken, sessionStart, userToken, uuid, storeID, position, productId, categoryID, categoryName, query, type }: PopUpUsedProps) => Promise<any>;
66
- addToCart: ({ storeID, uuid, cartToken, sessionStart, userToken, productID }: AddToCartProps) => Promise<any>;
67
- };
68
- export {};
1
+ import { Narrow, SortBy } from "../models/fullTextSearch";
2
+ import { LookAlikeEventType } from "../models/lookAlikeProductRecommendation";
3
+ import { PromotileEvent } from "../models/events";
4
+ interface RequestKey {
5
+ uuid: string;
6
+ storeID: number;
7
+ userToken: string;
8
+ sessionStart: number;
9
+ cartToken: string;
10
+ }
11
+ type source = "autocomplete" | "search" | "category" | "quick view" | "look a like" | "direct" | "related";
12
+ interface ProductVisitedProps extends RequestKey {
13
+ type: source;
14
+ productId: string;
15
+ originId?: string;
16
+ term?: string;
17
+ query?: string;
18
+ recommended?: boolean;
19
+ position?: number;
20
+ reference?: string;
21
+ originProduct?: string;
22
+ categoryName?: string;
23
+ categoryID?: string;
24
+ imageID?: string;
25
+ sourceProduct?: string;
26
+ rec?: number | undefined;
27
+ rec_src?: number | undefined;
28
+ }
29
+ interface PromotileVisitedProps extends ProductVisitedProps {
30
+ link: string;
31
+ thumbnail: string;
32
+ }
33
+ interface CategorySearchSeenProps extends Omit<ProductVisitedProps, "productId" | "type"> {
34
+ categoryID: string;
35
+ }
36
+ interface SearchPreformedProps extends RequestKey {
37
+ query: string;
38
+ narrow?: Narrow[];
39
+ sortBy?: SortBy;
40
+ products?: string[];
41
+ pagenum?: string;
42
+ rescount?: string;
43
+ promoTiles?: PromotileEvent[];
44
+ personalizedProducts?: string | undefined;
45
+ sessionProducts?: string;
46
+ }
47
+ interface collectionPreformedProps extends RequestKey {
48
+ collectionID: string;
49
+ query: string;
50
+ narrow?: Narrow[];
51
+ sortBy?: SortBy;
52
+ products?: string[];
53
+ pagenum?: string;
54
+ rescount?: string;
55
+ promoTiles?: PromotileEvent[];
56
+ personalizedProducts?: string | undefined;
57
+ sessionProducts?: string;
58
+ }
59
+ interface PopUpUsedProps extends RequestKey {
60
+ type: LookAlikeEventType;
61
+ position: number;
62
+ productId: string;
63
+ query?: string;
64
+ categoryID?: string;
65
+ categoryName?: string;
66
+ }
67
+ interface AddToCartProps extends RequestKey {
68
+ productID?: string;
69
+ }
70
+ export declare const Reporting: {
71
+ productSeen: ({ type, categoryID, categoryName, cartToken, originId, originProduct, productId, reference, term, sessionStart, storeID, userToken, uuid, position, recommended, imageID, sourceProduct, rec_src }: ProductVisitedProps) => Promise<any>;
72
+ promotileClicked: ({ type, categoryID, categoryName, cartToken, originId, originProduct, productId, reference, term, sessionStart, storeID, userToken, uuid, position, recommended, imageID, sourceProduct, rec_src, link, thumbnail }: PromotileVisitedProps) => Promise<any>;
73
+ popularSearchSeen: ({ originId, userToken, storeID, sessionStart, cartToken, uuid, term }: Omit<ProductVisitedProps, "productId" | "type" | "query">) => Promise<any>;
74
+ categorySearchSeen: ({ uuid, storeID, term, categoryID, sessionStart, userToken, cartToken }: CategorySearchSeenProps) => Promise<any>;
75
+ searchPerformed: ({ storeID, uuid, query, sortBy, narrow, sessionStart, userToken, cartToken, products, pagenum, rescount, promoTiles, personalizedProducts, sessionProducts, }: SearchPreformedProps) => Promise<any>;
76
+ collectionPerformed: ({ sortBy, query, narrow, sessionStart, userToken, uuid, storeID, collectionID, cartToken, products, pagenum, rescount, promoTiles, personalizedProducts, sessionProducts }: collectionPreformedProps, fromTurboLink?: boolean) => Promise<any>;
77
+ popUpUsed: ({ cartToken, sessionStart, userToken, uuid, storeID, position, productId, categoryID, categoryName, query, type }: PopUpUsedProps) => Promise<any>;
78
+ addToCart: ({ storeID, uuid, cartToken, sessionStart, userToken, productID }: AddToCartProps) => Promise<any>;
79
+ };
80
+ export {};