import type { Clients } from './clients'; import type { SearchArgs } from './clients/search'; import type { Loaders } from './loaders'; import type { Channel } from './utils/channel'; export interface Options { platform: 'vtex'; account: string; environment: 'vtexcommercestable' | 'vtexcommercebeta'; subDomainPrefix: string[]; channel: string; locale: string; hideUnavailableItems: boolean; simulationBehavior?: 'default' | 'skip' | 'only1P'; showSponsored: boolean; incrementAddress: boolean; flags?: FeatureFlags; } interface FeatureFlags { enableOrderFormSync?: boolean; enableUnavailableItemsOnCart?: boolean; } export interface Context { clients: Clients; loaders: Loaders; /** * @description Storage updated at each request. * * Use this datastructure to store and share small values in the context. * Use it with caution since dependecy injection leads to a more complex code * */ storage: { channel: Required; locale: string; flags: FeatureFlags; searchArgs?: Omit; cookies: Map>; }; headers: Record; account: string; } export type Resolver = (root: R, args: A, ctx: Context, info: any) => Return; export declare const getContextFactory: (options: Options) => (ctx: any) => Context; export declare const getResolvers: (_: Options) => { StoreCollection: Record>; StoreAggregateOffer: Record[]>> & { offers: Resolver[], any, import("./utils/enhanceCommercialOffer").EnhancedCommercialOffer[]>; }; StoreProduct: Record> & { offers: Resolver[]>; isVariantOf: Resolver; image: Resolver; }; StoreSeo: Record>; StoreFacet: Record>; StoreFacetBoolean: Record>>; StoreFacetRange: Record>>; StoreFacetValueBoolean: Record>; StoreOffer: Record>; StoreAggregateRating: Record; StoreReview: Record; StoreProductGroup: Record>; StoreSearchResult: Record>; StorePropertyValue: Record>; SkuVariants: Record>; ShippingSLA: Record>; UserOrderResult: Record | undefined; creationDate: import("../..").Maybe | undefined; totals: import("../..").Maybe[]> | undefined; items: import("../..").Maybe[]> | undefined; shippingData: import("../..").Maybe | undefined; paymentData: import("../..").Maybe | undefined; customData: import("../..").Maybe | undefined; status: import("../..").Maybe | undefined; statusDescription: import("../..").Maybe | undefined; allowCancellation: import("../..").Maybe | undefined; storePreferencesData: import("../..").Maybe | undefined; clientProfileData: import("../..").Maybe | undefined; canProcessOrderAuthorization: boolean; ruleForAuthorization: import("../..").ProcessOrderAuthorizationRule | null; shopper: { firstName: string; lastName: string; email: string; phone: string; }; budgetData: import("../..").UserOrderBudgetData; }>>; ObjectOrString: import("graphql").GraphQLScalarType; Query: { product: (_: unknown, { locator }: import("../..").QueryProductArgs, ctx: Context) => Promise; collection: (_: unknown, { slug }: import("../..").QueryCollectionArgs, ctx: Context) => Promise; search: (_: unknown, { first, after: maybeAfter, sort, term, selectedFacets, sponsoredCount, }: import("../..").QuerySearchArgs, ctx: Context) => Promise<{ searchArgs: Omit; productSearchPromise: Promise; }>; allProducts: (_: unknown, { first, after: maybeAfter }: import("../..").QueryAllProductsArgs, ctx: Context) => Promise<{ pageInfo: { hasNextPage: boolean; hasPreviousPage: boolean; startCursor: string; endCursor: string; totalCount: number; }; edges: { node: import("./utils/enhanceSku").EnhancedSku; cursor: string; }[]; }>; products: (_: unknown, { productIds }: import("../..").QueryProductsArgs, ctx: Context) => Promise; allCollections: (_: unknown, { first, after: maybeAfter }: import("../..").QueryAllCollectionsArgs, ctx: Context) => Promise<{ pageInfo: { hasNextPage: boolean; hasPreviousPage: boolean; startCursor: string; endCursor: string; totalCount: number; }; edges: { node: { type: string; id: number; name: string; isActive: boolean; title: string; metaTagDescription: string; imageURL: string | null; } | (import("./clients/commerce/types/CategoryTree").CategoryTree & { level: number; }); cursor: string; }[]; }>; shipping: (_: unknown, { country, items, postalCode }: import("../..").QueryShippingArgs, ctx: Context) => Promise<{ address: import("./clients/commerce/types/Address").Address; items: import("./clients/commerce/types/Simulation").Item[]; ratesAndBenefitsData: import("./clients/commerce/types/Simulation").RatesAndBenefitsData; paymentData: import("./clients/commerce/types/Simulation").PaymentData; selectableGifts: any[]; marketingData: import("./clients/commerce/types/Simulation").MarketingData; postalCode: null; country: null; logisticsInfo: import("./clients/commerce/types/Simulation").LogisticsInfo[]; messages: any[]; purchaseConditions: import("./clients/commerce/types/Simulation").PurchaseConditions; pickupPoints: any[]; subscriptionData: null; totals: import("./clients/commerce/types/Simulation").Total[]; itemMetadata: null; }>; redirect: (_: unknown, { term, selectedFacets }: import("../..").QueryRedirectArgs, ctx: Context) => Promise<{ url: string | undefined; } | null>; sellers: (_: unknown, { postalCode, geoCoordinates, country, salesChannel }: import("../..").QuerySellersArgs, ctx: Context) => Promise<{ id: string; sellers: import("./clients/commerce/types/Region").Seller[]; }>; profile: (_: unknown, { id }: import("../..").QueryProfileArgs, ctx: Context) => Promise<{ addresses: import("./clients/commerce/types/Profile").ProfileAddress[]; }>; productCount: (_: unknown, { term }: import("../..").QueryProductCountArgs, ctx: Context) => Promise; userOrder: (_: unknown, { orderId }: import("../..").QueryUserOrderArgs, ctx: Context) => Promise<{ orderId: import("../..").Maybe | undefined; creationDate: import("../..").Maybe | undefined; totals: import("../..").Maybe[]> | undefined; items: import("../..").Maybe[]> | undefined; shippingData: import("../..").Maybe | undefined; paymentData: import("../..").Maybe | undefined; customData: import("../..").Maybe | undefined; status: import("../..").Maybe | undefined; statusDescription: import("../..").Maybe | undefined; allowCancellation: import("../..").Maybe | undefined; storePreferencesData: import("../..").Maybe | undefined; clientProfileData: import("../..").Maybe | undefined; canProcessOrderAuthorization: boolean; ruleForAuthorization: import("../..").ProcessOrderAuthorizationRule | null; shopper: { firstName: string; lastName: string; email: string; phone: string; }; budgetData: import("../..").UserOrderBudgetData; }>; listUserOrders: (_: unknown, filters: import("../..").QueryListUserOrdersArgs, ctx: Context) => Promise<{ list: { orderId: import("../..").Maybe | undefined; creationDate: import("../..").Maybe | undefined; clientName: import("../..").Maybe | undefined; items: import("../..").Maybe[]> | undefined; totalValue: import("../..").Maybe | undefined; status: import("../..").Maybe | undefined; statusDescription: import("../..").Maybe | undefined; ShippingEstimatedDate: import("../..").Maybe | undefined; customFields: import("../..").Maybe[]> | undefined; currencyCode: import("../..").Maybe | undefined; }[] | undefined; paging: import("../..").Maybe | undefined; }>; validateUser: (_: unknown, __: unknown, _ctx: Context) => Promise<{ isValid: boolean; }>; userDetails: (_: unknown, __: unknown, ctx: Context) => Promise<{ name: string; email: string; role: string[]; orgUnit: string; }>; accountProfile: (_: unknown, __: unknown, ctx: Context) => Promise<{ name: string; email: string; id: string; } | null>; pickupPoints: (_: unknown, { geoCoordinates }: import("../..").QueryPickupPointsArgs, ctx: Context) => Promise; }; Mutation: { validateCart: (_: unknown, { cart: { order }, session }: import("../..").MutationValidateCartArgs, ctx: Context) => Promise<{ order: { orderNumber: string; acceptedOffer: Promise<{ product: import("./utils/enhanceSku").EnhancedSku; id: string; name: string; detailUrl: string; imageUrl: string; skuName: string; quantity: number; uniqueId: string; productId: string; refId: string; ean: string; priceValidUntil: string; price: number; tax: number; listPrice: number; sellingPrice: number; rewardValue: number; isGift: boolean; parentItemIndex: number | null; parentAssemblyBinding: string | null; productCategoryIds: string; priceTags: string[]; manualPrice: number | null; measurementUnit: string; additionalInfo: { brandName: string; brandId: string; offeringInfo: any; offeringType: any; offeringTypeId: any; }; productCategories: Record; productRefId: string; seller: string; sellerChain: string[]; availability: string; unitMultiplier: number; skuSpecifications?: import("./clients/commerce/types/OrderForm").SKUSpecification[] | null | undefined; priceDefinition: { calculatedSellingPrice: number; sellingPrices: import("./clients/commerce/types/OrderForm").SellingPrice[]; total: number; }; attachments: import("./clients/commerce/types/OrderForm").Attachment[]; }>[]; shouldSplitItem: boolean | null | undefined; }; messages: { text: any; status: any; }[]; } | null>; validateSession: (_: any, { session: oldSession, search }: import("../..").MutationValidateSessionArgs, { clients, headers, account }: Context) => Promise; subscribeToNewsletter: (_: any, { data }: import("../..").MutationSubscribeToNewsletterArgs, { clients: { commerce } }: Context) => Promise; cancelOrder: (_: any, { data }: import("../..").MutationCancelOrderArgs, { clients: { commerce } }: Context) => Promise; processOrderAuthorization: (_: any, { data }: { data: import("../..").IProcessOrderAuthorization; }, { clients: { commerce } }: Context) => Promise; }; }; export {}; //# sourceMappingURL=index.d.ts.map