@faststore/api 2.1.83 → 2.2.0-alpha.0
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/dist/api.cjs.development.js +5 -8
- 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 +5 -8
- package/dist/api.esm.js.map +1 -1
- package/dist/index.d.ts +16 -74
- package/dist/platforms/vtex/index.d.ts +14 -74
- package/dist/platforms/vtex/resolvers/aggregateOffer.d.ts +1 -2
- package/dist/platforms/vtex/resolvers/collection.d.ts +1 -2
- package/dist/platforms/vtex/resolvers/facet.d.ts +1 -2
- package/dist/platforms/vtex/resolvers/offer.d.ts +1 -1
- package/dist/platforms/vtex/resolvers/organization.d.ts +4 -1
- package/dist/platforms/vtex/resolvers/product.d.ts +1 -1
- package/dist/platforms/vtex/resolvers/productGroup.d.ts +1 -2
- package/dist/platforms/vtex/resolvers/propertyValue.d.ts +2 -3
- package/dist/platforms/vtex/resolvers/root.d.ts +12 -0
- package/dist/platforms/vtex/resolvers/searchResult.d.ts +1 -2
- package/dist/platforms/vtex/resolvers/seo.d.ts +1 -2
- package/dist/platforms/vtex/resolvers/shippingSLA.d.ts +1 -2
- package/dist/platforms/vtex/resolvers/skuVariations.d.ts +1 -2
- package/package.json +5 -5
- package/src/index.ts +3 -0
- package/src/platforms/vtex/resolvers/aggregateOffer.ts +1 -1
- package/src/platforms/vtex/resolvers/collection.ts +1 -1
- package/src/platforms/vtex/resolvers/facet.ts +1 -1
- package/src/platforms/vtex/resolvers/offer.ts +1 -1
- package/src/platforms/vtex/resolvers/organization.ts +5 -1
- package/src/platforms/vtex/resolvers/product.ts +1 -1
- package/src/platforms/vtex/resolvers/productGroup.ts +1 -1
- package/src/platforms/vtex/resolvers/propertyValue.ts +2 -2
- package/src/platforms/vtex/resolvers/root.ts +12 -0
- package/src/platforms/vtex/resolvers/searchResult.ts +1 -1
- package/src/platforms/vtex/resolvers/seo.ts +1 -1
- package/src/platforms/vtex/resolvers/shippingSLA.ts +1 -1
- package/src/platforms/vtex/resolvers/skuVariations.ts +1 -1
- package/src/platforms/vtex/resolvers/validateCart.ts +1 -3
package/dist/index.d.ts
CHANGED
|
@@ -7,87 +7,27 @@ export type { CacheControl } from './directives/cacheControl';
|
|
|
7
7
|
export declare type Options = OptionsVTEX;
|
|
8
8
|
export declare const getTypeDefs: () => string[];
|
|
9
9
|
export declare const getResolvers: (options: Options) => {
|
|
10
|
-
StoreCollection: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
StoreAggregateOffer: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./platforms/vtex/clients/search/types/ProductSearchResult").Seller, import("./platforms/vtex/clients/search/types/ProductSearchResult").Item & {
|
|
14
|
-
isVariantOf: import("./platforms/vtex/clients/search/types/ProductSearchResult").Product;
|
|
15
|
-
} & {
|
|
16
|
-
attachmentsValues?: import("./platforms/vtex/clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
17
|
-
}>[], unknown, any>> & {
|
|
18
|
-
offers: import("./platforms/vtex").Resolver<import("./platforms/vtex/utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./platforms/vtex/clients/search/types/ProductSearchResult").Seller, import("./platforms/vtex/clients/search/types/ProductSearchResult").Item & {
|
|
19
|
-
isVariantOf: import("./platforms/vtex/clients/search/types/ProductSearchResult").Product;
|
|
20
|
-
} & {
|
|
21
|
-
attachmentsValues?: import("./platforms/vtex/clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
22
|
-
}>[], any, import("./platforms/vtex/utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./platforms/vtex/clients/search/types/ProductSearchResult").Seller, import("./platforms/vtex/clients/search/types/ProductSearchResult").Item & {
|
|
23
|
-
isVariantOf: import("./platforms/vtex/clients/search/types/ProductSearchResult").Product;
|
|
24
|
-
} & {
|
|
25
|
-
attachmentsValues?: import("./platforms/vtex/clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
26
|
-
}>[]>;
|
|
10
|
+
StoreCollection: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/resolvers/collection").Root, unknown, any>>;
|
|
11
|
+
StoreAggregateOffer: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./platforms/vtex/clients/search/types/ProductSearchResult").Seller, import("./platforms/vtex/resolvers/product").Root>[], unknown, any>> & {
|
|
12
|
+
offers: import("./platforms/vtex").Resolver<import("./platforms/vtex/utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./platforms/vtex/clients/search/types/ProductSearchResult").Seller, import("./platforms/vtex/resolvers/product").Root>[], any, import("./platforms/vtex/utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./platforms/vtex/clients/search/types/ProductSearchResult").Seller, import("./platforms/vtex/resolvers/product").Root>[]>;
|
|
27
13
|
};
|
|
28
|
-
StoreProduct: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
attachmentsValues?: import("./platforms/vtex/clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
32
|
-
}, unknown, any>> & {
|
|
33
|
-
offers: import("./platforms/vtex").Resolver<import("./platforms/vtex/clients/search/types/ProductSearchResult").Item & {
|
|
34
|
-
isVariantOf: import("./platforms/vtex/clients/search/types/ProductSearchResult").Product;
|
|
35
|
-
} & {
|
|
36
|
-
attachmentsValues?: import("./platforms/vtex/clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
37
|
-
}, any, import("./platforms/vtex/utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./platforms/vtex/clients/search/types/ProductSearchResult").Seller, import("./platforms/vtex/clients/search/types/ProductSearchResult").Item & {
|
|
38
|
-
isVariantOf: import("./platforms/vtex/clients/search/types/ProductSearchResult").Product;
|
|
39
|
-
} & {
|
|
40
|
-
attachmentsValues?: import("./platforms/vtex/clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
41
|
-
}>[]>;
|
|
42
|
-
isVariantOf: import("./platforms/vtex").Resolver<import("./platforms/vtex/clients/search/types/ProductSearchResult").Item & {
|
|
43
|
-
isVariantOf: import("./platforms/vtex/clients/search/types/ProductSearchResult").Product;
|
|
44
|
-
} & {
|
|
45
|
-
attachmentsValues?: import("./platforms/vtex/clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
46
|
-
}, any, import("./platforms/vtex/clients/search/types/ProductSearchResult").Item & {
|
|
47
|
-
isVariantOf: import("./platforms/vtex/clients/search/types/ProductSearchResult").Product;
|
|
48
|
-
} & {
|
|
49
|
-
attachmentsValues?: import("./platforms/vtex/clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
50
|
-
}>;
|
|
14
|
+
StoreProduct: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/resolvers/product").Root, unknown, any>> & {
|
|
15
|
+
offers: import("./platforms/vtex").Resolver<import("./platforms/vtex/resolvers/product").Root, any, import("./platforms/vtex/utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./platforms/vtex/clients/search/types/ProductSearchResult").Seller, import("./platforms/vtex/resolvers/product").Root>[]>;
|
|
16
|
+
isVariantOf: import("./platforms/vtex").Resolver<import("./platforms/vtex/resolvers/product").Root, any, import("./platforms/vtex/resolvers/product").Root>;
|
|
51
17
|
};
|
|
52
|
-
StoreSeo: Record<string, import("./platforms/vtex").Resolver<
|
|
53
|
-
|
|
54
|
-
description?: string | undefined;
|
|
55
|
-
canonical?: string | undefined;
|
|
56
|
-
}, unknown, any>>;
|
|
57
|
-
StoreFacet: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/clients/search/types/FacetSearchResult").Facet<import("./platforms/vtex/clients/search/types/FacetSearchResult").FacetValueBoolean | import("./platforms/vtex/clients/search/types/FacetSearchResult").FacetValueRange>, unknown, any>>;
|
|
18
|
+
StoreSeo: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/resolvers/seo").Root, unknown, any>>;
|
|
19
|
+
StoreFacet: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/resolvers/facet").Root, unknown, any>>;
|
|
58
20
|
StoreFacetBoolean: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/clients/search/types/FacetSearchResult").Facet<import("./platforms/vtex/clients/search/types/FacetSearchResult").FacetValueBoolean>, unknown, any>>;
|
|
59
21
|
StoreFacetRange: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/clients/search/types/FacetSearchResult").Facet<import("./platforms/vtex/clients/search/types/FacetSearchResult").FacetValueRange>, unknown, any>>;
|
|
60
22
|
StoreFacetValueBoolean: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/clients/search/types/FacetSearchResult").FacetValueBoolean, unknown, any>>;
|
|
61
|
-
StoreOffer: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/
|
|
62
|
-
isVariantOf: import("./platforms/vtex/clients/search/types/ProductSearchResult").Product;
|
|
63
|
-
} & {
|
|
64
|
-
attachmentsValues?: import("./platforms/vtex/clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
65
|
-
}> | (import("./platforms/vtex/clients/commerce/types/OrderForm").OrderFormItem & {
|
|
66
|
-
product: import("./platforms/vtex/utils/enhanceSku").EnhancedSku;
|
|
67
|
-
}), unknown, any>>;
|
|
23
|
+
StoreOffer: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/resolvers/offer").Root, unknown, any>>;
|
|
68
24
|
StoreAggregateRating: Record<string, import("./platforms/vtex").Resolver<unknown, unknown, any>>;
|
|
69
25
|
StoreReview: Record<string, import("./platforms/vtex").Resolver<unknown, unknown, any>>;
|
|
70
|
-
StoreProductGroup: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
StoreSearchResult: Record<string, import("./platforms/vtex").Resolver<{
|
|
76
|
-
searchArgs: Pick<import("./platforms/vtex/clients/search").SearchArgs, "sort" | "selectedFacets" | "hideUnavailableItems" | "query" | "page" | "count" | "fuzzy">;
|
|
77
|
-
productSearchPromise: Promise<import("./platforms/vtex/clients/search/types/ProductSearchResult").ProductSearchResult>;
|
|
78
|
-
}, unknown, any>>;
|
|
79
|
-
StorePropertyValue: Record<string, import("./platforms/vtex").Resolver<import("./__generated__/schema").IStorePropertyValue, unknown, any>>;
|
|
80
|
-
SkuVariants: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/clients/search/types/ProductSearchResult").Item & {
|
|
81
|
-
isVariantOf: import("./platforms/vtex/clients/search/types/ProductSearchResult").Product;
|
|
82
|
-
} & {
|
|
83
|
-
attachmentsValues?: import("./platforms/vtex/clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
84
|
-
}, unknown, any>>;
|
|
85
|
-
ShippingSLA: Record<string, import("./platforms/vtex").Resolver<{
|
|
86
|
-
name?: string | undefined;
|
|
87
|
-
friendlyName?: string | undefined;
|
|
88
|
-
price?: number | undefined;
|
|
89
|
-
shippingEstimate?: string | undefined;
|
|
90
|
-
}, unknown, any>>;
|
|
26
|
+
StoreProductGroup: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/resolvers/product").Root, unknown, any>>;
|
|
27
|
+
StoreSearchResult: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/resolvers/searchResult").Root, unknown, any>>;
|
|
28
|
+
StorePropertyValue: Record<string, import("./platforms/vtex").Resolver<import("./__generated__/schema").StorePropertyValue, unknown, any>>;
|
|
29
|
+
SkuVariants: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/resolvers/product").Root, unknown, any>>;
|
|
30
|
+
ShippingSLA: Record<string, import("./platforms/vtex").Resolver<import("./platforms/vtex/resolvers/shippingSLA").Root, unknown, any>>;
|
|
91
31
|
ObjectOrString: import("graphql").GraphQLScalarType;
|
|
92
32
|
Query: {
|
|
93
33
|
product: (_: unknown, { locator }: import("./__generated__/schema").QueryProductArgs, ctx: import("./platforms/vtex").Context) => Promise<import("./platforms/vtex/utils/enhanceSku").EnhancedSku>;
|
|
@@ -219,3 +159,5 @@ export declare const getResolvers: (options: Options) => {
|
|
|
219
159
|
};
|
|
220
160
|
export declare const getContextFactory: (options: Options) => (ctx: any) => import("./platforms/vtex").Context;
|
|
221
161
|
export declare const getSchema: (options: Options) => Promise<import("graphql").GraphQLSchema>;
|
|
162
|
+
export * from './platforms/vtex/resolvers/root';
|
|
163
|
+
export { Resolver } from './platforms/vtex';
|
|
@@ -35,87 +35,27 @@ export interface Context {
|
|
|
35
35
|
export declare type Resolver<R = unknown, A = unknown, Return = any> = (root: R, args: A, ctx: Context, info: any) => Return;
|
|
36
36
|
export declare const getContextFactory: (options: Options) => (ctx: any) => Context;
|
|
37
37
|
export declare const getResolvers: (_: Options) => {
|
|
38
|
-
StoreCollection: Record<string, Resolver<import("./
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
StoreAggregateOffer: Record<string, Resolver<import("./utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./clients/search/types/ProductSearchResult").Seller, import("./clients/search/types/ProductSearchResult").Item & {
|
|
42
|
-
isVariantOf: import("./clients/search/types/ProductSearchResult").Product;
|
|
43
|
-
} & {
|
|
44
|
-
attachmentsValues?: import("./clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
45
|
-
}>[], unknown, any>> & {
|
|
46
|
-
offers: Resolver<import("./utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./clients/search/types/ProductSearchResult").Seller, import("./clients/search/types/ProductSearchResult").Item & {
|
|
47
|
-
isVariantOf: import("./clients/search/types/ProductSearchResult").Product;
|
|
48
|
-
} & {
|
|
49
|
-
attachmentsValues?: import("./clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
50
|
-
}>[], any, import("./utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./clients/search/types/ProductSearchResult").Seller, import("./clients/search/types/ProductSearchResult").Item & {
|
|
51
|
-
isVariantOf: import("./clients/search/types/ProductSearchResult").Product;
|
|
52
|
-
} & {
|
|
53
|
-
attachmentsValues?: import("./clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
54
|
-
}>[]>;
|
|
38
|
+
StoreCollection: Record<string, Resolver<import("./resolvers/collection").Root, unknown, any>>;
|
|
39
|
+
StoreAggregateOffer: Record<string, Resolver<import("./utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./clients/search/types/ProductSearchResult").Seller, import("./resolvers/product").Root>[], unknown, any>> & {
|
|
40
|
+
offers: Resolver<import("./utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./clients/search/types/ProductSearchResult").Seller, import("./resolvers/product").Root>[], any, import("./utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./clients/search/types/ProductSearchResult").Seller, import("./resolvers/product").Root>[]>;
|
|
55
41
|
};
|
|
56
|
-
StoreProduct: Record<string, Resolver<import("./
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
attachmentsValues?: import("./clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
60
|
-
}, unknown, any>> & {
|
|
61
|
-
offers: Resolver<import("./clients/search/types/ProductSearchResult").Item & {
|
|
62
|
-
isVariantOf: import("./clients/search/types/ProductSearchResult").Product;
|
|
63
|
-
} & {
|
|
64
|
-
attachmentsValues?: import("./clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
65
|
-
}, any, import("./utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./clients/search/types/ProductSearchResult").Seller, import("./clients/search/types/ProductSearchResult").Item & {
|
|
66
|
-
isVariantOf: import("./clients/search/types/ProductSearchResult").Product;
|
|
67
|
-
} & {
|
|
68
|
-
attachmentsValues?: import("./clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
69
|
-
}>[]>;
|
|
70
|
-
isVariantOf: Resolver<import("./clients/search/types/ProductSearchResult").Item & {
|
|
71
|
-
isVariantOf: import("./clients/search/types/ProductSearchResult").Product;
|
|
72
|
-
} & {
|
|
73
|
-
attachmentsValues?: import("./clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
74
|
-
}, any, import("./clients/search/types/ProductSearchResult").Item & {
|
|
75
|
-
isVariantOf: import("./clients/search/types/ProductSearchResult").Product;
|
|
76
|
-
} & {
|
|
77
|
-
attachmentsValues?: import("./clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
78
|
-
}>;
|
|
42
|
+
StoreProduct: Record<string, Resolver<import("./resolvers/product").Root, unknown, any>> & {
|
|
43
|
+
offers: Resolver<import("./resolvers/product").Root, any, import("./utils/enhanceCommercialOffer").EnhancedCommercialOffer<import("./clients/search/types/ProductSearchResult").Seller, import("./resolvers/product").Root>[]>;
|
|
44
|
+
isVariantOf: Resolver<import("./resolvers/product").Root, any, import("./resolvers/product").Root>;
|
|
79
45
|
};
|
|
80
|
-
StoreSeo: Record<string, Resolver<
|
|
81
|
-
|
|
82
|
-
description?: string | undefined;
|
|
83
|
-
canonical?: string | undefined;
|
|
84
|
-
}, unknown, any>>;
|
|
85
|
-
StoreFacet: Record<string, Resolver<import("./clients/search/types/FacetSearchResult").Facet<import("./clients/search/types/FacetSearchResult").FacetValueBoolean | import("./clients/search/types/FacetSearchResult").FacetValueRange>, unknown, any>>;
|
|
46
|
+
StoreSeo: Record<string, Resolver<import("./resolvers/seo").Root, unknown, any>>;
|
|
47
|
+
StoreFacet: Record<string, Resolver<import("./resolvers/facet").Root, unknown, any>>;
|
|
86
48
|
StoreFacetBoolean: Record<string, Resolver<import("./clients/search/types/FacetSearchResult").Facet<import("./clients/search/types/FacetSearchResult").FacetValueBoolean>, unknown, any>>;
|
|
87
49
|
StoreFacetRange: Record<string, Resolver<import("./clients/search/types/FacetSearchResult").Facet<import("./clients/search/types/FacetSearchResult").FacetValueRange>, unknown, any>>;
|
|
88
50
|
StoreFacetValueBoolean: Record<string, Resolver<import("./clients/search/types/FacetSearchResult").FacetValueBoolean, unknown, any>>;
|
|
89
|
-
StoreOffer: Record<string, Resolver<import("./
|
|
90
|
-
isVariantOf: import("./clients/search/types/ProductSearchResult").Product;
|
|
91
|
-
} & {
|
|
92
|
-
attachmentsValues?: import("./clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
93
|
-
}> | (import("./clients/commerce/types/OrderForm").OrderFormItem & {
|
|
94
|
-
product: import("./utils/enhanceSku").EnhancedSku;
|
|
95
|
-
}), unknown, any>>;
|
|
51
|
+
StoreOffer: Record<string, Resolver<import("./resolvers/offer").Root, unknown, any>>;
|
|
96
52
|
StoreAggregateRating: Record<string, Resolver<unknown, unknown, any>>;
|
|
97
53
|
StoreReview: Record<string, Resolver<unknown, unknown, any>>;
|
|
98
|
-
StoreProductGroup: Record<string, Resolver<import("./
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
StoreSearchResult: Record<string, Resolver<{
|
|
104
|
-
searchArgs: Pick<SearchArgs, "hideUnavailableItems" | "query" | "page" | "count" | "sort" | "selectedFacets" | "fuzzy">;
|
|
105
|
-
productSearchPromise: Promise<import("./clients/search/types/ProductSearchResult").ProductSearchResult>;
|
|
106
|
-
}, unknown, any>>;
|
|
107
|
-
StorePropertyValue: Record<string, Resolver<import("../..").IStorePropertyValue, unknown, any>>;
|
|
108
|
-
SkuVariants: Record<string, Resolver<import("./clients/search/types/ProductSearchResult").Item & {
|
|
109
|
-
isVariantOf: import("./clients/search/types/ProductSearchResult").Product;
|
|
110
|
-
} & {
|
|
111
|
-
attachmentsValues?: import("./clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
112
|
-
}, unknown, any>>;
|
|
113
|
-
ShippingSLA: Record<string, Resolver<{
|
|
114
|
-
name?: string | undefined;
|
|
115
|
-
friendlyName?: string | undefined;
|
|
116
|
-
price?: number | undefined;
|
|
117
|
-
shippingEstimate?: string | undefined;
|
|
118
|
-
}, unknown, any>>;
|
|
54
|
+
StoreProductGroup: Record<string, Resolver<import("./resolvers/product").Root, unknown, any>>;
|
|
55
|
+
StoreSearchResult: Record<string, Resolver<import("./resolvers/searchResult").Root, unknown, any>>;
|
|
56
|
+
StorePropertyValue: Record<string, Resolver<import("../..").StorePropertyValue, unknown, any>>;
|
|
57
|
+
SkuVariants: Record<string, Resolver<import("./resolvers/product").Root, unknown, any>>;
|
|
58
|
+
ShippingSLA: Record<string, Resolver<import("./resolvers/shippingSLA").Root, unknown, any>>;
|
|
119
59
|
ObjectOrString: import("graphql").GraphQLScalarType;
|
|
120
60
|
Query: {
|
|
121
61
|
product: (_: unknown, { locator }: import("../..").QueryProductArgs, ctx: Context) => Promise<import("./utils/enhanceSku").EnhancedSku>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { StoreProduct } from './product';
|
|
2
2
|
import type { PromiseType } from '../../../typings';
|
|
3
3
|
import type { Resolver } from '..';
|
|
4
|
-
declare type Root = PromiseType<ReturnType<typeof StoreProduct.offers>>;
|
|
4
|
+
export declare type Root = PromiseType<ReturnType<typeof StoreProduct.offers>>;
|
|
5
5
|
export declare const StoreAggregateOffer: Record<string, Resolver<Root>> & {
|
|
6
6
|
offers: Resolver<Root, any, Root>;
|
|
7
7
|
};
|
|
8
|
-
export {};
|
|
@@ -2,8 +2,7 @@ import type { Resolver } from '..';
|
|
|
2
2
|
import type { Brand } from '../clients/commerce/types/Brand';
|
|
3
3
|
import type { CategoryTree } from '../clients/commerce/types/CategoryTree';
|
|
4
4
|
import type { CollectionPageType } from '../clients/commerce/types/Portal';
|
|
5
|
-
declare type Root = Brand | (CategoryTree & {
|
|
5
|
+
export declare type Root = Brand | (CategoryTree & {
|
|
6
6
|
level: number;
|
|
7
7
|
}) | CollectionPageType;
|
|
8
8
|
export declare const StoreCollection: Record<string, Resolver<Root>>;
|
|
9
|
-
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { FacetValueBoolean, Facet, FacetValueRange } from '../clients/search/types/FacetSearchResult';
|
|
2
2
|
import type { Resolver } from '..';
|
|
3
|
-
declare type Root = Facet;
|
|
3
|
+
export declare type Root = Facet;
|
|
4
4
|
export declare const StoreFacet: Record<string, Resolver<Root>>;
|
|
5
5
|
export declare const StoreFacetBoolean: Record<string, Resolver<Facet<FacetValueBoolean>>>;
|
|
6
6
|
export declare const StoreFacetRange: Record<string, Resolver<Facet<FacetValueRange>>>;
|
|
7
|
-
export {};
|
|
@@ -7,6 +7,6 @@ declare type OrderFormProduct = OrderFormItem & {
|
|
|
7
7
|
product: EnhancedSku;
|
|
8
8
|
};
|
|
9
9
|
declare type SearchProduct = ArrayElementType<ReturnType<typeof StoreAggregateOffer.offers>>;
|
|
10
|
-
declare type Root = SearchProduct | OrderFormProduct;
|
|
10
|
+
export declare type Root = SearchProduct | OrderFormProduct;
|
|
11
11
|
export declare const StoreOffer: Record<string, Resolver<Root>>;
|
|
12
12
|
export {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import type { Resolver } from '..';
|
|
2
|
-
|
|
2
|
+
import { PromiseType } from '../../../typings';
|
|
3
|
+
import { StoreOffer } from './offer';
|
|
4
|
+
export declare type Root = PromiseType<ReturnType<typeof StoreOffer.seller>>;
|
|
5
|
+
export declare const StoreOrganization: Record<string, Resolver<Root>>;
|
|
@@ -4,7 +4,7 @@ import type { PromiseType } from '../../../typings';
|
|
|
4
4
|
import type { Query } from './query';
|
|
5
5
|
import type { Attachment } from '../clients/commerce/types/OrderForm';
|
|
6
6
|
declare type QueryProduct = PromiseType<ReturnType<typeof Query.product>>;
|
|
7
|
-
declare type Root = QueryProduct & {
|
|
7
|
+
export declare type Root = QueryProduct & {
|
|
8
8
|
attachmentsValues?: Attachment[];
|
|
9
9
|
};
|
|
10
10
|
export declare const StoreProduct: Record<string, Resolver<Root>> & {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Resolver } from '..';
|
|
2
2
|
import type { PromiseType } from '../../../typings';
|
|
3
3
|
import type { StoreProduct } from './product';
|
|
4
|
-
declare type Root = PromiseType<ReturnType<typeof StoreProduct.isVariantOf>>;
|
|
4
|
+
export declare type Root = PromiseType<ReturnType<typeof StoreProduct.isVariantOf>>;
|
|
5
5
|
export declare const StoreProductGroup: Record<string, Resolver<Root>>;
|
|
6
|
-
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Resolver } from '..';
|
|
2
|
-
import type {
|
|
3
|
-
declare type Root =
|
|
2
|
+
import type { StorePropertyValue as StorePropertyValueType } from '../../../__generated__/schema';
|
|
3
|
+
export declare type Root = StorePropertyValueType;
|
|
4
4
|
export declare const StorePropertyValue: Record<string, Resolver<Root>>;
|
|
5
|
-
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { Root as StoreAggregateOfferRoot } from './aggregateOffer';
|
|
2
|
+
export type { Root as StorePropertyValueRoot } from './propertyValue';
|
|
3
|
+
export type { Root as StoreCollectionRoot } from './collection';
|
|
4
|
+
export type { Root as StoreFacetRoot } from './facet';
|
|
5
|
+
export type { Root as StoreSearchResultRoot } from './searchResult';
|
|
6
|
+
export type { Root as StoreSeoRoot } from './seo';
|
|
7
|
+
export type { Root as StoreShippingSLARoot } from './shippingSLA';
|
|
8
|
+
export type { Root as StoreOfferRoot } from './offer';
|
|
9
|
+
export type { Root as StoreSkuVariationsRoot } from './skuVariations';
|
|
10
|
+
export type { Root as StoreProductGroupRoot } from './productGroup';
|
|
11
|
+
export type { Root as StoreProductRoot } from './product';
|
|
12
|
+
export type { Root as StoreOrganizationRoot } from './organization';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { Resolver } from '..';
|
|
2
2
|
import type { SearchArgs } from '../clients/search';
|
|
3
3
|
import { ProductSearchResult } from '../clients/search/types/ProductSearchResult';
|
|
4
|
-
declare type Root = {
|
|
4
|
+
export declare type Root = {
|
|
5
5
|
searchArgs: Omit<SearchArgs, 'type'>;
|
|
6
6
|
productSearchPromise: Promise<ProductSearchResult>;
|
|
7
7
|
};
|
|
8
8
|
export declare const StoreSearchResult: Record<string, Resolver<Root>>;
|
|
9
|
-
export {};
|
|
@@ -4,11 +4,10 @@ import type { Resolver } from '..';
|
|
|
4
4
|
* based on https://github.com/vtex-apps/shipping-estimate-translator/blob/13e17055d6353dd3f3f4c31bae77ab049002809b/messages/en.json
|
|
5
5
|
*/
|
|
6
6
|
export declare const getLocalizedEstimates: (estimate: string) => string;
|
|
7
|
-
declare type Root = {
|
|
7
|
+
export declare type Root = {
|
|
8
8
|
name?: string;
|
|
9
9
|
friendlyName?: string;
|
|
10
10
|
price?: number;
|
|
11
11
|
shippingEstimate?: string;
|
|
12
12
|
};
|
|
13
13
|
export declare const ShippingSLA: Record<string, Resolver<Root>>;
|
|
14
|
-
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Resolver } from '..';
|
|
2
2
|
import type { PromiseType } from '../../../typings';
|
|
3
3
|
import type { StoreProduct } from './product';
|
|
4
|
-
declare type Root = PromiseType<ReturnType<typeof StoreProduct.isVariantOf>>;
|
|
4
|
+
export declare type Root = PromiseType<ReturnType<typeof StoreProduct.isVariantOf>>;
|
|
5
5
|
export declare const SkuVariants: Record<string, Resolver<Root>>;
|
|
6
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/api",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-alpha.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@envelop/on-resolve": "^2.0.6",
|
|
26
|
-
"@graphql-tools/schema": "^
|
|
26
|
+
"@graphql-tools/schema": "^9.0.0",
|
|
27
27
|
"@opentelemetry/exporter-logs-otlp-grpc": "^0.39.1",
|
|
28
28
|
"@opentelemetry/exporter-trace-otlp-grpc": "^0.39.1",
|
|
29
29
|
"@opentelemetry/sdk-logs": "^0.39.1",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@envelop/core": "^2.6.0",
|
|
39
|
-
"@faststore/eslint-config": "^2.
|
|
40
|
-
"@faststore/shared": "^2.
|
|
39
|
+
"@faststore/eslint-config": "^2.2.0-alpha.0",
|
|
40
|
+
"@faststore/shared": "^2.2.0-alpha.0",
|
|
41
41
|
"@graphql-codegen/cli": "2.2.0",
|
|
42
42
|
"@graphql-codegen/typescript": "2.2.2",
|
|
43
43
|
"@types/express": "^4.17.16",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"@envelop/core": "^1 || ^2",
|
|
57
57
|
"graphql": "^15.6.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "356e52b6eae13cc4000c6915985009d45e7ae0c6"
|
|
60
60
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { StoreProduct } from './product'
|
|
|
3
3
|
import type { PromiseType } from '../../../typings'
|
|
4
4
|
import type { Resolver } from '..'
|
|
5
5
|
|
|
6
|
-
type Root = PromiseType<ReturnType<typeof StoreProduct.offers>>
|
|
6
|
+
export type Root = PromiseType<ReturnType<typeof StoreProduct.offers>>
|
|
7
7
|
|
|
8
8
|
export const StoreAggregateOffer: Record<string, Resolver<Root>> & {
|
|
9
9
|
offers: Resolver<Root, any, Root>
|
|
@@ -5,7 +5,7 @@ import type { Brand } from '../clients/commerce/types/Brand'
|
|
|
5
5
|
import type { CategoryTree } from '../clients/commerce/types/CategoryTree'
|
|
6
6
|
import type { CollectionPageType } from '../clients/commerce/types/Portal'
|
|
7
7
|
|
|
8
|
-
type Root = Brand | (CategoryTree & { level: number }) | CollectionPageType
|
|
8
|
+
export type Root = Brand | (CategoryTree & { level: number }) | CollectionPageType
|
|
9
9
|
|
|
10
10
|
const isBrand = (x: any): x is Brand | CollectionPageType =>
|
|
11
11
|
x.type === 'brand' ||
|
|
@@ -15,7 +15,7 @@ type OrderFormProduct = OrderFormItem & { product: EnhancedSku }
|
|
|
15
15
|
type SearchProduct = ArrayElementType<
|
|
16
16
|
ReturnType<typeof StoreAggregateOffer.offers>
|
|
17
17
|
>
|
|
18
|
-
type Root = SearchProduct | OrderFormProduct
|
|
18
|
+
export type Root = SearchProduct | OrderFormProduct
|
|
19
19
|
|
|
20
20
|
const isSearchItem = (item: Root): item is SearchProduct =>
|
|
21
21
|
'Price' in item && 'seller' in item && 'product' in item
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Resolver } from '..'
|
|
2
|
+
import { PromiseType } from '../../../typings'
|
|
3
|
+
import { StoreOffer } from './offer'
|
|
2
4
|
|
|
3
|
-
export
|
|
5
|
+
export type Root = PromiseType<ReturnType<typeof StoreOffer.seller>>
|
|
6
|
+
|
|
7
|
+
export const StoreOrganization: Record<string, Resolver<Root>> = {
|
|
4
8
|
identifier: () => '',
|
|
5
9
|
}
|
|
@@ -4,7 +4,7 @@ import type { PromiseType } from '../../../typings'
|
|
|
4
4
|
import type { StoreProduct } from './product'
|
|
5
5
|
import { VALUE_REFERENCES } from '../utils/propertyValue'
|
|
6
6
|
|
|
7
|
-
type Root = PromiseType<ReturnType<typeof StoreProduct.isVariantOf>>
|
|
7
|
+
export type Root = PromiseType<ReturnType<typeof StoreProduct.isVariantOf>>
|
|
8
8
|
|
|
9
9
|
const BLOCKED_SPECIFICATIONS = new Set(['allSpecifications'])
|
|
10
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Resolver } from '..'
|
|
2
|
-
import type {
|
|
2
|
+
import type { StorePropertyValue as StorePropertyValueType } from '../../../__generated__/schema'
|
|
3
3
|
import { getPropertyId } from '../utils/propertyValue'
|
|
4
4
|
|
|
5
|
-
type Root =
|
|
5
|
+
export type Root = StorePropertyValueType
|
|
6
6
|
|
|
7
7
|
export const StorePropertyValue: Record<string, Resolver<Root>> = {
|
|
8
8
|
propertyID: (root) => getPropertyId(root),
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { Root as StoreAggregateOfferRoot } from './aggregateOffer'
|
|
2
|
+
export type { Root as StorePropertyValueRoot } from './propertyValue'
|
|
3
|
+
export type { Root as StoreCollectionRoot } from './collection'
|
|
4
|
+
export type { Root as StoreFacetRoot } from './facet'
|
|
5
|
+
export type { Root as StoreSearchResultRoot } from './searchResult'
|
|
6
|
+
export type { Root as StoreSeoRoot } from './seo'
|
|
7
|
+
export type { Root as StoreShippingSLARoot } from './shippingSLA'
|
|
8
|
+
export type { Root as StoreOfferRoot } from './offer'
|
|
9
|
+
export type { Root as StoreSkuVariationsRoot } from './skuVariations'
|
|
10
|
+
export type { Root as StoreProductGroupRoot } from './productGroup'
|
|
11
|
+
export type { Root as StoreProductRoot } from './product'
|
|
12
|
+
export type { Root as StoreOrganizationRoot } from './organization'
|
|
@@ -4,7 +4,7 @@ import type { SearchArgs } from '../clients/search'
|
|
|
4
4
|
import type { Facet } from '../clients/search/types/FacetSearchResult'
|
|
5
5
|
import { ProductSearchResult } from '../clients/search/types/ProductSearchResult'
|
|
6
6
|
|
|
7
|
-
type Root = {
|
|
7
|
+
export type Root = {
|
|
8
8
|
searchArgs: Omit<SearchArgs, 'type'>
|
|
9
9
|
productSearchPromise: Promise<ProductSearchResult>
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Resolver } from '..'
|
|
2
2
|
|
|
3
|
-
type Root = { title?: string; description?: string; canonical?: string }
|
|
3
|
+
export type Root = { title?: string; description?: string; canonical?: string }
|
|
4
4
|
|
|
5
5
|
export const StoreSeo: Record<string, Resolver<Root>> = {
|
|
6
6
|
title: ({ title }) => title ?? '',
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getVariantsByName,
|
|
9
9
|
} from '../utils/skuVariants'
|
|
10
10
|
|
|
11
|
-
type Root = PromiseType<ReturnType<typeof StoreProduct.isVariantOf>>
|
|
11
|
+
export type Root = PromiseType<ReturnType<typeof StoreProduct.isVariantOf>>
|
|
12
12
|
|
|
13
13
|
type SlugsMapArgs = {
|
|
14
14
|
dominantVariantName: string
|
|
@@ -128,9 +128,7 @@ const joinItems = (form: OrderForm) => {
|
|
|
128
128
|
const [item] = items
|
|
129
129
|
const quantity = items.reduce((acc, i) => acc + i.quantity, 0)
|
|
130
130
|
const totalPrice = items.reduce(
|
|
131
|
-
(acc, i) =>
|
|
132
|
-
acc +
|
|
133
|
-
(i?.priceDefinition?.total ?? (i?.quantity ?? 0) * (i?.sellingPrice ?? 0)),
|
|
131
|
+
(acc, i) => acc + i.quantity * i.sellingPrice,
|
|
134
132
|
0
|
|
135
133
|
)
|
|
136
134
|
|