fast-simon-sdk 1.6.4 → 1.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/lib/config.d.ts +25 -22
  2. package/lib/config.js +30 -27
  3. package/lib/config.js.map +1 -1
  4. package/lib/index.d.ts +3 -3
  5. package/lib/index.js +72 -71
  6. package/lib/index.js.map +1 -1
  7. package/lib/models/autocomplete.d.ts +73 -70
  8. package/lib/models/autocomplete.js +2 -2
  9. package/lib/models/common.d.ts +267 -208
  10. package/lib/models/common.js +65 -63
  11. package/lib/models/common.js.map +1 -1
  12. package/lib/models/content.d.ts +37 -37
  13. package/lib/models/content.js +2 -2
  14. package/lib/models/events.d.ts +113 -87
  15. package/lib/models/events.js +2 -2
  16. package/lib/models/exports.d.ts +6 -6
  17. package/lib/models/exports.js +5 -5
  18. package/lib/models/fullTextSearch.d.ts +130 -126
  19. package/lib/models/fullTextSearch.js +17 -17
  20. package/lib/models/fullTextSearch.js.map +1 -1
  21. package/lib/models/lookAlikeProductRecommendation.d.ts +8 -8
  22. package/lib/models/lookAlikeProductRecommendation.js +2 -2
  23. package/lib/models/productsInventory.d.ts +10 -10
  24. package/lib/models/productsInventory.js +2 -2
  25. package/lib/models/related.d.ts +35 -35
  26. package/lib/models/related.js +2 -2
  27. package/lib/models/smartCollections.d.ts +94 -90
  28. package/lib/models/smartCollections.js +2 -2
  29. package/lib/models/visualDiscovery.d.ts +129 -0
  30. package/lib/models/visualDiscovery.js +31 -0
  31. package/lib/models/visualDiscovery.js.map +1 -0
  32. package/lib/sections/contentSearch/index.d.ts +7 -7
  33. package/lib/sections/contentSearch/index.js +44 -44
  34. package/lib/sections/contentSearch/index.js.map +1 -1
  35. package/lib/sections/enums/index.d.ts +47 -45
  36. package/lib/sections/enums/index.js +50 -48
  37. package/lib/sections/enums/index.js.map +1 -1
  38. package/lib/sections/eventReporter/index.d.ts +10 -10
  39. package/lib/sections/eventReporter/index.js +628 -501
  40. package/lib/sections/eventReporter/index.js.map +1 -1
  41. package/lib/sections/eventReporter/utils.d.ts +9 -9
  42. package/lib/sections/eventReporter/utils.js +31 -29
  43. package/lib/sections/eventReporter/utils.js.map +1 -1
  44. package/lib/sections/fullTextSearch/index.d.ts +6 -6
  45. package/lib/sections/fullTextSearch/index.js +178 -171
  46. package/lib/sections/fullTextSearch/index.js.map +1 -1
  47. package/lib/sections/fullTextSearch/utils.d.ts +17 -17
  48. package/lib/sections/fullTextSearch/utils.js +185 -177
  49. package/lib/sections/fullTextSearch/utils.js.map +1 -1
  50. package/lib/sections/index.d.ts +3 -3
  51. package/lib/sections/index.js +432 -342
  52. package/lib/sections/index.js.map +1 -1
  53. package/lib/sections/initialization/index.d.ts +8 -8
  54. package/lib/sections/initialization/index.js +150 -150
  55. package/lib/sections/initialization/index.js.map +1 -1
  56. package/lib/sections/initialization/utils.d.ts +11 -11
  57. package/lib/sections/initialization/utils.js +200 -196
  58. package/lib/sections/initialization/utils.js.map +1 -1
  59. package/lib/sections/instantSearch/index.d.ts +6 -6
  60. package/lib/sections/instantSearch/index.js +66 -66
  61. package/lib/sections/instantSearch/index.js.map +1 -1
  62. package/lib/sections/instantSearch/utils.d.ts +21 -21
  63. package/lib/sections/instantSearch/utils.js +232 -232
  64. package/lib/sections/instantSearch/utils.js.map +1 -1
  65. package/lib/sections/landingPage/index.d.ts +6 -6
  66. package/lib/sections/landingPage/index.js +95 -95
  67. package/lib/sections/landingPage/index.js.map +1 -1
  68. package/lib/sections/landingPage/utils.d.ts +14 -14
  69. package/lib/sections/landingPage/utils.js +96 -90
  70. package/lib/sections/landingPage/utils.js.map +1 -1
  71. package/lib/sections/lookAlikeProductRecommendation/index.d.ts +6 -6
  72. package/lib/sections/lookAlikeProductRecommendation/index.js +23 -23
  73. package/lib/sections/recommendations/index.d.ts +10 -6
  74. package/lib/sections/recommendations/index.js +95 -48
  75. package/lib/sections/recommendations/index.js.map +1 -1
  76. package/lib/sections/recommendations/utils.d.ts +6 -7
  77. package/lib/sections/recommendations/utils.js +82 -91
  78. package/lib/sections/recommendations/utils.js.map +1 -1
  79. package/lib/sections/smartCollections/index.d.ts +6 -6
  80. package/lib/sections/smartCollections/index.js +169 -163
  81. package/lib/sections/smartCollections/index.js.map +1 -1
  82. package/lib/sections/smartCollections/utils.d.ts +41 -40
  83. package/lib/sections/smartCollections/utils.js +286 -269
  84. package/lib/sections/smartCollections/utils.js.map +1 -1
  85. package/lib/sections/visualDiscovery/index.d.ts +22 -0
  86. package/lib/sections/visualDiscovery/index.js +262 -0
  87. package/lib/sections/visualDiscovery/index.js.map +1 -0
  88. package/lib/services/autocomplete.d.ts +24 -24
  89. package/lib/services/autocomplete.js +50 -50
  90. package/lib/services/common.d.ts +35 -35
  91. package/lib/services/common.js +94 -94
  92. package/lib/services/content.d.ts +4 -4
  93. package/lib/services/content.js +25 -25
  94. package/lib/services/fullTextSearch.d.ts +4 -4
  95. package/lib/services/fullTextSearch.js +87 -84
  96. package/lib/services/fullTextSearch.js.map +1 -1
  97. package/lib/services/landingPage.d.ts +21 -21
  98. package/lib/services/landingPage.js +44 -44
  99. package/lib/services/lookAlikeProductRecommendation.d.ts +13 -13
  100. package/lib/services/lookAlikeProductRecommendation.js +23 -23
  101. package/lib/services/related.d.ts +48 -29
  102. package/lib/services/related.js +114 -72
  103. package/lib/services/related.js.map +1 -1
  104. package/lib/services/reporting.d.ts +80 -68
  105. package/lib/services/reporting.js +258 -208
  106. package/lib/services/reporting.js.map +1 -1
  107. package/lib/services/smartCollections.d.ts +5 -5
  108. package/lib/services/smartCollections.js +93 -82
  109. package/lib/services/smartCollections.js.map +1 -1
  110. package/lib/services/utils.d.ts +5 -5
  111. package/lib/services/utils.js +25 -25
  112. package/lib/services/utils.js.map +1 -1
  113. package/lib/services/visualDiscovery.d.ts +9 -0
  114. package/lib/services/visualDiscovery.js +167 -0
  115. package/lib/services/visualDiscovery.js.map +1 -0
  116. package/lib/utils/ABTesting.d.ts +2 -1
  117. package/lib/utils/ABTesting.js +27 -14
  118. package/lib/utils/ABTesting.js.map +1 -1
  119. package/lib/utils/API.d.ts +19 -19
  120. package/lib/utils/API.js +81 -81
  121. package/lib/utils/API.js.map +1 -1
  122. package/lib/utils/ArrayUtils.d.ts +2 -2
  123. package/lib/utils/ArrayUtils.js +16 -17
  124. package/lib/utils/ArrayUtils.js.map +1 -1
  125. package/lib/utils/bindingBoxes.d.ts +23 -0
  126. package/lib/utils/bindingBoxes.js +89 -0
  127. package/lib/utils/bindingBoxes.js.map +1 -0
  128. package/lib/utils/cookies.d.ts +13 -13
  129. package/lib/utils/cookies.js +50 -50
  130. package/lib/utils/debug.d.ts +4 -4
  131. package/lib/utils/debug.js +31 -31
  132. package/lib/utils/debug.js.map +1 -1
  133. package/lib/utils/duplicationsHandler.d.ts +19 -0
  134. package/lib/utils/duplicationsHandler.js +70 -0
  135. package/lib/utils/duplicationsHandler.js.map +1 -0
  136. package/lib/utils/filtersPersonalization.d.ts +3 -3
  137. package/lib/utils/filtersPersonalization.js +39 -39
  138. package/lib/utils/filtersPersonalization.js.map +1 -1
  139. package/lib/utils/image.d.ts +6 -0
  140. package/lib/utils/image.js +154 -0
  141. package/lib/utils/image.js.map +1 -0
  142. package/lib/utils/klaviyo.js +1 -1
  143. package/lib/utils/location.d.ts +1 -1
  144. package/lib/utils/location.js +11 -11
  145. package/lib/utils/location.js.map +1 -1
  146. package/lib/utils/mappingUtil.d.ts +4 -4
  147. package/lib/utils/mappingUtil.js +16 -16
  148. package/lib/utils/options.d.ts +23 -23
  149. package/lib/utils/options.js +16 -16
  150. package/lib/utils/personalization.d.ts +2 -0
  151. package/lib/utils/personalization.js +21 -0
  152. package/lib/utils/personalization.js.map +1 -0
  153. package/lib/utils/segments.d.ts +2 -2
  154. package/lib/utils/segments.js +19 -20
  155. package/lib/utils/segments.js.map +1 -1
  156. package/lib/utils/shopifyMarkets.d.ts +3 -3
  157. package/lib/utils/shopifyMarkets.js +12 -12
  158. package/lib/utils/sortUtil.d.ts +1 -0
  159. package/lib/utils/sortUtil.js +25 -0
  160. package/lib/utils/sortUtil.js.map +1 -0
  161. package/lib/utils/updateRecentSearches.d.ts +2 -1
  162. package/lib/utils/updateRecentSearches.js +56 -26
  163. package/lib/utils/updateRecentSearches.js.map +1 -1
  164. package/lib/utils/validation.d.ts +5 -5
  165. package/lib/utils/validation.js +46 -46
  166. package/lib/utils/validation.js.map +1 -1
  167. package/package.json +3 -2
@@ -1,208 +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
- export type AppType = "SPA" | "MPA";
9
- export type SDKStatus = "loading" | "error" | "ready";
10
- type ContentPage = number;
11
- type ContentCursor = string;
12
- export interface SDKData {
13
- uuid: string;
14
- storeID: number;
15
- cdnKey: number;
16
- sessionToken: SessionToken;
17
- userToken: string;
18
- cartToken: string;
19
- dashboard: DashboardKeys;
20
- popularProducts: Product[];
21
- categories: FastCategory[];
22
- turbolinks: FastTurbolinks[];
23
- contentData: Record<ContentPage, ContentCursor>;
24
- withProductVariants?: boolean;
25
- withAttributes?: boolean;
26
- popularSearches?: PopularSearch[];
27
- abTestingVariations?: {
28
- [key: string]: {
29
- [key: string]: object;
30
- };
31
- };
32
- }
33
- export interface AutocompleteResults {
34
- totalResults: number;
35
- categories?: FastCategory[];
36
- products: Product[];
37
- turbolinks?: FastTurbolinks[];
38
- popularSearches: PopularSearch[];
39
- query: string;
40
- }
41
- export interface FullTextResults {
42
- query: string;
43
- products?: Product[];
44
- facets?: Facet[];
45
- totalResults: number;
46
- narrow?: Narrow[];
47
- sortBy?: SortBy;
48
- isNoResults?: boolean;
49
- page?: number;
50
- pageCount?: number;
51
- ancestors?: CategoryAncestor[];
52
- avoidPrefixList?: string[];
53
- merch?: any;
54
- turbolink?: FastTurbolinks;
55
- relatedCategories?: RelatedCategory[];
56
- relatedResults?: boolean;
57
- }
58
- export interface LandingPageResults {
59
- slug: string;
60
- products: Product[];
61
- facets?: Facet[];
62
- totalResults: number;
63
- narrow?: Narrow[];
64
- sortBy?: SortBy;
65
- isNoResults?: boolean;
66
- page?: number;
67
- pageCount?: number;
68
- ancestors?: CategoryAncestor[];
69
- avoidPrefixList?: string[];
70
- }
71
- export interface SDKTemp {
72
- autocomplete: AutocompleteResults;
73
- fullTextSearch: FullTextResults;
74
- smartCollections: smartCollectionsResults;
75
- landingPage: LandingPageResults;
76
- }
77
- export interface initProps {
78
- storeID: number;
79
- uuid: string;
80
- type: AppType;
81
- onReady?: VoidFunction;
82
- cartToken?: string;
83
- }
84
- export interface instantSearchProps {
85
- query: string;
86
- callback: AutocompleteCallback;
87
- withAttributes?: boolean;
88
- withCategories?: boolean;
89
- withProductTypes?: boolean;
90
- }
91
- export interface FullTextSearchProps {
92
- term: string;
93
- page?: number;
94
- productsPerPage?: number;
95
- sortBy?: SortBy;
96
- narrowBy?: Narrow[];
97
- facets?: boolean;
98
- callback: fullTextCallback;
99
- withAttributes?: boolean;
100
- searchWithinSearch?: string;
101
- infiniteScrollPage?: number;
102
- segments?: string[];
103
- withProductTypes?: boolean;
104
- disableMerchandising?: boolean;
105
- disableStrategies?: boolean;
106
- disableMerchandisingRules?: boolean;
107
- onProductsLoaded?: fullTextProductsCallback;
108
- onFacetsLoaded?: fullTextFacetsCallback;
109
- }
110
- export type LandingPageCallback = ({}: {
111
- action: "products" | "facets and products";
112
- payload: LandingPageResults;
113
- }) => void;
114
- export interface LandingPageProps {
115
- slug: string;
116
- page?: number;
117
- productsPerPage?: number;
118
- sortBy?: SortBy;
119
- narrowBy?: Narrow[];
120
- facets?: boolean;
121
- callback: LandingPageCallback;
122
- withAttributes?: boolean;
123
- }
124
- export interface smartCollectionsProps {
125
- categoryID: string;
126
- page?: number;
127
- productsPerPage?: number;
128
- sortBy?: SortBy;
129
- narrowBy?: Narrow[];
130
- facets?: boolean;
131
- callback: smartCollectionsCallback;
132
- withAttributes?: boolean;
133
- searchWithinSearch?: string;
134
- infiniteScrollPage?: number;
135
- segments?: string[];
136
- inventoryCallback?: inventoryCallback;
137
- access_token?: string;
138
- shop_url?: string;
139
- withProductTypes?: boolean;
140
- disableMerchandising?: boolean;
141
- disableStrategies?: boolean;
142
- disableMerchandisingRules?: boolean;
143
- onProductsLoaded?: smartCollectionsCallback;
144
- onFacetsLoaded?: smartCollectionsCallback;
145
- }
146
- export interface LookALikeProps {
147
- viewedProductId: string;
148
- callback: (response: LookALikeResponse) => void;
149
- }
150
- export interface LookALikeResponse {
151
- action: "look a like";
152
- payload: Product[];
153
- }
154
- export interface RelatedProps {
155
- productID: string;
156
- specs: Specs[];
157
- callback: WidgetCallback;
158
- recent?: string[];
159
- withAttributes?: boolean;
160
- src?: SRC_TYPES;
161
- }
162
- export interface GetProductsProps {
163
- productIds: string[];
164
- callback?: (products: Product[]) => void;
165
- }
166
- export interface SDKUtils {
167
- type: AppType;
168
- status: SDKStatus;
169
- data: SDKData;
170
- temp: SDKTemp;
171
- callbacks?: (() => any)[];
172
- }
173
- export interface PopularProductsProps {
174
- withAttributes?: boolean;
175
- }
176
- export interface SDK {
177
- initialization: ({}: initProps) => void;
178
- instantSearch: ({}: instantSearchProps) => void;
179
- fullTextSearch: ({}: FullTextSearchProps) => void;
180
- smartCollections: ({}: smartCollectionsProps) => void;
181
- landingPage: ({}: LandingPageProps) => void;
182
- lookAlikeProductRecommendation: ({}: LookALikeProps) => void;
183
- productRecommendation: ({}: RelatedProps) => void;
184
- contentSearch: ({}: ContentSearchProps) => void;
185
- event: ({}: Report<any>) => void;
186
- getAllCategories: (callback?: (categories: FastCategory[] | null) => void) => Promise<FastCategory[] | null>;
187
- getAllPopularProducts: (callback?: (products: Product[] | null) => void, withAttributes?: boolean) => Promise<Product[] | null>;
188
- getProducts: ({}: GetProductsProps) => Promise<Product[]>;
189
- getSetup: ({}: {
190
- keys: (Partial<keyof DashboardKeys>)[];
191
- callback: (keys: Partial<DashboardKeys>) => void;
192
- }) => void;
193
- }
194
- export declare const defaultSDKTemp: SDKTemp;
195
- export declare const defaultDashboardData: DashboardKeys;
196
- export declare const defaultSDKData: SDKData;
197
- export interface SessionToken {
198
- start: number;
199
- lastActive: number;
200
- }
201
- export interface BCTokenResponse {
202
- id: string;
203
- }
204
- export interface ShopifyTokenResponse {
205
- token: string;
206
- }
207
- export type Platfrom = "Shopify" | "Bigcommerce" | "";
208
- 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,64 +1,66 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultSDKData = exports.defaultDashboardData = exports.defaultSDKTemp = void 0;
4
- exports.defaultSDKTemp = {
5
- autocomplete: {
6
- totalResults: 0,
7
- categories: [],
8
- popularSearches: [],
9
- products: [],
10
- turbolinks: [],
11
- query: "",
12
- },
13
- fullTextSearch: {
14
- query: "",
15
- products: [],
16
- facets: [],
17
- totalResults: 0
18
- },
19
- smartCollections: {
20
- ancestors: [],
21
- categoryID: "",
22
- products: [],
23
- facets: [],
24
- totalResults: 0,
25
- name: ""
26
- },
27
- landingPage: {
28
- slug: "",
29
- products: [],
30
- facets: [],
31
- totalResults: 0
32
- }
33
- };
34
- exports.defaultDashboardData = {
35
- site_url: "",
36
- disable_categories_suggestions: false,
37
- max_popular_categories_suggestions: 0,
38
- max_popular_searches_suggestions: 0,
39
- max_product_suggestions: 0,
40
- using_isp_api: true,
41
- isp_personalized_search_enabled: false,
42
- products_per_page: 20,
43
- categories_products_per_page: 20,
44
- show_popular_products_on_focus: false,
45
- is_content: false,
46
- isp_personalized_collection_enabled: false
47
- };
48
- exports.defaultSDKData = {
49
- storeID: 0,
50
- uuid: "",
51
- cdnKey: Date.now(),
52
- sessionToken: {
53
- lastActive: Date.now(),
54
- start: Date.now()
55
- },
56
- userToken: "",
57
- cartToken: "",
58
- dashboard: exports.defaultDashboardData,
59
- popularProducts: [],
60
- categories: [],
61
- turbolinks: [],
62
- contentData: { 0: "" },
63
- };
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
+ };
64
66
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/models/common.ts"],"names":[],"mappings":";;;AA0Na,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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