@faststore/api 1.9.8 → 1.9.14
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 +505 -1680
- package/README.md +5 -2
- package/dist/__generated__/schema.d.ts +23 -8
- package/dist/api.cjs.development.js +254 -196
- 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 +254 -194
- package/dist/api.esm.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/platforms/vtex/clients/search/index.d.ts +2 -1
- package/dist/platforms/vtex/clients/search/types/FacetSearchResult.d.ts +8 -8
- package/dist/platforms/vtex/index.d.ts +7 -3
- package/dist/platforms/vtex/resolvers/faceValue.d.ts +3 -0
- package/dist/platforms/vtex/resolvers/facet.d.ts +3 -1
- package/dist/platforms/vtex/utils/facets.d.ts +1 -0
- package/package.json +3 -2
- package/src/__generated__/schema.ts +26 -8
- package/src/platforms/vtex/clients/search/index.ts +9 -1
- package/src/platforms/vtex/clients/search/types/FacetSearchResult.ts +9 -8
- package/src/platforms/vtex/index.ts +26 -16
- package/src/platforms/vtex/resolvers/faceValue.ts +12 -0
- package/src/platforms/vtex/resolvers/facet.ts +66 -5
- package/src/platforms/vtex/resolvers/offer.ts +1 -1
- package/src/platforms/vtex/resolvers/searchResult.ts +9 -26
- package/src/platforms/vtex/utils/facets.ts +18 -0
- package/src/typeDefs/facet.graphql +28 -6
- package/dist/platforms/vtex/resolvers/facetValue.d.ts +0 -5
- package/src/platforms/vtex/resolvers/facetValue.ts +0 -12
package/README.md
CHANGED
|
@@ -28,9 +28,11 @@ From the command line in your project directory, run yarn add `@faststore/api`.
|
|
|
28
28
|
```cmd
|
|
29
29
|
yarn add @faststore/api
|
|
30
30
|
```
|
|
31
|
+
|
|
31
32
|
## Usage
|
|
32
33
|
|
|
33
|
-
With servers like express:
|
|
34
|
+
With servers like express:
|
|
35
|
+
|
|
34
36
|
```ts
|
|
35
37
|
import { execute } from 'graphql'
|
|
36
38
|
import { getSchema } from '@faststore/api'
|
|
@@ -45,7 +47,7 @@ app.get('/graphql', async (req, res) => {
|
|
|
45
47
|
const result = await execute({
|
|
46
48
|
schema: await getSchema(),
|
|
47
49
|
variableValues: variables,
|
|
48
|
-
operationName
|
|
50
|
+
operationName,
|
|
49
51
|
})
|
|
50
52
|
|
|
51
53
|
res.status(200)
|
|
@@ -54,4 +56,5 @@ app.get('/graphql', async (req, res) => {
|
|
|
54
56
|
```
|
|
55
57
|
|
|
56
58
|
## Docs
|
|
59
|
+
|
|
57
60
|
For more information, please refer to our documentation: https://faststore.dev/reference/api/faststore-api
|
|
@@ -287,17 +287,27 @@ export declare type StoreCurrency = {
|
|
|
287
287
|
/** Currency symbol (e.g: $). */
|
|
288
288
|
symbol: Scalars['String'];
|
|
289
289
|
};
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
290
|
+
export declare type StoreFacet = StoreFacetBoolean | StoreFacetRange;
|
|
291
|
+
/** Search facet boolean information. */
|
|
292
|
+
export declare type StoreFacetBoolean = {
|
|
293
|
+
__typename?: 'StoreFacetBoolean';
|
|
293
294
|
/** Facet key. */
|
|
294
295
|
key: Scalars['String'];
|
|
295
296
|
/** Facet label. */
|
|
296
297
|
label: Scalars['String'];
|
|
297
|
-
/** Facet type. Possible values are `BOOLEAN` and `RANGE`. */
|
|
298
|
-
type: StoreFacetType;
|
|
299
298
|
/** Array with information on each facet value. */
|
|
300
|
-
values: Array<
|
|
299
|
+
values: Array<StoreFacetValueBoolean>;
|
|
300
|
+
};
|
|
301
|
+
/** Search facet range information. */
|
|
302
|
+
export declare type StoreFacetRange = {
|
|
303
|
+
__typename?: 'StoreFacetRange';
|
|
304
|
+
/** Facet key. */
|
|
305
|
+
key: Scalars['String'];
|
|
306
|
+
/** Facet label. */
|
|
307
|
+
label: Scalars['String'];
|
|
308
|
+
max: StoreFacetValueRange;
|
|
309
|
+
/** Array with information on each facet value. */
|
|
310
|
+
min: StoreFacetValueRange;
|
|
301
311
|
};
|
|
302
312
|
/** Search facet type. */
|
|
303
313
|
export declare const enum StoreFacetType {
|
|
@@ -307,8 +317,8 @@ export declare const enum StoreFacetType {
|
|
|
307
317
|
Range = "RANGE"
|
|
308
318
|
}
|
|
309
319
|
/** Information of a specific facet value. */
|
|
310
|
-
export declare type
|
|
311
|
-
__typename?: '
|
|
320
|
+
export declare type StoreFacetValueBoolean = {
|
|
321
|
+
__typename?: 'StoreFacetValueBoolean';
|
|
312
322
|
/** Facet value label. */
|
|
313
323
|
label: Scalars['String'];
|
|
314
324
|
/** Number of items with this facet. */
|
|
@@ -318,6 +328,11 @@ export declare type StoreFacetValue = {
|
|
|
318
328
|
/** Facet value. */
|
|
319
329
|
value: Scalars['String'];
|
|
320
330
|
};
|
|
331
|
+
export declare type StoreFacetValueRange = {
|
|
332
|
+
__typename?: 'StoreFacetValueRange';
|
|
333
|
+
absolute: Scalars['Float'];
|
|
334
|
+
selected: Scalars['Float'];
|
|
335
|
+
};
|
|
321
336
|
/** Image. */
|
|
322
337
|
export declare type StoreImage = {
|
|
323
338
|
__typename?: 'StoreImage';
|