fast-simon-sdk 1.6.8 → 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 (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 +150 -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,267 +1,267 @@
1
- import { AutocompleteCallback, DashboardKeys, FastCategory, FastTurbolinks, PopularSearch } from "./autocomplete";
2
- import { Facet, fullTextCallback, fullTextFacetsCallback, fullTextProductsCallback, Narrow, Product, SortBy } from "./fullTextSearch";
3
- import { CategoryAncestor, RelatedCategory, smartCollectionsCallback, smartCollectionsResults } from "./smartCollections";
4
- import { Report } from "./events";
5
- import { Specs, SRC_TYPES, WidgetCallback } from "./related";
6
- import { ContentSearchProps } from "./content";
7
- import { inventoryCallback } from "./productsInventory";
8
- import { AppReference, DiscoveryCallback, ImageSearchCallback, ImageSendCallback, ProductsByImageCallback, ProductsDiscoveryCallback, ResultType } from "./visualDiscovery";
9
- export type AppType = "SPA" | "MPA";
10
- export type SDKStatus = "loading" | "error" | "ready";
11
- type ContentPage = number;
12
- type ContentCursor = string;
13
- export interface SDKData {
14
- uuid: string;
15
- storeID: number;
16
- cdnKey: number;
17
- sessionToken: SessionToken;
18
- userToken: string;
19
- cartToken: string;
20
- dashboard: DashboardKeys;
21
- popularProducts: Product[];
22
- categories: FastCategory[];
23
- turbolinks: FastTurbolinks[];
24
- contentData: Record<ContentPage, ContentCursor>;
25
- withProductVariants?: boolean;
26
- withAttributes?: boolean;
27
- popularSearches?: PopularSearch[];
28
- abTestingVariations?: {
29
- [key: string]: {
30
- [key: string]: object;
31
- };
32
- };
33
- personalizedProducts?: string | undefined;
34
- collectionsPersonalization?: CollectionsPersonalization;
35
- searchPersonalization?: boolean;
36
- }
37
- export interface AutocompleteResults {
38
- totalResults: number;
39
- categories?: FastCategory[];
40
- products: Product[];
41
- turbolinks?: FastTurbolinks[];
42
- popularSearches: PopularSearch[];
43
- query: string;
44
- }
45
- export interface FullTextResults {
46
- query: string;
47
- products?: Product[];
48
- facets?: Facet[];
49
- totalResults: number;
50
- narrow?: Narrow[];
51
- sortBy?: SortBy;
52
- isNoResults?: boolean;
53
- page?: number;
54
- pageCount?: number;
55
- ancestors?: CategoryAncestor[];
56
- avoidPrefixList?: string[];
57
- merch?: any;
58
- turbolink?: FastTurbolinks;
59
- relatedCategories?: RelatedCategory[];
60
- relatedResults?: boolean;
61
- }
62
- export interface LandingPageResults {
63
- slug: string;
64
- products: Product[];
65
- facets?: Facet[];
66
- totalResults: number;
67
- narrow?: Narrow[];
68
- sortBy?: SortBy;
69
- isNoResults?: boolean;
70
- page?: number;
71
- pageCount?: number;
72
- ancestors?: CategoryAncestor[];
73
- avoidPrefixList?: string[];
74
- bannerHTML?: string;
75
- title?: string;
76
- }
77
- export interface SDKTemp {
78
- autocomplete: AutocompleteResults;
79
- fullTextSearch: FullTextResults;
80
- smartCollections: smartCollectionsResults;
81
- landingPage: LandingPageResults;
82
- }
83
- export interface initProps {
84
- storeID: number;
85
- uuid: string;
86
- type: AppType;
87
- onReady?: VoidFunction;
88
- cartToken?: string;
89
- }
90
- export interface instantSearchProps {
91
- query: string;
92
- callback: AutocompleteCallback;
93
- withAttributes?: boolean;
94
- withCategories?: boolean;
95
- withProductTypes?: boolean;
96
- }
97
- export interface FullTextSearchProps {
98
- term: string;
99
- page?: number;
100
- productsPerPage?: number;
101
- sortBy?: SortBy;
102
- narrowBy?: Narrow[];
103
- facets?: boolean;
104
- callback: fullTextCallback;
105
- withAttributes?: boolean;
106
- searchWithinSearch?: string;
107
- infiniteScrollPage?: number;
108
- segments?: string[];
109
- withProductTypes?: boolean;
110
- disableMerchandising?: boolean;
111
- disableStrategies?: boolean;
112
- disableMerchandisingRules?: boolean;
113
- onProductsLoaded?: fullTextProductsCallback;
114
- onFacetsLoaded?: fullTextFacetsCallback;
115
- disableTurbolinks?: boolean;
116
- }
117
- export type LandingPageCallback = ({}: {
118
- action: "products" | "facets and products";
119
- payload: LandingPageResults;
120
- }) => void;
121
- export interface LandingPageProps {
122
- slug: string;
123
- page?: number;
124
- productsPerPage?: number;
125
- sortBy?: SortBy;
126
- narrowBy?: Narrow[];
127
- facets?: boolean;
128
- callback: LandingPageCallback;
129
- withAttributes?: boolean;
130
- }
131
- export interface smartCollectionsProps {
132
- categoryID: string;
133
- page?: number;
134
- productsPerPage?: number;
135
- sortBy?: SortBy;
136
- narrowBy?: Narrow[];
137
- facets?: boolean;
138
- callback: smartCollectionsCallback;
139
- withAttributes?: boolean;
140
- searchWithinSearch?: string;
141
- infiniteScrollPage?: number;
142
- segments?: string[];
143
- inventoryCallback?: inventoryCallback;
144
- access_token?: string;
145
- shop_url?: string;
146
- withProductTypes?: boolean;
147
- disableMerchandising?: boolean;
148
- disableStrategies?: boolean;
149
- disableMerchandisingRules?: boolean;
150
- onProductsLoaded?: smartCollectionsCallback;
151
- onFacetsLoaded?: smartCollectionsCallback;
152
- disableTurbolinks: boolean;
153
- }
154
- export interface LookALikeProps {
155
- viewedProductId: string;
156
- callback: (response: LookALikeResponse) => void;
157
- }
158
- export interface LookALikeResponse {
159
- action: "look a like";
160
- payload: Product[];
161
- }
162
- export interface RelatedProps {
163
- productID: string;
164
- specs: Specs[];
165
- callback: WidgetCallback;
166
- recent?: string[];
167
- withAttributes?: boolean;
168
- src?: SRC_TYPES;
169
- }
170
- export interface RelatedWidgetProps {
171
- productID: string;
172
- widgetsIDS: string[];
173
- callback: WidgetCallback;
174
- recent?: string[];
175
- withAttributes?: boolean;
176
- src?: SRC_TYPES;
177
- }
178
- export interface GetProductsProps {
179
- productIds: string[];
180
- callback?: (products: Product[]) => void;
181
- }
182
- export interface SDKUtils {
183
- type: AppType;
184
- status: SDKStatus;
185
- data: SDKData;
186
- temp: SDKTemp;
187
- callbacks?: (() => any)[];
188
- fsGridCurrentResponse: {
189
- status: "loading" | "done";
190
- data: Record<string, any>;
191
- } | Record<string, any>;
192
- }
193
- export interface PopularProductsProps {
194
- withAttributes?: boolean;
195
- }
196
- export interface SDK {
197
- initialization: ({}: initProps) => void;
198
- instantSearch: ({}: instantSearchProps) => void;
199
- fullTextSearch: ({}: FullTextSearchProps) => void;
200
- smartCollections: ({}: smartCollectionsProps) => void;
201
- landingPage: ({}: LandingPageProps) => void;
202
- lookAlikeProductRecommendation: ({}: LookALikeProps) => void;
203
- productRecommendation: ({}: RelatedProps) => void;
204
- contentSearch: ({}: ContentSearchProps) => void;
205
- event: ({}: Report<any>) => void;
206
- getAllCategories: (callback?: (categories: FastCategory[] | null) => void) => Promise<FastCategory[] | null>;
207
- getAllPopularProducts: (callback?: (products: Product[] | null) => void, withAttributes?: boolean) => Promise<Product[] | null>;
208
- getProducts: ({}: GetProductsProps) => Promise<Product[]>;
209
- getSetup: ({}: {
210
- keys: (Partial<keyof DashboardKeys>)[];
211
- callback: (keys: Partial<DashboardKeys>) => void;
212
- }) => void;
213
- productRecommendationByWidget: ({}: RelatedWidgetProps) => void;
214
- productsByDiscovery: ({}: ProductsDiscoveryInternalProps) => void;
215
- discoveryImages: ({}: DiscoveryInternalProps) => void;
216
- sendImage: ({}: ImageSendInternalProps) => void;
217
- ProductsByImage: ({}: ProductsByImageInternalProps) => void;
218
- visualSearch: ({}: ImageSearchInternalProps) => void;
219
- }
220
- export declare const defaultSDKTemp: SDKTemp;
221
- export declare const defaultDashboardData: DashboardKeys;
222
- export declare const defaultSDKData: SDKData;
223
- export interface SessionToken {
224
- start: number;
225
- lastActive: number;
226
- }
227
- export interface BCTokenResponse {
228
- id: string;
229
- }
230
- export interface ShopifyTokenResponse {
231
- token: string;
232
- }
233
- export type Platfrom = "Shopify" | "Bigcommerce" | "";
234
- export interface ProductsDiscoveryInternalProps {
235
- imageID: string;
236
- mode: ResultType;
237
- callback: ProductsDiscoveryCallback;
238
- }
239
- export interface DiscoveryInternalProps {
240
- mode: ResultType;
241
- callback: DiscoveryCallback;
242
- }
243
- export interface ImageSendInternalProps {
244
- fileData: File;
245
- itemName: string | undefined;
246
- callback: ImageSendCallback;
247
- }
248
- export interface ProductsByImageInternalProps {
249
- imageID: string;
250
- callback: ProductsByImageCallback;
251
- reference?: AppReference;
252
- imageBase64?: string | null;
253
- }
254
- export interface ImageSearchInternalProps {
255
- fileData: File;
256
- itemName: string | undefined;
257
- callback: ImageSearchCallback;
258
- }
259
- export interface CollectionsPersonalization {
260
- active: boolean;
261
- avoidProducts: string[] | null;
262
- avoidCategories: string[];
263
- disableCategories: string[];
264
- recencyLimit: number;
265
- maxRecencyLimit: number;
266
- }
267
- export {};
1
+ import { AutocompleteCallback, DashboardKeys, FastCategory, FastTurbolinks, PopularSearch } from "./autocomplete";
2
+ import { Facet, fullTextCallback, fullTextFacetsCallback, fullTextProductsCallback, Narrow, Product, SortBy } from "./fullTextSearch";
3
+ import { CategoryAncestor, RelatedCategory, smartCollectionsCallback, smartCollectionsResults } from "./smartCollections";
4
+ import { Report } from "./events";
5
+ import { Specs, SRC_TYPES, WidgetCallback } from "./related";
6
+ import { ContentSearchProps } from "./content";
7
+ import { inventoryCallback } from "./productsInventory";
8
+ import { AppReference, DiscoveryCallback, ImageSearchCallback, ImageSendCallback, ProductsByImageCallback, ProductsDiscoveryCallback, ResultType } from "./visualDiscovery";
9
+ export type AppType = "SPA" | "MPA";
10
+ export type SDKStatus = "loading" | "error" | "ready";
11
+ type ContentPage = number;
12
+ type ContentCursor = string;
13
+ export interface SDKData {
14
+ uuid: string;
15
+ storeID: number;
16
+ cdnKey: number;
17
+ sessionToken: SessionToken;
18
+ userToken: string;
19
+ cartToken: string;
20
+ dashboard: DashboardKeys;
21
+ popularProducts: Product[];
22
+ categories: FastCategory[];
23
+ turbolinks: FastTurbolinks[];
24
+ contentData: Record<ContentPage, ContentCursor>;
25
+ withProductVariants?: boolean;
26
+ withAttributes?: boolean;
27
+ popularSearches?: PopularSearch[];
28
+ abTestingVariations?: {
29
+ [key: string]: {
30
+ [key: string]: object;
31
+ };
32
+ };
33
+ personalizedProducts?: string | undefined;
34
+ collectionsPersonalization?: CollectionsPersonalization;
35
+ searchPersonalization?: boolean;
36
+ }
37
+ export interface AutocompleteResults {
38
+ totalResults: number;
39
+ categories?: FastCategory[];
40
+ products: Product[];
41
+ turbolinks?: FastTurbolinks[];
42
+ popularSearches: PopularSearch[];
43
+ query: string;
44
+ }
45
+ export interface FullTextResults {
46
+ query: string;
47
+ products?: Product[];
48
+ facets?: Facet[];
49
+ totalResults: number;
50
+ narrow?: Narrow[];
51
+ sortBy?: SortBy;
52
+ isNoResults?: boolean;
53
+ page?: number;
54
+ pageCount?: number;
55
+ ancestors?: CategoryAncestor[];
56
+ avoidPrefixList?: string[];
57
+ merch?: any;
58
+ turbolink?: FastTurbolinks;
59
+ relatedCategories?: RelatedCategory[];
60
+ relatedResults?: boolean;
61
+ }
62
+ export interface LandingPageResults {
63
+ slug: string;
64
+ products: Product[];
65
+ facets?: Facet[];
66
+ totalResults: number;
67
+ narrow?: Narrow[];
68
+ sortBy?: SortBy;
69
+ isNoResults?: boolean;
70
+ page?: number;
71
+ pageCount?: number;
72
+ ancestors?: CategoryAncestor[];
73
+ avoidPrefixList?: string[];
74
+ bannerHTML?: string;
75
+ title?: string;
76
+ }
77
+ export interface SDKTemp {
78
+ autocomplete: AutocompleteResults;
79
+ fullTextSearch: FullTextResults;
80
+ smartCollections: smartCollectionsResults;
81
+ landingPage: LandingPageResults;
82
+ }
83
+ export interface initProps {
84
+ storeID: number;
85
+ uuid: string;
86
+ type: AppType;
87
+ onReady?: VoidFunction;
88
+ cartToken?: string;
89
+ }
90
+ export interface instantSearchProps {
91
+ query: string;
92
+ callback: AutocompleteCallback;
93
+ withAttributes?: boolean;
94
+ withCategories?: boolean;
95
+ withProductTypes?: boolean;
96
+ }
97
+ export interface FullTextSearchProps {
98
+ term: string;
99
+ page?: number;
100
+ productsPerPage?: number;
101
+ sortBy?: SortBy;
102
+ narrowBy?: Narrow[];
103
+ facets?: boolean;
104
+ callback: fullTextCallback;
105
+ withAttributes?: boolean;
106
+ searchWithinSearch?: string;
107
+ infiniteScrollPage?: number;
108
+ segments?: string[];
109
+ withProductTypes?: boolean;
110
+ disableMerchandising?: boolean;
111
+ disableStrategies?: boolean;
112
+ disableMerchandisingRules?: boolean;
113
+ onProductsLoaded?: fullTextProductsCallback;
114
+ onFacetsLoaded?: fullTextFacetsCallback;
115
+ disableTurbolinks?: boolean;
116
+ }
117
+ export type LandingPageCallback = ({}: {
118
+ action: "products" | "facets and products";
119
+ payload: LandingPageResults;
120
+ }) => void;
121
+ export interface LandingPageProps {
122
+ slug: string;
123
+ page?: number;
124
+ productsPerPage?: number;
125
+ sortBy?: SortBy;
126
+ narrowBy?: Narrow[];
127
+ facets?: boolean;
128
+ callback: LandingPageCallback;
129
+ withAttributes?: boolean;
130
+ }
131
+ export interface smartCollectionsProps {
132
+ categoryID: string;
133
+ page?: number;
134
+ productsPerPage?: number;
135
+ sortBy?: SortBy;
136
+ narrowBy?: Narrow[];
137
+ facets?: boolean;
138
+ callback: smartCollectionsCallback;
139
+ withAttributes?: boolean;
140
+ searchWithinSearch?: string;
141
+ infiniteScrollPage?: number;
142
+ segments?: string[];
143
+ inventoryCallback?: inventoryCallback;
144
+ access_token?: string;
145
+ shop_url?: string;
146
+ withProductTypes?: boolean;
147
+ disableMerchandising?: boolean;
148
+ disableStrategies?: boolean;
149
+ disableMerchandisingRules?: boolean;
150
+ onProductsLoaded?: smartCollectionsCallback;
151
+ onFacetsLoaded?: smartCollectionsCallback;
152
+ disableTurbolinks: boolean;
153
+ }
154
+ export interface LookALikeProps {
155
+ viewedProductId: string;
156
+ callback: (response: LookALikeResponse) => void;
157
+ }
158
+ export interface LookALikeResponse {
159
+ action: "look a like";
160
+ payload: Product[];
161
+ }
162
+ export interface RelatedProps {
163
+ productID: string;
164
+ specs: Specs[];
165
+ callback: WidgetCallback;
166
+ recent?: string[];
167
+ withAttributes?: boolean;
168
+ src?: SRC_TYPES;
169
+ }
170
+ export interface RelatedWidgetProps {
171
+ productID: string;
172
+ widgetsIDS: string[];
173
+ callback: WidgetCallback;
174
+ recent?: string[];
175
+ withAttributes?: boolean;
176
+ src?: SRC_TYPES;
177
+ }
178
+ export interface GetProductsProps {
179
+ productIds: string[];
180
+ callback?: (products: Product[]) => void;
181
+ }
182
+ export interface SDKUtils {
183
+ type: AppType;
184
+ status: SDKStatus;
185
+ data: SDKData;
186
+ temp: SDKTemp;
187
+ callbacks?: (() => any)[];
188
+ fsGridCurrentResponse: {
189
+ status: "loading" | "done";
190
+ data: Record<string, any>;
191
+ } | Record<string, any>;
192
+ }
193
+ export interface PopularProductsProps {
194
+ withAttributes?: boolean;
195
+ }
196
+ export interface SDK {
197
+ initialization: ({}: initProps) => void;
198
+ instantSearch: ({}: instantSearchProps) => void;
199
+ fullTextSearch: ({}: FullTextSearchProps) => void;
200
+ smartCollections: ({}: smartCollectionsProps) => void;
201
+ landingPage: ({}: LandingPageProps) => void;
202
+ lookAlikeProductRecommendation: ({}: LookALikeProps) => void;
203
+ productRecommendation: ({}: RelatedProps) => void;
204
+ contentSearch: ({}: ContentSearchProps) => void;
205
+ event: ({}: Report<any>) => void;
206
+ getAllCategories: (callback?: (categories: FastCategory[] | null) => void) => Promise<FastCategory[] | null>;
207
+ getAllPopularProducts: (callback?: (products: Product[] | null) => void, withAttributes?: boolean) => Promise<Product[] | null>;
208
+ getProducts: ({}: GetProductsProps) => Promise<Product[]>;
209
+ getSetup: ({}: {
210
+ keys: (Partial<keyof DashboardKeys>)[];
211
+ callback: (keys: Partial<DashboardKeys>) => void;
212
+ }) => void;
213
+ productRecommendationByWidget: ({}: RelatedWidgetProps) => void;
214
+ productsByDiscovery: ({}: ProductsDiscoveryInternalProps) => void;
215
+ discoveryImages: ({}: DiscoveryInternalProps) => void;
216
+ sendImage: ({}: ImageSendInternalProps) => void;
217
+ ProductsByImage: ({}: ProductsByImageInternalProps) => void;
218
+ visualSearch: ({}: ImageSearchInternalProps) => void;
219
+ }
220
+ export declare const defaultSDKTemp: SDKTemp;
221
+ export declare const defaultDashboardData: DashboardKeys;
222
+ export declare const defaultSDKData: SDKData;
223
+ export interface SessionToken {
224
+ start: number;
225
+ lastActive: number;
226
+ }
227
+ export interface BCTokenResponse {
228
+ id: string;
229
+ }
230
+ export interface ShopifyTokenResponse {
231
+ token: string;
232
+ }
233
+ export type Platfrom = "Shopify" | "Bigcommerce" | "";
234
+ export interface ProductsDiscoveryInternalProps {
235
+ imageID: string;
236
+ mode: ResultType;
237
+ callback: ProductsDiscoveryCallback;
238
+ }
239
+ export interface DiscoveryInternalProps {
240
+ mode: ResultType;
241
+ callback: DiscoveryCallback;
242
+ }
243
+ export interface ImageSendInternalProps {
244
+ fileData: File;
245
+ itemName: string | undefined;
246
+ callback: ImageSendCallback;
247
+ }
248
+ export interface ProductsByImageInternalProps {
249
+ imageID: string;
250
+ callback: ProductsByImageCallback;
251
+ reference?: AppReference;
252
+ imageBase64?: string | null;
253
+ }
254
+ export interface ImageSearchInternalProps {
255
+ fileData: File;
256
+ itemName: string | undefined;
257
+ callback: ImageSearchCallback;
258
+ }
259
+ export interface CollectionsPersonalization {
260
+ active: boolean;
261
+ avoidProducts: string[] | null;
262
+ avoidCategories: string[];
263
+ disableCategories: string[];
264
+ recencyLimit: number;
265
+ maxRecencyLimit: number;
266
+ }
267
+ export {};
@@ -1,66 +1,66 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultSDKData = exports.defaultDashboardData = exports.defaultSDKTemp = void 0;
4
- var config_1 = require("../config");
5
- exports.defaultSDKTemp = {
6
- autocomplete: {
7
- totalResults: 0,
8
- categories: [],
9
- popularSearches: [],
10
- products: [],
11
- turbolinks: [],
12
- query: "",
13
- },
14
- fullTextSearch: {
15
- query: "",
16
- products: [],
17
- facets: [],
18
- totalResults: 0
19
- },
20
- smartCollections: {
21
- ancestors: [],
22
- categoryID: "",
23
- products: [],
24
- facets: [],
25
- totalResults: 0,
26
- name: ""
27
- },
28
- landingPage: {
29
- slug: "",
30
- products: [],
31
- facets: [],
32
- totalResults: 0
33
- }
34
- };
35
- exports.defaultDashboardData = {
36
- site_url: "",
37
- disable_categories_suggestions: false,
38
- max_popular_categories_suggestions: 0,
39
- max_popular_searches_suggestions: 0,
40
- max_product_suggestions: 0,
41
- using_isp_api: true,
42
- isp_personalized_search_enabled: false,
43
- products_per_page: 20,
44
- categories_products_per_page: 20,
45
- show_popular_products_on_focus: false,
46
- is_content: false,
47
- isp_personalized_collection_enabled: false
48
- };
49
- exports.defaultSDKData = {
50
- storeID: 0,
51
- uuid: "",
52
- cdnKey: Date.now(),
53
- sessionToken: {
54
- lastActive: Date.now(),
55
- start: Date.now()
56
- },
57
- userToken: localStorage.getItem(config_1.USER_SESSION_TOKEN_LS_KEY) || '',
58
- cartToken: "",
59
- dashboard: exports.defaultDashboardData,
60
- popularProducts: [],
61
- categories: [],
62
- turbolinks: [],
63
- contentData: { 0: "" },
64
- abTestingVariations: {}
65
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defaultSDKData = exports.defaultDashboardData = exports.defaultSDKTemp = void 0;
4
+ var config_1 = require("../config");
5
+ exports.defaultSDKTemp = {
6
+ autocomplete: {
7
+ totalResults: 0,
8
+ categories: [],
9
+ popularSearches: [],
10
+ products: [],
11
+ turbolinks: [],
12
+ query: "",
13
+ },
14
+ fullTextSearch: {
15
+ query: "",
16
+ products: [],
17
+ facets: [],
18
+ totalResults: 0
19
+ },
20
+ smartCollections: {
21
+ ancestors: [],
22
+ categoryID: "",
23
+ products: [],
24
+ facets: [],
25
+ totalResults: 0,
26
+ name: ""
27
+ },
28
+ landingPage: {
29
+ slug: "",
30
+ products: [],
31
+ facets: [],
32
+ totalResults: 0
33
+ }
34
+ };
35
+ exports.defaultDashboardData = {
36
+ site_url: "",
37
+ disable_categories_suggestions: false,
38
+ max_popular_categories_suggestions: 0,
39
+ max_popular_searches_suggestions: 0,
40
+ max_product_suggestions: 0,
41
+ using_isp_api: true,
42
+ isp_personalized_search_enabled: false,
43
+ products_per_page: 20,
44
+ categories_products_per_page: 20,
45
+ show_popular_products_on_focus: false,
46
+ is_content: false,
47
+ isp_personalized_collection_enabled: false
48
+ };
49
+ exports.defaultSDKData = {
50
+ storeID: 0,
51
+ uuid: "",
52
+ cdnKey: Date.now(),
53
+ sessionToken: {
54
+ lastActive: Date.now(),
55
+ start: Date.now()
56
+ },
57
+ userToken: localStorage.getItem(config_1.USER_SESSION_TOKEN_LS_KEY) || '', // initialize from LS for direct reports
58
+ cartToken: "",
59
+ dashboard: exports.defaultDashboardData,
60
+ popularProducts: [],
61
+ categories: [],
62
+ turbolinks: [],
63
+ contentData: { 0: "" },
64
+ abTestingVariations: {}
65
+ };
66
66
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/models/common.ts"],"names":[],"mappings":";;;AAaA,oCAAsD;AA4OzC,QAAA,cAAc,GAAY;IACnC,YAAY,EAAE;QACV,YAAY,EAAE,CAAC;QACf,UAAU,EAAE,EAAE;QACd,eAAe,EAAE,EAAE;QACnB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,KAAK,EAAE,EAAE;KACZ;IACD,cAAc,EAAE;QACZ,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,CAAC;KAClB;IACD,gBAAgB,EAAE;QACd,SAAS,EAAE,EAAE;QACb,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,CAAC;QACf,IAAI,EAAE,EAAE;KACX;IACD,WAAW,EAAE;QACT,IAAI,EAAE,EAAE;QACR,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,CAAC;KAClB;CACJ,CAAC;AAEW,QAAA,oBAAoB,GAAkB;IAC/C,QAAQ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