@faststore/api 1.12.29 → 2.0.0-alpha
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/__generated__/schema.d.ts +0 -199
- package/dist/api.cjs.development.js +52 -152
- 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 +52 -152
- package/dist/api.esm.js.map +1 -1
- package/dist/index.d.ts +0 -23
- package/dist/platforms/vtex/clients/commerce/index.d.ts +0 -2
- package/dist/platforms/vtex/clients/commerce/types/Simulation.d.ts +2 -2
- package/dist/platforms/vtex/clients/index.d.ts +0 -1
- package/dist/platforms/vtex/index.d.ts +0 -23
- package/dist/platforms/vtex/loaders/index.d.ts +1 -1
- package/dist/platforms/vtex/loaders/simulation.d.ts +2 -2
- package/dist/platforms/vtex/resolvers/query.d.ts +1 -18
- package/package.json +3 -3
- package/dist/platforms/vtex/clients/commerce/types/Address.d.ts +0 -16
- package/dist/platforms/vtex/resolvers/shippingSLA.d.ts +0 -14
package/dist/index.d.ts
CHANGED
|
@@ -78,12 +78,6 @@ export declare const getResolvers: (options: Options) => {
|
|
|
78
78
|
} & {
|
|
79
79
|
attachmentsValues?: import("./platforms/vtex/clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
80
80
|
}, unknown, any>>;
|
|
81
|
-
ShippingSLA: Record<string, import("./platforms/vtex").Resolver<{
|
|
82
|
-
name?: string | undefined;
|
|
83
|
-
friendlyName?: string | undefined;
|
|
84
|
-
price?: number | undefined;
|
|
85
|
-
shippingEstimate?: string | undefined;
|
|
86
|
-
}, unknown, any>>;
|
|
87
81
|
ObjectOrString: import("graphql").GraphQLScalarType;
|
|
88
82
|
Query: {
|
|
89
83
|
product: (_: unknown, { locator }: import("./__generated__/schema").QueryProductArgs, ctx: import("./platforms/vtex").Context) => Promise<import("./platforms/vtex/utils/enhanceSku").EnhancedSku>;
|
|
@@ -134,23 +128,6 @@ export declare const getResolvers: (options: Options) => {
|
|
|
134
128
|
cursor: string;
|
|
135
129
|
}[];
|
|
136
130
|
}>;
|
|
137
|
-
shipping: (_: unknown, { country, items, postalCode }: import("./__generated__/schema").QueryShippingArgs, ctx: import("./platforms/vtex").Context) => Promise<{
|
|
138
|
-
address: import("./platforms/vtex/clients/commerce/types/Address").Address;
|
|
139
|
-
items: import("./platforms/vtex/clients/commerce/types/Simulation").Item[];
|
|
140
|
-
ratesAndBenefitsData: import("./platforms/vtex/clients/commerce/types/Simulation").RatesAndBenefitsData;
|
|
141
|
-
paymentData: import("./platforms/vtex/clients/commerce/types/Simulation").PaymentData;
|
|
142
|
-
selectableGifts: any[];
|
|
143
|
-
marketingData: import("./platforms/vtex/clients/commerce/types/Simulation").MarketingData;
|
|
144
|
-
postalCode: null;
|
|
145
|
-
country: null;
|
|
146
|
-
logisticsInfo: import("./platforms/vtex/clients/commerce/types/Simulation").LogisticsInfo[];
|
|
147
|
-
messages: any[];
|
|
148
|
-
purchaseConditions: import("./platforms/vtex/clients/commerce/types/Simulation").PurchaseConditions;
|
|
149
|
-
pickupPoints: any[];
|
|
150
|
-
subscriptionData: null;
|
|
151
|
-
totals: import("./platforms/vtex/clients/commerce/types/Simulation").Total[];
|
|
152
|
-
itemMetadata: null;
|
|
153
|
-
}>;
|
|
154
131
|
};
|
|
155
132
|
Mutation: {
|
|
156
133
|
validateCart: (_: unknown, { cart: { order }, session }: import("./__generated__/schema").MutationValidateCartArgs, ctx: import("./platforms/vtex").Context) => Promise<{
|
|
@@ -11,7 +11,6 @@ import type { Session } from './types/Session';
|
|
|
11
11
|
import type { Channel } from '../../utils/channel';
|
|
12
12
|
import type { SalesChannel } from './types/SalesChannel';
|
|
13
13
|
import { MasterDataResponse } from './types/Newsletter';
|
|
14
|
-
import type { Address, AddressInput } from './types/Address';
|
|
15
14
|
declare type ValueOf<T> = T extends Record<string, infer K> ? K : never;
|
|
16
15
|
export declare const VtexCommerce: ({ account, environment }: Options, ctx: Context) => {
|
|
17
16
|
catalog: {
|
|
@@ -57,7 +56,6 @@ export declare const VtexCommerce: ({ account, environment }: Options, ctx: Cont
|
|
|
57
56
|
value: string;
|
|
58
57
|
}) => Promise<OrderForm>;
|
|
59
58
|
region: ({ postalCode, country, salesChannel, }: RegionInput) => Promise<Region>;
|
|
60
|
-
address: ({ postalCode, country, }: AddressInput) => Promise<Address>;
|
|
61
59
|
};
|
|
62
60
|
session: (search: string) => Promise<Session>;
|
|
63
61
|
subscribeToNewsletter: (data: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface PayloadItem {
|
|
2
2
|
id: string;
|
|
3
3
|
quantity: number;
|
|
4
4
|
seller: string;
|
|
@@ -12,7 +12,7 @@ export interface ShippingData {
|
|
|
12
12
|
}
|
|
13
13
|
export interface SimulationArgs {
|
|
14
14
|
country?: string;
|
|
15
|
-
items:
|
|
15
|
+
items: PayloadItem[];
|
|
16
16
|
postalCode?: string;
|
|
17
17
|
isCheckedIn?: boolean;
|
|
18
18
|
priceTables?: string[];
|
|
@@ -51,7 +51,6 @@ export declare const getClients: (options: Options, ctx: Context) => {
|
|
|
51
51
|
value: string;
|
|
52
52
|
}) => Promise<import("./commerce/types/OrderForm").OrderForm>;
|
|
53
53
|
region: ({ postalCode, country, salesChannel, }: import("./commerce/types/Region").RegionInput) => Promise<import("./commerce/types/Region").Region>;
|
|
54
|
-
address: ({ postalCode, country, }: import("./commerce/types/Address").AddressInput) => Promise<import("./commerce/types/Address").Address>;
|
|
55
54
|
};
|
|
56
55
|
session: (search: string) => Promise<import("./commerce/types/Session").Session>;
|
|
57
56
|
subscribeToNewsletter: (data: {
|
|
@@ -106,12 +106,6 @@ export declare const getResolvers: (_: Options) => {
|
|
|
106
106
|
} & {
|
|
107
107
|
attachmentsValues?: import("./clients/commerce/types/OrderForm").Attachment[] | undefined;
|
|
108
108
|
}, unknown, any>>;
|
|
109
|
-
ShippingSLA: Record<string, Resolver<{
|
|
110
|
-
name?: string | undefined;
|
|
111
|
-
friendlyName?: string | undefined;
|
|
112
|
-
price?: number | undefined;
|
|
113
|
-
shippingEstimate?: string | undefined;
|
|
114
|
-
}, unknown, any>>;
|
|
115
109
|
ObjectOrString: import("graphql").GraphQLScalarType;
|
|
116
110
|
Query: {
|
|
117
111
|
product: (_: unknown, { locator }: import("../..").QueryProductArgs, ctx: Context) => Promise<import("./utils/enhanceSku").EnhancedSku>;
|
|
@@ -162,23 +156,6 @@ export declare const getResolvers: (_: Options) => {
|
|
|
162
156
|
cursor: string;
|
|
163
157
|
}[];
|
|
164
158
|
}>;
|
|
165
|
-
shipping: (_: unknown, { country, items, postalCode }: import("../..").QueryShippingArgs, ctx: Context) => Promise<{
|
|
166
|
-
address: import("./clients/commerce/types/Address").Address;
|
|
167
|
-
items: import("./clients/commerce/types/Simulation").Item[];
|
|
168
|
-
ratesAndBenefitsData: import("./clients/commerce/types/Simulation").RatesAndBenefitsData;
|
|
169
|
-
paymentData: import("./clients/commerce/types/Simulation").PaymentData;
|
|
170
|
-
selectableGifts: any[];
|
|
171
|
-
marketingData: import("./clients/commerce/types/Simulation").MarketingData;
|
|
172
|
-
postalCode: null;
|
|
173
|
-
country: null;
|
|
174
|
-
logisticsInfo: import("./clients/commerce/types/Simulation").LogisticsInfo[];
|
|
175
|
-
messages: any[];
|
|
176
|
-
purchaseConditions: import("./clients/commerce/types/Simulation").PurchaseConditions;
|
|
177
|
-
pickupPoints: any[];
|
|
178
|
-
subscriptionData: null;
|
|
179
|
-
totals: import("./clients/commerce/types/Simulation").Total[];
|
|
180
|
-
itemMetadata: null;
|
|
181
|
-
}>;
|
|
182
159
|
};
|
|
183
160
|
Mutation: {
|
|
184
161
|
validateCart: (_: unknown, { cart: { order }, session }: import("../..").MutationValidateCartArgs, ctx: Context) => Promise<{
|
|
@@ -2,7 +2,7 @@ import type { Context, Options } from '..';
|
|
|
2
2
|
export declare type Loaders = ReturnType<typeof getLoaders>;
|
|
3
3
|
export declare const getLoaders: (options: Options, { clients }: Context) => {
|
|
4
4
|
skuLoader: import("dataloader")<string, import("../utils/enhanceSku").EnhancedSku, string>;
|
|
5
|
-
simulationLoader: import("dataloader")<import("../clients/commerce/types/Simulation").
|
|
5
|
+
simulationLoader: import("dataloader")<import("../clients/commerce/types/Simulation").PayloadItem[], import("../clients/commerce/types/Simulation").Simulation, import("../clients/commerce/types/Simulation").PayloadItem[]>;
|
|
6
6
|
collectionLoader: import("dataloader")<string, import("../clients/commerce/types/Portal").CollectionPageType, string>;
|
|
7
7
|
salesChannelLoader: import("dataloader")<string, import("../clients/commerce/types/SalesChannel").SalesChannel, string>;
|
|
8
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import DataLoader from 'dataloader';
|
|
2
|
+
import type { PayloadItem, Simulation } from '../clients/commerce/types/Simulation';
|
|
2
3
|
import type { Options } from '..';
|
|
3
4
|
import type { Clients } from '../clients';
|
|
4
|
-
|
|
5
|
-
export declare const getSimulationLoader: (_: Options, clients: Clients) => DataLoader<SimulationArgs, Simulation, SimulationArgs>;
|
|
5
|
+
export declare const getSimulationLoader: (_: Options, clients: Clients) => DataLoader<PayloadItem[], Simulation, PayloadItem[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { QueryAllCollectionsArgs, QueryAllProductsArgs, QueryCollectionArgs, QueryProductArgs, QuerySearchArgs
|
|
1
|
+
import type { QueryAllCollectionsArgs, QueryAllProductsArgs, QueryCollectionArgs, QueryProductArgs, QuerySearchArgs } from "../../../__generated__/schema";
|
|
2
2
|
import type { CategoryTree } from "../clients/commerce/types/CategoryTree";
|
|
3
3
|
import type { Context } from "../index";
|
|
4
4
|
export declare const Query: {
|
|
@@ -50,21 +50,4 @@ export declare const Query: {
|
|
|
50
50
|
cursor: string;
|
|
51
51
|
}[];
|
|
52
52
|
}>;
|
|
53
|
-
shipping: (_: unknown, { country, items, postalCode }: QueryShippingArgs, ctx: Context) => Promise<{
|
|
54
|
-
address: import("../clients/commerce/types/Address").Address;
|
|
55
|
-
items: import("../clients/commerce/types/Simulation").Item[];
|
|
56
|
-
ratesAndBenefitsData: import("../clients/commerce/types/Simulation").RatesAndBenefitsData;
|
|
57
|
-
paymentData: import("../clients/commerce/types/Simulation").PaymentData;
|
|
58
|
-
selectableGifts: any[];
|
|
59
|
-
marketingData: import("../clients/commerce/types/Simulation").MarketingData;
|
|
60
|
-
postalCode: null;
|
|
61
|
-
country: null;
|
|
62
|
-
logisticsInfo: import("../clients/commerce/types/Simulation").LogisticsInfo[];
|
|
63
|
-
messages: any[];
|
|
64
|
-
purchaseConditions: import("../clients/commerce/types/Simulation").PurchaseConditions;
|
|
65
|
-
pickupPoints: any[];
|
|
66
|
-
subscriptionData: null;
|
|
67
|
-
totals: import("../clients/commerce/types/Simulation").Total[];
|
|
68
|
-
itemMetadata: null;
|
|
69
|
-
}>;
|
|
70
53
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/api",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"p-limit": "^3.1.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@faststore/shared": "^
|
|
33
|
+
"@faststore/shared": "^2.0.0-alpha",
|
|
34
34
|
"@graphql-codegen/cli": "2.2.0",
|
|
35
35
|
"@graphql-codegen/typescript": "2.2.2",
|
|
36
36
|
"concurrently": "^6.2.1",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"graphql": "^15.6.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "71167bb5499089e4c47a10612be30929c3e25361"
|
|
50
50
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface AddressInput {
|
|
2
|
-
postalCode: string;
|
|
3
|
-
country: string;
|
|
4
|
-
}
|
|
5
|
-
export interface Address {
|
|
6
|
-
postalCode: string;
|
|
7
|
-
city: string;
|
|
8
|
-
state: string;
|
|
9
|
-
country: string;
|
|
10
|
-
street: string;
|
|
11
|
-
number: string;
|
|
12
|
-
neighborhood: string;
|
|
13
|
-
complement: string;
|
|
14
|
-
reference: string;
|
|
15
|
-
geoCoordinates: [number];
|
|
16
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Resolver } from '..';
|
|
2
|
-
/**
|
|
3
|
-
* Transforms estimate (e.g 3bd) into friendly format (e.g Up to 3 business days)
|
|
4
|
-
* based on https://github.com/vtex-apps/shipping-estimate-translator/blob/13e17055d6353dd3f3f4c31bae77ab049002809b/messages/en.json
|
|
5
|
-
*/
|
|
6
|
-
export declare const getLocalizedEstimates: (estimate: string) => string;
|
|
7
|
-
declare type Root = {
|
|
8
|
-
name?: string;
|
|
9
|
-
friendlyName?: string;
|
|
10
|
-
price?: number;
|
|
11
|
-
shippingEstimate?: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const ShippingSLA: Record<string, Resolver<Root>>;
|
|
14
|
-
export {};
|