fast-simon-sdk 1.6.8 → 1.6.10

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 (165) hide show
  1. package/lib/config.d.ts +25 -25
  2. package/lib/config.js +30 -30
  3. package/lib/index.d.ts +3 -3
  4. package/lib/index.js +72 -72
  5. package/lib/index.js.map +1 -1
  6. package/lib/models/autocomplete.d.ts +73 -73
  7. package/lib/models/autocomplete.js +2 -2
  8. package/lib/models/common.d.ts +267 -267
  9. package/lib/models/common.js +65 -65
  10. package/lib/models/common.js.map +1 -1
  11. package/lib/models/content.d.ts +37 -37
  12. package/lib/models/content.js +2 -2
  13. package/lib/models/events.d.ts +113 -113
  14. package/lib/models/events.js +2 -2
  15. package/lib/models/exports.d.ts +6 -6
  16. package/lib/models/exports.js +5 -5
  17. package/lib/models/fullTextSearch.d.ts +130 -130
  18. package/lib/models/fullTextSearch.js +17 -17
  19. package/lib/models/fullTextSearch.js.map +1 -1
  20. package/lib/models/lookAlikeProductRecommendation.d.ts +8 -8
  21. package/lib/models/lookAlikeProductRecommendation.js +2 -2
  22. package/lib/models/productsInventory.d.ts +10 -10
  23. package/lib/models/productsInventory.js +2 -2
  24. package/lib/models/related.d.ts +35 -35
  25. package/lib/models/related.js +2 -2
  26. package/lib/models/smartCollections.d.ts +94 -94
  27. package/lib/models/smartCollections.js +2 -2
  28. package/lib/models/visualDiscovery.d.ts +129 -129
  29. package/lib/models/visualDiscovery.js +30 -30
  30. package/lib/models/visualDiscovery.js.map +1 -1
  31. package/lib/sections/contentSearch/index.d.ts +7 -7
  32. package/lib/sections/contentSearch/index.js +44 -44
  33. package/lib/sections/contentSearch/index.js.map +1 -1
  34. package/lib/sections/enums/index.d.ts +47 -47
  35. package/lib/sections/enums/index.js +50 -50
  36. package/lib/sections/eventReporter/index.d.ts +10 -10
  37. package/lib/sections/eventReporter/index.js +628 -628
  38. package/lib/sections/eventReporter/index.js.map +1 -1
  39. package/lib/sections/eventReporter/utils.d.ts +9 -9
  40. package/lib/sections/eventReporter/utils.js +31 -31
  41. package/lib/sections/eventReporter/utils.js.map +1 -1
  42. package/lib/sections/fullTextSearch/index.d.ts +6 -6
  43. package/lib/sections/fullTextSearch/index.js +178 -178
  44. package/lib/sections/fullTextSearch/index.js.map +1 -1
  45. package/lib/sections/fullTextSearch/utils.d.ts +17 -17
  46. package/lib/sections/fullTextSearch/utils.js +185 -181
  47. package/lib/sections/fullTextSearch/utils.js.map +1 -1
  48. package/lib/sections/index.d.ts +3 -3
  49. package/lib/sections/index.js +432 -434
  50. package/lib/sections/index.js.map +1 -1
  51. package/lib/sections/initialization/index.d.ts +8 -8
  52. package/lib/sections/initialization/index.js +155 -150
  53. package/lib/sections/initialization/index.js.map +1 -1
  54. package/lib/sections/initialization/utils.d.ts +11 -11
  55. package/lib/sections/initialization/utils.js +200 -200
  56. package/lib/sections/initialization/utils.js.map +1 -1
  57. package/lib/sections/instantSearch/index.d.ts +6 -6
  58. package/lib/sections/instantSearch/index.js +66 -66
  59. package/lib/sections/instantSearch/index.js.map +1 -1
  60. package/lib/sections/instantSearch/utils.d.ts +21 -21
  61. package/lib/sections/instantSearch/utils.js +232 -232
  62. package/lib/sections/instantSearch/utils.js.map +1 -1
  63. package/lib/sections/landingPage/index.d.ts +6 -6
  64. package/lib/sections/landingPage/index.js +95 -95
  65. package/lib/sections/landingPage/index.js.map +1 -1
  66. package/lib/sections/landingPage/utils.d.ts +14 -14
  67. package/lib/sections/landingPage/utils.js +96 -96
  68. package/lib/sections/landingPage/utils.js.map +1 -1
  69. package/lib/sections/lookAlikeProductRecommendation/index.d.ts +6 -6
  70. package/lib/sections/lookAlikeProductRecommendation/index.js +23 -23
  71. package/lib/sections/recommendations/index.d.ts +10 -10
  72. package/lib/sections/recommendations/index.js +95 -95
  73. package/lib/sections/recommendations/index.js.map +1 -1
  74. package/lib/sections/recommendations/utils.d.ts +6 -6
  75. package/lib/sections/recommendations/utils.js +82 -82
  76. package/lib/sections/recommendations/utils.js.map +1 -1
  77. package/lib/sections/smartCollections/index.d.ts +6 -6
  78. package/lib/sections/smartCollections/index.js +169 -169
  79. package/lib/sections/smartCollections/index.js.map +1 -1
  80. package/lib/sections/smartCollections/utils.d.ts +41 -41
  81. package/lib/sections/smartCollections/utils.js +286 -281
  82. package/lib/sections/smartCollections/utils.js.map +1 -1
  83. package/lib/sections/visualDiscovery/index.d.ts +22 -22
  84. package/lib/sections/visualDiscovery/index.js +261 -265
  85. package/lib/sections/visualDiscovery/index.js.map +1 -1
  86. package/lib/services/autocomplete.d.ts +24 -24
  87. package/lib/services/autocomplete.js +50 -50
  88. package/lib/services/common.d.ts +35 -35
  89. package/lib/services/common.js +94 -94
  90. package/lib/services/content.d.ts +4 -4
  91. package/lib/services/content.js +25 -25
  92. package/lib/services/fullTextSearch.d.ts +4 -4
  93. package/lib/services/fullTextSearch.js +87 -87
  94. package/lib/services/fullTextSearch.js.map +1 -1
  95. package/lib/services/landingPage.d.ts +21 -21
  96. package/lib/services/landingPage.js +44 -44
  97. package/lib/services/lookAlikeProductRecommendation.d.ts +13 -13
  98. package/lib/services/lookAlikeProductRecommendation.js +23 -23
  99. package/lib/services/related.d.ts +48 -48
  100. package/lib/services/related.js +114 -114
  101. package/lib/services/related.js.map +1 -1
  102. package/lib/services/reporting.d.ts +80 -80
  103. package/lib/services/reporting.js +258 -258
  104. package/lib/services/reporting.js.map +1 -1
  105. package/lib/services/smartCollections.d.ts +5 -5
  106. package/lib/services/smartCollections.js +93 -93
  107. package/lib/services/smartCollections.js.map +1 -1
  108. package/lib/services/utils.d.ts +5 -5
  109. package/lib/services/utils.js +25 -25
  110. package/lib/services/utils.js.map +1 -1
  111. package/lib/services/visualDiscovery.d.ts +9 -9
  112. package/lib/services/visualDiscovery.js +166 -170
  113. package/lib/services/visualDiscovery.js.map +1 -1
  114. package/lib/utils/ABTesting.d.ts +2 -2
  115. package/lib/utils/ABTesting.js +27 -28
  116. package/lib/utils/ABTesting.js.map +1 -1
  117. package/lib/utils/API.d.ts +19 -19
  118. package/lib/utils/API.js +81 -81
  119. package/lib/utils/API.js.map +1 -1
  120. package/lib/utils/ArrayUtils.d.ts +2 -2
  121. package/lib/utils/ArrayUtils.js +16 -17
  122. package/lib/utils/ArrayUtils.js.map +1 -1
  123. package/lib/utils/bindingBoxes.d.ts +23 -23
  124. package/lib/utils/bindingBoxes.js +88 -89
  125. package/lib/utils/bindingBoxes.js.map +1 -1
  126. package/lib/utils/cookies.d.ts +13 -13
  127. package/lib/utils/cookies.js +50 -50
  128. package/lib/utils/debug.d.ts +4 -4
  129. package/lib/utils/debug.js +31 -31
  130. package/lib/utils/debug.js.map +1 -1
  131. package/lib/utils/duplicationsHandler.d.ts +19 -0
  132. package/lib/utils/duplicationsHandler.js +70 -0
  133. package/lib/utils/duplicationsHandler.js.map +1 -0
  134. package/lib/utils/filtersPersonalization.d.ts +3 -3
  135. package/lib/utils/filtersPersonalization.js +39 -39
  136. package/lib/utils/filtersPersonalization.js.map +1 -1
  137. package/lib/utils/image.d.ts +6 -6
  138. package/lib/utils/image.js +153 -153
  139. package/lib/utils/image.js.map +1 -1
  140. package/lib/utils/klaviyo.js +1 -1
  141. package/lib/utils/location.d.ts +1 -1
  142. package/lib/utils/location.js +11 -11
  143. package/lib/utils/location.js.map +1 -1
  144. package/lib/utils/mappingUtil.d.ts +4 -4
  145. package/lib/utils/mappingUtil.js +16 -16
  146. package/lib/utils/options.d.ts +23 -23
  147. package/lib/utils/options.js +16 -16
  148. package/lib/utils/personalization.d.ts +2 -2
  149. package/lib/utils/personalization.js +20 -20
  150. package/lib/utils/personalization.js.map +1 -1
  151. package/lib/utils/segments.d.ts +2 -2
  152. package/lib/utils/segments.js +19 -20
  153. package/lib/utils/segments.js.map +1 -1
  154. package/lib/utils/shopifyMarkets.d.ts +3 -3
  155. package/lib/utils/shopifyMarkets.js +12 -12
  156. package/lib/utils/sortUtil.d.ts +1 -1
  157. package/lib/utils/sortUtil.js +24 -24
  158. package/lib/utils/sortUtil.js.map +1 -1
  159. package/lib/utils/updateRecentSearches.d.ts +2 -2
  160. package/lib/utils/updateRecentSearches.js +56 -57
  161. package/lib/utils/updateRecentSearches.js.map +1 -1
  162. package/lib/utils/validation.d.ts +5 -5
  163. package/lib/utils/validation.js +46 -46
  164. package/lib/utils/validation.js.map +1 -1
  165. package/package.json +3 -2
@@ -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=lookAlikeProductRecommendation.js.map
@@ -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
@@ -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 {};
@@ -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,94 +1,94 @@
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
+ 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
@@ -1,129 +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
- }
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
+ }
@@ -1,31 +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 || (exports.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 || (exports.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 || (exports.ReportingUPType = {}));
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
31
  //# sourceMappingURL=visualDiscovery.js.map
@@ -1 +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,GAAV,kBAAU,KAAV,kBAAU,QAKrB;AAgHD,IAAY,YAKX;AALD,WAAY,YAAY;IACpB,+BAAe,CAAA;IACf,iCAAiB,CAAA;IACjB,2BAAW,CAAA;IACX,mCAAmB,CAAA;AACvB,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,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,GAAf,uBAAe,KAAf,uBAAe,QAW1B"}
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 {};