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
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export type inventoryCallback = ({}: {
|
|
2
|
-
action: "products inventory";
|
|
3
|
-
payload: {
|
|
4
|
-
productsInventory: productsInventoryResults[];
|
|
5
|
-
};
|
|
6
|
-
}) => void;
|
|
7
|
-
export interface productsInventoryResults {
|
|
8
|
-
id: string;
|
|
9
|
-
totalInventory: number;
|
|
10
|
-
}
|
|
1
|
+
export type inventoryCallback = ({}: {
|
|
2
|
+
action: "products inventory";
|
|
3
|
+
payload: {
|
|
4
|
+
productsInventory: productsInventoryResults[];
|
|
5
|
+
};
|
|
6
|
+
}) => void;
|
|
7
|
+
export interface productsInventoryResults {
|
|
8
|
+
id: string;
|
|
9
|
+
totalInventory: number;
|
|
10
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=productsInventory.js.map
|
package/lib/models/related.d.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { Product } from "./fullTextSearch";
|
|
2
|
-
export interface Specs {
|
|
3
|
-
sources: Source[];
|
|
4
|
-
maxSuggestions: number;
|
|
5
|
-
collectionIDs?: string[];
|
|
6
|
-
categoriesIDs?: string[];
|
|
7
|
-
widgetID: string;
|
|
8
|
-
}
|
|
9
|
-
export type Source = "related_recent_products" | "related_purchase" | "related_views" | "related_cart" | "similar_products" | "related_recently_viewed" | "similar_products_by_attributes" | "similar_products_lookalike" | "related_top_products";
|
|
10
|
-
export type SRC_TYPES = "JSSDK" | "TAPCART_SDK";
|
|
11
|
-
export interface Widget {
|
|
12
|
-
productID: string;
|
|
13
|
-
widgetID: string;
|
|
14
|
-
categoriesIDs: string[];
|
|
15
|
-
payload: Product[];
|
|
16
|
-
sources: string;
|
|
17
|
-
}
|
|
18
|
-
export type WidgetCallback = (response: RecommendationsResponse) => void;
|
|
19
|
-
export interface RecommendationsResponse {
|
|
20
|
-
action: "recommendations";
|
|
21
|
-
payload: Widget[];
|
|
22
|
-
}
|
|
23
|
-
export interface RelatedResponse {
|
|
24
|
-
widget_responses: WidgetResponse[];
|
|
25
|
-
}
|
|
26
|
-
interface WidgetResponse {
|
|
27
|
-
categories: null | string;
|
|
28
|
-
from_product: number;
|
|
29
|
-
sources: string;
|
|
30
|
-
title: string;
|
|
31
|
-
widget_id: string;
|
|
32
|
-
products: Product[];
|
|
33
|
-
promoted_by_personalization?: number[];
|
|
34
|
-
}
|
|
35
|
-
export {};
|
|
1
|
+
import { Product } from "./fullTextSearch";
|
|
2
|
+
export interface Specs {
|
|
3
|
+
sources: Source[];
|
|
4
|
+
maxSuggestions: number;
|
|
5
|
+
collectionIDs?: string[];
|
|
6
|
+
categoriesIDs?: string[];
|
|
7
|
+
widgetID: string;
|
|
8
|
+
}
|
|
9
|
+
export type Source = "related_recent_products" | "related_purchase" | "related_views" | "related_cart" | "similar_products" | "related_recently_viewed" | "similar_products_by_attributes" | "similar_products_lookalike" | "related_top_products";
|
|
10
|
+
export type SRC_TYPES = "JSSDK" | "TAPCART_SDK";
|
|
11
|
+
export interface Widget {
|
|
12
|
+
productID: string;
|
|
13
|
+
widgetID: string;
|
|
14
|
+
categoriesIDs: string[];
|
|
15
|
+
payload: Product[];
|
|
16
|
+
sources: string;
|
|
17
|
+
}
|
|
18
|
+
export type WidgetCallback = (response: RecommendationsResponse) => void;
|
|
19
|
+
export interface RecommendationsResponse {
|
|
20
|
+
action: "recommendations";
|
|
21
|
+
payload: Widget[];
|
|
22
|
+
}
|
|
23
|
+
export interface RelatedResponse {
|
|
24
|
+
widget_responses: WidgetResponse[];
|
|
25
|
+
}
|
|
26
|
+
interface WidgetResponse {
|
|
27
|
+
categories: null | string;
|
|
28
|
+
from_product: number;
|
|
29
|
+
sources: string;
|
|
30
|
+
title: string;
|
|
31
|
+
widget_id: string;
|
|
32
|
+
products: Product[];
|
|
33
|
+
promoted_by_personalization?: number[];
|
|
34
|
+
}
|
|
35
|
+
export {};
|
package/lib/models/related.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=related.js.map
|
|
@@ -1,90 +1,94 @@
|
|
|
1
|
-
import { FacetRequired, Narrow, Product, RelatedCategoryServer, SortBy } from "./fullTextSearch";
|
|
2
|
-
import { ServerFacet } from "@fast-simon/utilities";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
export
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
export interface
|
|
86
|
-
id: string;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
1
|
+
import { FacetRequired, Narrow, Product, RelatedCategoryServer, SortBy } from "./fullTextSearch";
|
|
2
|
+
import { ServerFacet } from "@fast-simon/utilities";
|
|
3
|
+
import { CollectionsPersonalization } from "./common";
|
|
4
|
+
export interface SmartCollectionsResponse {
|
|
5
|
+
ancestor_categories: CategoryAncestor[];
|
|
6
|
+
category_description: string;
|
|
7
|
+
category_id: string;
|
|
8
|
+
category_name: string;
|
|
9
|
+
category_url: string;
|
|
10
|
+
facets: ServerFacet[];
|
|
11
|
+
facets_completed: false;
|
|
12
|
+
isp_quick_view_mode: 0;
|
|
13
|
+
items: Product[];
|
|
14
|
+
p: number;
|
|
15
|
+
str_site_key: string;
|
|
16
|
+
term: string;
|
|
17
|
+
total_p: number;
|
|
18
|
+
total_results: number;
|
|
19
|
+
personalization_recency_limit: number;
|
|
20
|
+
use_personalized_collection: boolean;
|
|
21
|
+
uuid: string;
|
|
22
|
+
sort_by?: SortBy;
|
|
23
|
+
narrow: [string, string, string][];
|
|
24
|
+
pop_products_no_results?: boolean;
|
|
25
|
+
avoid_tag_prefixes?: string;
|
|
26
|
+
merch?: any;
|
|
27
|
+
banner_html?: string;
|
|
28
|
+
related_categories?: RelatedCategoryServer[];
|
|
29
|
+
personalized_products?: number[];
|
|
30
|
+
}
|
|
31
|
+
export type CategoryAncestor = [string, string, string];
|
|
32
|
+
export interface smartCollections {
|
|
33
|
+
storeID: number;
|
|
34
|
+
uuid: string;
|
|
35
|
+
cdn: number;
|
|
36
|
+
categoryID: string;
|
|
37
|
+
userToken: string;
|
|
38
|
+
sessionStart: number;
|
|
39
|
+
page?: number;
|
|
40
|
+
productsPerPage?: number;
|
|
41
|
+
sortBy?: SortBy;
|
|
42
|
+
narrowBy?: Narrow[];
|
|
43
|
+
facetRequired?: FacetRequired;
|
|
44
|
+
withAttributes?: boolean;
|
|
45
|
+
recent?: string;
|
|
46
|
+
rec?: boolean;
|
|
47
|
+
searchWithinSearch?: string;
|
|
48
|
+
segments?: string[];
|
|
49
|
+
hasShopifyMarkets?: boolean;
|
|
50
|
+
companyLocationContext?: number;
|
|
51
|
+
withProductTypes?: boolean;
|
|
52
|
+
abTestingVariations?: {
|
|
53
|
+
[key: string]: {
|
|
54
|
+
[key: string]: object;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
disableMerchandising?: boolean;
|
|
58
|
+
disableStrategies?: boolean;
|
|
59
|
+
disableMerchandisingRules?: boolean;
|
|
60
|
+
isPersonalizedFiltersActive?: boolean;
|
|
61
|
+
disableTurbolinks?: boolean;
|
|
62
|
+
collectionPersonalization?: CollectionsPersonalization;
|
|
63
|
+
}
|
|
64
|
+
export interface smartCollectionsResults {
|
|
65
|
+
ancestors: CategoryAncestor[];
|
|
66
|
+
categoryID: string;
|
|
67
|
+
name: string;
|
|
68
|
+
products: Product[];
|
|
69
|
+
facets?: ServerFacet[];
|
|
70
|
+
totalResults: number;
|
|
71
|
+
sortBy?: SortBy;
|
|
72
|
+
narrow?: Narrow[];
|
|
73
|
+
isNoResults?: boolean;
|
|
74
|
+
page?: number;
|
|
75
|
+
pageCount?: number;
|
|
76
|
+
avoidPrefixList?: string[];
|
|
77
|
+
merch?: any;
|
|
78
|
+
bannerHTML?: string;
|
|
79
|
+
relatedCategories?: RelatedCategory[];
|
|
80
|
+
}
|
|
81
|
+
export type smartCollectionsCallback = ({}: {
|
|
82
|
+
action: "products" | "facets and products";
|
|
83
|
+
payload: smartCollectionsResults;
|
|
84
|
+
}) => void;
|
|
85
|
+
export interface RecentSmartCollectionProduct {
|
|
86
|
+
id: string;
|
|
87
|
+
time: number;
|
|
88
|
+
}
|
|
89
|
+
export interface RelatedCategory {
|
|
90
|
+
id: string;
|
|
91
|
+
title: string;
|
|
92
|
+
image: string;
|
|
93
|
+
url: string;
|
|
94
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=smartCollections.js.map
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { Product } from "./fullTextSearch";
|
|
2
|
+
import { Box } from "../utils/bindingBoxes";
|
|
3
|
+
export interface RequestKey {
|
|
4
|
+
uuid: string;
|
|
5
|
+
storeID: number;
|
|
6
|
+
cdnCacheKey: string;
|
|
7
|
+
}
|
|
8
|
+
export declare enum ResultType {
|
|
9
|
+
Instagram = "instagram",
|
|
10
|
+
Visual = "visual",
|
|
11
|
+
Popular = "popular",
|
|
12
|
+
Product = "product"
|
|
13
|
+
}
|
|
14
|
+
export interface ExtendedRequestKey extends RequestKey {
|
|
15
|
+
userSessionID: string;
|
|
16
|
+
sessionToken: string | null | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface FetchProductsResponse {
|
|
19
|
+
image_id: string;
|
|
20
|
+
items: Product[];
|
|
21
|
+
likes: number;
|
|
22
|
+
t: string;
|
|
23
|
+
d: string;
|
|
24
|
+
bbox?: ApiBoundingBox[];
|
|
25
|
+
complete_the_look?: {
|
|
26
|
+
[key: string]: Product[];
|
|
27
|
+
};
|
|
28
|
+
product_label?: string;
|
|
29
|
+
similar?: Product[];
|
|
30
|
+
video_url?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface VisualSearchProductResponse {
|
|
33
|
+
image_id: string;
|
|
34
|
+
items: Product[];
|
|
35
|
+
method: string;
|
|
36
|
+
bbox?: (ApiBoundingBox[] | Box[]);
|
|
37
|
+
}
|
|
38
|
+
export interface DiscoveryImage {
|
|
39
|
+
image_id: string;
|
|
40
|
+
likes: number;
|
|
41
|
+
t: string;
|
|
42
|
+
d: string;
|
|
43
|
+
}
|
|
44
|
+
export interface ShopTheLookResponse extends ShopTheLookData {
|
|
45
|
+
product_label?: string;
|
|
46
|
+
image_id?: number | string;
|
|
47
|
+
similar?: Product[];
|
|
48
|
+
}
|
|
49
|
+
export interface ShopTheLookData {
|
|
50
|
+
bbox?: ApiBoundingBox[];
|
|
51
|
+
complete_the_look?: {
|
|
52
|
+
[key: string]: Product[];
|
|
53
|
+
};
|
|
54
|
+
showShopTheLookSwitch?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface ApiBoundingBox {
|
|
57
|
+
name: string;
|
|
58
|
+
bb: number[];
|
|
59
|
+
person: string;
|
|
60
|
+
}
|
|
61
|
+
export interface FetchProductsDiscoveryParams extends RequestKey {
|
|
62
|
+
imageID: string;
|
|
63
|
+
mode: ResultType;
|
|
64
|
+
}
|
|
65
|
+
export interface FetchDiscoveryParams extends RequestKey {
|
|
66
|
+
mode: ResultType;
|
|
67
|
+
}
|
|
68
|
+
export interface FetchProductsDiscoveryParamsUserImageParams extends ExtendedRequestKey {
|
|
69
|
+
imageID: string;
|
|
70
|
+
}
|
|
71
|
+
export interface FetchProductsDiscoveryParamsUserImageWithLatencyParams extends ExtendedRequestKey {
|
|
72
|
+
imageID: string;
|
|
73
|
+
}
|
|
74
|
+
export interface SendImageParams extends ExtendedRequestKey {
|
|
75
|
+
itemName?: string;
|
|
76
|
+
base64String?: string | null;
|
|
77
|
+
}
|
|
78
|
+
export interface FetchShopTheLookProductsParams {
|
|
79
|
+
uuid: string;
|
|
80
|
+
storeID: number;
|
|
81
|
+
productId: number;
|
|
82
|
+
imageUrl: string;
|
|
83
|
+
cdnCacheKey: string;
|
|
84
|
+
}
|
|
85
|
+
export type ProductsDiscoveryCallback = ({}: {
|
|
86
|
+
action: "ProductsDiscovery" | "Error";
|
|
87
|
+
payload: FetchProductsResponse | string | undefined;
|
|
88
|
+
}) => void;
|
|
89
|
+
export type DiscoveryCallback = ({}: {
|
|
90
|
+
action: "DiscoveryImages" | "Error";
|
|
91
|
+
payload: DiscoveryImage[] | string | undefined;
|
|
92
|
+
}) => void;
|
|
93
|
+
export type ImageSendCallback = ({}: {
|
|
94
|
+
action: "ImageSend" | "Error";
|
|
95
|
+
payload: FetchProductsResponse | string | undefined;
|
|
96
|
+
}) => void;
|
|
97
|
+
export type ProductsByImageCallback = ({}: {
|
|
98
|
+
action: "ImageSearch" | "Error";
|
|
99
|
+
payload: VisualSearchProductResponse | string | undefined;
|
|
100
|
+
}) => void;
|
|
101
|
+
export type ImageSearchCallback = ({}: {
|
|
102
|
+
action: "ImageSearch" | "Error";
|
|
103
|
+
payload: VisualSearchProductResponse | string | undefined;
|
|
104
|
+
}) => void;
|
|
105
|
+
export interface VisualSearchUsedProps extends ExtendedRequestKey {
|
|
106
|
+
imageID: string;
|
|
107
|
+
products: string;
|
|
108
|
+
latency: number;
|
|
109
|
+
count: number;
|
|
110
|
+
ref: AppReference;
|
|
111
|
+
}
|
|
112
|
+
export declare enum AppReference {
|
|
113
|
+
POPUP = "popup",
|
|
114
|
+
WIDGET = "widget",
|
|
115
|
+
PDP = "pdp",
|
|
116
|
+
AUTOCOMPLETE = "ac"
|
|
117
|
+
}
|
|
118
|
+
export declare enum ReportingUPType {
|
|
119
|
+
visualSearchUsed = 21,
|
|
120
|
+
discoveryOpen = 37,
|
|
121
|
+
instagramDiscovery = 35,
|
|
122
|
+
popularDiscovery = 33,
|
|
123
|
+
instagramProductVisit = 36,
|
|
124
|
+
popularProductVisit = 34,
|
|
125
|
+
visualProductVisit = 32,
|
|
126
|
+
discoveryInstagramATC = 38,
|
|
127
|
+
discoveryPopularATC = 39,
|
|
128
|
+
discoveryVisualATC = 40
|
|
129
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReportingUPType = exports.AppReference = exports.ResultType = void 0;
|
|
4
|
+
var ResultType;
|
|
5
|
+
(function (ResultType) {
|
|
6
|
+
ResultType["Instagram"] = "instagram";
|
|
7
|
+
ResultType["Visual"] = "visual";
|
|
8
|
+
ResultType["Popular"] = "popular";
|
|
9
|
+
ResultType["Product"] = "product";
|
|
10
|
+
})(ResultType || (exports.ResultType = ResultType = {}));
|
|
11
|
+
var AppReference;
|
|
12
|
+
(function (AppReference) {
|
|
13
|
+
AppReference["POPUP"] = "popup";
|
|
14
|
+
AppReference["WIDGET"] = "widget";
|
|
15
|
+
AppReference["PDP"] = "pdp";
|
|
16
|
+
AppReference["AUTOCOMPLETE"] = "ac";
|
|
17
|
+
})(AppReference || (exports.AppReference = AppReference = {}));
|
|
18
|
+
var ReportingUPType;
|
|
19
|
+
(function (ReportingUPType) {
|
|
20
|
+
ReportingUPType[ReportingUPType["visualSearchUsed"] = 21] = "visualSearchUsed";
|
|
21
|
+
ReportingUPType[ReportingUPType["discoveryOpen"] = 37] = "discoveryOpen";
|
|
22
|
+
ReportingUPType[ReportingUPType["instagramDiscovery"] = 35] = "instagramDiscovery";
|
|
23
|
+
ReportingUPType[ReportingUPType["popularDiscovery"] = 33] = "popularDiscovery";
|
|
24
|
+
ReportingUPType[ReportingUPType["instagramProductVisit"] = 36] = "instagramProductVisit";
|
|
25
|
+
ReportingUPType[ReportingUPType["popularProductVisit"] = 34] = "popularProductVisit";
|
|
26
|
+
ReportingUPType[ReportingUPType["visualProductVisit"] = 32] = "visualProductVisit";
|
|
27
|
+
ReportingUPType[ReportingUPType["discoveryInstagramATC"] = 38] = "discoveryInstagramATC";
|
|
28
|
+
ReportingUPType[ReportingUPType["discoveryPopularATC"] = 39] = "discoveryPopularATC";
|
|
29
|
+
ReportingUPType[ReportingUPType["discoveryVisualATC"] = 40] = "discoveryVisualATC";
|
|
30
|
+
})(ReportingUPType || (exports.ReportingUPType = ReportingUPType = {}));
|
|
31
|
+
//# sourceMappingURL=visualDiscovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visualDiscovery.js","sourceRoot":"","sources":["../../src/models/visualDiscovery.ts"],"names":[],"mappings":";;;AAQA,IAAY,UAKX;AALD,WAAY,UAAU;IAClB,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;AACvB,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB;AAgHD,IAAY,YAKX;AALD,WAAY,YAAY;IACpB,+BAAe,CAAA;IACf,iCAAiB,CAAA;IACjB,2BAAW,CAAA;IACX,mCAAmB,CAAA;AACvB,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AACD,IAAY,eAWX;AAXD,WAAY,eAAe;IACvB,8EAAqB,CAAA;IACrB,wEAAkB,CAAA;IAClB,kFAAuB,CAAA;IACvB,8EAAqB,CAAA;IACrB,wFAA0B,CAAA;IAC1B,oFAAwB,CAAA;IACxB,kFAAuB,CAAA;IACvB,wFAA0B,CAAA;IAC1B,oFAAwB,CAAA;IACxB,kFAAuB,CAAA;AAC3B,CAAC,EAXW,eAAe,+BAAf,eAAe,QAW1B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ContentSearchProps } from "../../models/content";
|
|
2
|
-
import { SDKUtils } from "../../models/common";
|
|
3
|
-
interface Props extends ContentSearchProps {
|
|
4
|
-
self: SDKUtils;
|
|
5
|
-
}
|
|
6
|
-
export declare const contentSearch: ({ self, page, query, callback }: Props) => void;
|
|
7
|
-
export {};
|
|
1
|
+
import { ContentSearchProps } from "../../models/content";
|
|
2
|
+
import { SDKUtils } from "../../models/common";
|
|
3
|
+
interface Props extends ContentSearchProps {
|
|
4
|
+
self: SDKUtils;
|
|
5
|
+
}
|
|
6
|
+
export declare const contentSearch: ({ self, page, query, callback }: Props) => void;
|
|
7
|
+
export {};
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.contentSearch = void 0;
|
|
4
|
-
var content_1 = require("../../services/content");
|
|
5
|
-
var contentSearch = function (_a) {
|
|
6
|
-
var self = _a.self, _b = _a.page, page = _b === void 0 ? 1 : _b, query = _a.query, callback = _a.callback;
|
|
7
|
-
var _c = self.data, uuid = _c.uuid, storeID = _c.storeID, cdnKey = _c.cdnKey, contentData = _c.contentData;
|
|
8
|
-
var cursor = contentData[page - 1];
|
|
9
|
-
if (!cursor && page !== 1) {
|
|
10
|
-
console.error("Could not access this page at the moment");
|
|
11
|
-
}
|
|
12
|
-
content_1.Content.search({
|
|
13
|
-
uuid: uuid,
|
|
14
|
-
storeID: storeID,
|
|
15
|
-
cdn: cdnKey,
|
|
16
|
-
query: query,
|
|
17
|
-
cursor: cursor !== null && cursor !== void 0 ? cursor : undefined
|
|
18
|
-
}).then(function (response) {
|
|
19
|
-
contentData[page] = response.content_cursor;
|
|
20
|
-
callback({
|
|
21
|
-
action: "content-search",
|
|
22
|
-
payload: {
|
|
23
|
-
content: response.content_results ? serializeContentData(response.content_results) : [],
|
|
24
|
-
page: page,
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
exports.contentSearch = contentSearch;
|
|
30
|
-
var serializeContentData = function (content) {
|
|
31
|
-
return content.map(function (article) {
|
|
32
|
-
var result = {
|
|
33
|
-
title: article[0],
|
|
34
|
-
url: article[1],
|
|
35
|
-
};
|
|
36
|
-
if (article[2]) {
|
|
37
|
-
result["description"] = article[2];
|
|
38
|
-
}
|
|
39
|
-
if (article[4]) {
|
|
40
|
-
result["image"] = article[4];
|
|
41
|
-
}
|
|
42
|
-
return result;
|
|
43
|
-
});
|
|
44
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.contentSearch = void 0;
|
|
4
|
+
var content_1 = require("../../services/content");
|
|
5
|
+
var contentSearch = function (_a) {
|
|
6
|
+
var self = _a.self, _b = _a.page, page = _b === void 0 ? 1 : _b, query = _a.query, callback = _a.callback;
|
|
7
|
+
var _c = self.data, uuid = _c.uuid, storeID = _c.storeID, cdnKey = _c.cdnKey, contentData = _c.contentData;
|
|
8
|
+
var cursor = contentData[page - 1];
|
|
9
|
+
if (!cursor && page !== 1) {
|
|
10
|
+
console.error("Could not access this page at the moment");
|
|
11
|
+
}
|
|
12
|
+
content_1.Content.search({
|
|
13
|
+
uuid: uuid,
|
|
14
|
+
storeID: storeID,
|
|
15
|
+
cdn: cdnKey,
|
|
16
|
+
query: query,
|
|
17
|
+
cursor: cursor !== null && cursor !== void 0 ? cursor : undefined
|
|
18
|
+
}).then(function (response) {
|
|
19
|
+
contentData[page] = response.content_cursor;
|
|
20
|
+
callback({
|
|
21
|
+
action: "content-search",
|
|
22
|
+
payload: {
|
|
23
|
+
content: response.content_results ? serializeContentData(response.content_results) : [],
|
|
24
|
+
page: page,
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
exports.contentSearch = contentSearch;
|
|
30
|
+
var serializeContentData = function (content) {
|
|
31
|
+
return content.map(function (article) {
|
|
32
|
+
var result = {
|
|
33
|
+
title: article[0],
|
|
34
|
+
url: article[1],
|
|
35
|
+
};
|
|
36
|
+
if (article[2]) {
|
|
37
|
+
result["description"] = article[2];
|
|
38
|
+
}
|
|
39
|
+
if (article[4]) {
|
|
40
|
+
result["image"] = article[4];
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sections/contentSearch/index.ts"],"names":[],"mappings":";;;AAEA,kDAA+C;AAMxC,IAAM,aAAa,GAAG,UAAC,EAAwC;QAAvC,IAAI,UAAA,EAAE,YAAQ,EAAR,IAAI,mBAAG,CAAC,KAAA,EAAE,KAAK,WAAA,EAAE,QAAQ,cAAA;IACpD,IAAA,KAAuC,IAAI,CAAC,IAAI,EAA/C,IAAI,UAAA,EAAE,OAAO,aAAA,EAAE,MAAM,YAAA,EAAE,WAAW,iBAAa,CAAC;IAEvD,IAAM,MAAM,GAAG,WAAW,CAAC,IAAI,GAAG,CAAC,CAAW,CAAC;IAE/C,IAAI,CAAC,MAAM,IAAI,IAAI,KAAK,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sections/contentSearch/index.ts"],"names":[],"mappings":";;;AAEA,kDAA+C;AAMxC,IAAM,aAAa,GAAG,UAAC,EAAwC;QAAvC,IAAI,UAAA,EAAE,YAAQ,EAAR,IAAI,mBAAG,CAAC,KAAA,EAAE,KAAK,WAAA,EAAE,QAAQ,cAAA;IACpD,IAAA,KAAuC,IAAI,CAAC,IAAI,EAA/C,IAAI,UAAA,EAAE,OAAO,aAAA,EAAE,MAAM,YAAA,EAAE,WAAW,iBAAa,CAAC;IAEvD,IAAM,MAAM,GAAG,WAAW,CAAC,IAAI,GAAG,CAAC,CAAW,CAAC;IAE/C,IAAI,CAAC,MAAM,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IAED,iBAAO,CAAC,MAAM,CAAC;QACX,IAAI,MAAA;QAAE,OAAO,SAAA;QAAE,GAAG,EAAE,MAAM;QAAE,KAAK,OAAA;QAAE,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,SAAS;KACjE,CAAC,CAAC,IAAI,CAAC,UAAA,QAAQ;QACZ,WAAW,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC;QAE5C,QAAQ,CAAC;YACL,MAAM,EAAE,gBAAgB;YACxB,OAAO,EAAE;gBACL,OAAO,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,oBAAoB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE;gBACvF,IAAI,MAAA;aACP;SACJ,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACN,CAAC,CAAA;AAtBY,QAAA,aAAa,iBAsBzB;AAED,IAAM,oBAAoB,GAAG,UAAC,OAAsB;IAChD,OAAO,OAAO,CAAC,GAAG,CAAC,UAAC,OAAO;QACvB,IAAI,MAAM,GAAkB;YACxB,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;YACjB,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;SAClB,CAAC;QAEF,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YACb,MAAM,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;QACtC,CAAC;QAED,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YACb,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;QAChC,CAAC;QAED,OAAO,MAAM,CAAA;IACjB,CAAC,CAAC,CAAC;AACP,CAAC,CAAA"}
|