@faststore/api 1.8.37 → 1.8.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/api.cjs.development.js +2 -13
- package/dist/api.cjs.development.js.map +1 -1
- package/dist/api.cjs.production.min.js +1 -1
- package/dist/api.cjs.production.min.js.map +1 -1
- package/dist/api.esm.js +2 -13
- package/dist/api.esm.js.map +1 -1
- package/dist/platforms/vtex/clients/index.d.ts +0 -1
- package/dist/platforms/vtex/clients/search/index.d.ts +0 -1
- package/package.json +2 -2
- package/src/platforms/vtex/clients/search/index.ts +0 -14
- package/src/platforms/vtex/resolvers/searchResult.ts +1 -1
|
@@ -21,6 +21,5 @@ export declare const IntelligentSearch: ({ account, environment, hideUnavailable
|
|
|
21
21
|
facets: (args: Omit<SearchArgs, 'type'>) => Promise<FacetSearchResult>;
|
|
22
22
|
products: (args: Omit<SearchArgs, 'type'>) => Promise<ProductSearchResult>;
|
|
23
23
|
suggestedTerms: (args: Omit<SearchArgs, 'type'>) => Promise<Suggestion>;
|
|
24
|
-
suggestedProducts: (args: Omit<SearchArgs, 'type'>) => Promise<ProductSearchResult>;
|
|
25
24
|
topSearches: () => Promise<Suggestion>;
|
|
26
25
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/api",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.38",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"graphql": "^15.6.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "cf381aba27aecec9e756044b38c854680bab5c61"
|
|
49
49
|
}
|
|
@@ -124,19 +124,6 @@ export const IntelligentSearch = (
|
|
|
124
124
|
const products = (args: Omit<SearchArgs, 'type'>) =>
|
|
125
125
|
search<ProductSearchResult>({ ...args, type: 'product_search' })
|
|
126
126
|
|
|
127
|
-
const suggestedProducts = (
|
|
128
|
-
args: Omit<SearchArgs, 'type'>
|
|
129
|
-
): Promise<ProductSearchResult> => {
|
|
130
|
-
const params = new URLSearchParams({
|
|
131
|
-
query: args.query?.toString() ?? '',
|
|
132
|
-
locale: ctx.storage.locale,
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
return fetchAPI(
|
|
136
|
-
`${base}/_v/api/intelligent-search/product_search?${params.toString()}`
|
|
137
|
-
)
|
|
138
|
-
}
|
|
139
|
-
|
|
140
127
|
const suggestedTerms = (
|
|
141
128
|
args: Omit<SearchArgs, 'type'>
|
|
142
129
|
): Promise<Suggestion> => {
|
|
@@ -167,7 +154,6 @@ export const IntelligentSearch = (
|
|
|
167
154
|
facets,
|
|
168
155
|
products,
|
|
169
156
|
suggestedTerms,
|
|
170
|
-
suggestedProducts,
|
|
171
157
|
topSearches,
|
|
172
158
|
}
|
|
173
159
|
}
|
|
@@ -24,7 +24,7 @@ export const StoreSearchResult: Record<string, Resolver<Root>> = {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const terms = await search.suggestedTerms(searchArgs)
|
|
27
|
-
const products = await search.
|
|
27
|
+
const products = await search.products(searchArgs)
|
|
28
28
|
|
|
29
29
|
const skus = products.products
|
|
30
30
|
.map((product) => {
|