Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@faststore/api

Package Overview
Dependencies
Maintainers
13
Versions
442
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@faststore/api - npm Package Compare versions

Comparing version 1.3.6 to 1.3.7

dist/platforms/vtex/utils/errors.d.ts

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## 1.3.7 (2021-12-01)
**Note:** Version bump only for package @faststore/api
## 1.3.6 (2021-11-26)

@@ -8,0 +16,0 @@

2

dist/api.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("@graphql-tools/schema"),i=e(require("isomorphic-unfetch")),t=e(require("dataloader")),a=e(require("@sindresorhus/slugify")),d=e(require("fast-deep-equal")),r=require("graphql");const l=async(e,n)=>{const t=await i(e,n);if(t.ok)return t.json();const a=await t.text();throw new Error(a)},o={method:"POST",headers:{"content-type":"application/json"}},m=({account:e,environment:n},i)=>{const t=`http://portal.${n}.com.br/search-api/v1/${e}`,a={key:"trade-policy",value:i.storage.channel},d=({query:e="",page:n,count:i,sort:d="",selectedFacets:r=[],type:o,fuzzy:m="0"})=>{const u=new URLSearchParams({page:(n+1).toString(),count:i.toString(),query:e,sort:d,fuzzy:m}),s=(p=r,void 0===p.find(({key:e})=>e===a.key)?[...p,a]:p).map(({key:e,value:n})=>`${e}/${n}`).join("/");var p;return l(`${t}/api/split/${o}/${s}?${u.toString()}`)};return{facets:e=>d({...e,type:"attribute_search"}),products:e=>d({...e,type:"product_search"})}},u=(e,n)=>({...e,isVariantOf:n}),s=e=>a(e,{separator:"-",lowercase:!0}),p=e=>"brand"===e.type,c=e=>"string"==typeof e.pageType,k={id:({id:e})=>e.toString(),slug:({name:e})=>s(e),seo:e=>p(e)||c(e)?{title:e.title,description:e.metaTagDescription}:{title:e.Title,description:e.MetaTagDescription},type:e=>p(e)?"Brand":c(e)?e.pageType:0===e.level?"Department":"Category",meta:e=>p(e)?{selectedFacets:[{key:"brand",value:s(e.name)}]}:{selectedFacets:new URL(c(e)?"https://"+e.url:e.url).pathname.slice(1).split("/").map((e,n)=>({key:"category-"+(n+1),value:s(e)}))},breadcrumbList:()=>({itemListElement:[],numberOfItems:0})},y=e=>[e.itemOffered.sku,e.seller.identifier,e.price].join("::"),N=(e,n)=>({listPrice:e.listPrice/100,price:e.sellingPrice/100,quantity:e.quantity,seller:{identifier:e.seller},itemOffered:{sku:e.id,image:[],name:e.name},index:n}),v=e=>({quantity:e.quantity,seller:e.seller.identifier,id:e.itemOffered.sku,index:e.index}),f=e=>e.reduce((e,n)=>{var i;const t=y(n);return e.set(t,null!=(i=e.get(t))?i:n),e},new Map),g={name:"image",value:"https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg"},S=(e,n)=>`${e}-${n}`,T=(e,n)=>`/${S(e,n)}/p`,D=e=>Array.isArray(e)&&e.length>0?e:null,h=e=>{const n=e.split("-").pop();if(null==n)throw new Error("Error while extracting sku id from product slug");return n},F=({key:e,value:n})=>{switch(e){case"channel":return{key:"trade-policy",value:n};case"slug":return{key:"id",value:h(n)};default:return{key:e,value:n}}},O={price_desc:"price:desc",price_asc:"price:asc",orders_desc:"orders:desc",name_desc:"name:desc",name_asc:"name:asc",release_desc:"release:desc",discount_desc:"discount:desc",score_desc:""},I={product:async(e,{locator:n},i)=>{var t,a;i.storage={...i.storage,channel:null!=(t=null==(a=n.find(e=>"channel"===e.key))?void 0:a.value)?t:i.storage.channel};const{loaders:{skuLoader:d}}=i;return d.load(n.map(F))},collection:async(e,{slug:n},i)=>{const{clients:{commerce:t}}=i;return t.catalog.portal.pagetype(n)},search:async(e,{first:n,after:i,sort:t,term:a,selectedFacets:d},r)=>{var l,o,m;r.storage={...r.storage,channel:null!=(l=null==d||null==(o=d.find(e=>"channel"===e.key))?void 0:o.value)?l:r.storage.channel};const u=i?Number(i):0;return{page:Math.ceil(u/n),count:n,query:a,sort:O[null!=t?t:"score_desc"],selectedFacets:null!=(m=null==d?void 0:d.map(F))?m:[]}},allProducts:async(e,{first:n,after:i},t)=>{const{clients:{search:a}}=t,d=i?Number(i):0,r=await a.products({page:Math.ceil(d/n),count:n}),l=r.products.map(e=>e.skus.map(n=>u(n,e))).flat().filter(e=>e.sellers.length>0);return{pageInfo:{hasNextPage:r.pagination.after.length>0,hasPreviousPage:r.pagination.before.length>0,startCursor:"0",endCursor:r.total.toString(),totalCount:r.total},edges:l.map((e,n)=>({node:e,cursor:(d+n).toString()}))}},allCollections:async(e,n,i)=>{const{clients:{commerce:t}}=i,[a,d]=await Promise.all([t.catalog.brand.list(),t.catalog.category.tree()]),r=[],l=(e,n)=>{r.push({...e,level:n});for(const i of e.children)l(i,n+1)};for(const e of d)l(e,0);return{pageInfo:{hasNextPage:!1,hasPreviousPage:!1,startCursor:"0",endCursor:"0"},edges:[...a.map(e=>({...e,type:"brand"})),...r].filter(e=>Boolean(k.slug(e,null,i,null))).map((e,n)=>({node:e,cursor:n.toString()}))}}},b={StoreCollection:k,StoreAggregateOffer:{highPrice:({items:e})=>{var n,i;return e.reduce((e,n)=>e>n.sellingPrice?e:n.sellingPrice,null!=(n=null==(i=e[0])?void 0:i.sellingPrice)?n:0)/100},lowPrice:({items:e})=>{var n,i;return e.reduce((e,n)=>e<n.sellingPrice?e:n.sellingPrice,null!=(n=null==(i=e[0])?void 0:i.sellingPrice)?n:0)/100},offerCount:({items:e})=>e.length,priceCurrency:()=>"",offers:({items:e,product:n})=>e.map(e=>({...e,product:n}))},StoreProduct:{productID:({id:e})=>e,name:({isVariantOf:e,name:n})=>null!=n?n:e.name,slug:({isVariantOf:{link:e},id:n})=>S(e,n),description:({isVariantOf:{description:e}})=>e,seo:({isVariantOf:{name:e,description:n}})=>({title:e,description:n}),brand:({isVariantOf:{brand:e}})=>({name:e}),breadcrumbList:({isVariantOf:{categoryTrees:e,name:n,link:i},id:t})=>({itemListElement:[...e.map(({categoryNames:e},n)=>({name:e[e.length-1],item:"/"+e.join("/").toLowerCase(),position:n+1})),{name:n,item:T(i,t),position:e.length+1}],numberOfItems:e.length}),image:({isVariantOf:e,images:n})=>{var i,t;return(null!=(i=null!=(t=D(n))?t:D(e.images))?i:[g]).map(({name:e,value:n})=>({alternateName:null!=e?e:"",url:n.replace("vteximg.com.br","vtexassets.com")}))},sku:({isVariantOf:{skus:[e]}})=>e.id,gtin:({reference:e})=>null!=e?e:"",review:()=>[],aggregateRating:()=>({}),offers:async(e,n,i)=>{var t;const{loaders:{simulationLoader:a},storage:{channel:d}}=i,{id:r,policies:l}=e,o=null==(t=l.find(e=>e.id===d))?void 0:t.sellers;if(null==o)throw new Error(`Product with id ${r} has no sellers for channel ${d}.`);const m=o.map(e=>e.id),u=Array.from(new Set(m)).map(e=>({quantity:1,seller:e,id:r}));return{...await a.load(u),product:e}},isVariantOf:({isVariantOf:e})=>e},StoreSeo:{title:({title:e})=>null!=e?e:"",description:({description:e})=>null!=e?e:"",titleTemplate:()=>"",canonical:()=>""},StoreFacet:{key:({key:e})=>e,label:({label:e})=>e,values:({values:e})=>e,type:({type:e})=>"text"===e?"BOOLEAN":"RANGE"},StoreFacetValue:{value:({key:e,from:n,to:i})=>null!=e?e:`${n}-to-${i}`,label:({label:e})=>null!=e?e:"unknown",selected:({active:e})=>e,quantity:({count:e})=>e},StoreOffer:{priceCurrency:()=>"",priceValidUntil:({priceValidUntil:e})=>null!=e?e:"",itemCondition:()=>"https://schema.org/NewCondition",availability:({availability:e})=>"available"===e?"https://schema.org/InStock":"https://schema.org/OutOfStock",seller:({seller:e})=>({identifier:e}),price:({sellingPrice:e})=>e/100,sellingPrice:({sellingPrice:e})=>e/100,listPrice:({listPrice:e})=>e/100,itemOffered:({product:e})=>e,quantity:({quantity:e})=>e},StoreAggregateRating:{ratingValue:()=>5,reviewCount:()=>0},StoreReview:{reviewRating:()=>({ratingValue:5,bestRating:5}),author:()=>({name:""})},StoreProductGroup:{hasVariant:e=>e.skus.map(n=>u(n,e)),productGroupID:({product:e})=>e,name:({name:e})=>e},StoreSearchResult:{products:async(e,n,i)=>{const{clients:{search:t}}=i,a=await t.products(e),d=a.products.map(e=>{const n=e.skus.find(e=>e.sellers.length>0);return n&&u(n,e)}).filter(e=>!!e);return{pageInfo:{hasNextPage:a.pagination.after.length>0,hasPreviousPage:a.pagination.before.length>0,startCursor:"0",endCursor:a.total.toString(),totalCount:a.total},edges:d.map((e,n)=>({node:e,cursor:n.toString()}))}},facets:async(e,n,i)=>{const{clients:{search:t}}=i;return(await t.facets(e)).attributes}},Query:I,Mutation:{validateCart:async(e,{cart:{order:{orderNumber:n,acceptedOffer:i}}},t)=>{const{clients:{commerce:a},loaders:{skuLoader:r}}=t,l=await a.checkout.orderForm({id:n}),o=f(i),m=f(l.items.map(N)),u=Array.from(o.values()),s=Array.from(m.values()),{itemsToAdd:p,itemsToUpdate:c}=u.reduce((e,n)=>{const i=m.get(y(n));return i?e.itemsToUpdate.push({...i,quantity:n.quantity}):e.itemsToAdd.push(n),e},{itemsToAdd:[],itemsToUpdate:[]}),k=[...p,...c,...s.filter(e=>!o.has(y(e))).map(e=>({...e,quantity:0}))].map(v);if(0===k.length)return null;const g=await a.checkout.updateOrderFormItems({id:l.orderFormId,orderItems:k});return((e,n)=>{const i=({orderFormId:e,messages:n,items:i,salesChannel:t})=>({orderFormId:e,messages:n,salesChannel:t,items:i.map(({uniqueId:e,quantity:n,seller:i,sellingPrice:t,availability:a})=>({uniqueId:e,quantity:n,seller:i,sellingPrice:t,availability:a}))});return d(i(e),i(n))})(l,g)?null:{order:{orderNumber:g.orderFormId,acceptedOffer:g.items.map(e=>({...e,product:r.load([{key:"id",value:e.id}])}))},messages:g.messages.map(({text:e,status:n})=>({text:e,status:n.toUpperCase()}))}}}};var C={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreAggregateOffer"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"highPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"lowPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"offerCount"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"priceCurrency"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"offers"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOffer"}}}}},directives:[]}]}],loc:{start:0,end:261}};C.loc.source={body:"type StoreAggregateOffer {\n # Highest spot price amongst all sellers\n highPrice: Float!\n # Lowest spot price amongst all sellers\n lowPrice: Float!\n # Number of sellers selling this sku\n offerCount: Int!\n priceCurrency: String!\n offers: [StoreOffer!]!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var P={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreAggregateRating"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"ratingValue"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"reviewCount"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:72}};P.loc.source={body:"type StoreAggregateRating {\n ratingValue: Float!\n reviewCount: Int!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var V={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreAuthor"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:37}};V.loc.source={body:"type StoreAuthor {\n name: String!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var L={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreBrand"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:36}};L.loc.source={body:"type StoreBrand {\n name: String!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var w={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreListItem"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"item"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"position"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreBreadcrumbList"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"itemListElement"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreListItem"}}}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"numberOfItems"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:161}};w.loc.source={body:"type StoreListItem {\n item: String!\n name: String!\n position: Int!\n}\n\ntype StoreBreadcrumbList {\n itemListElement: [StoreListItem!]!\n numberOfItems: Int!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var q={kind:"Document",definitions:[{kind:"EnumTypeDefinition",name:{kind:"Name",value:"StoreCollectionType"},directives:[],values:[{kind:"EnumValueDefinition",name:{kind:"Name",value:"Department"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"Category"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"Brand"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"Cluster"},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreCollectionFacet"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"key"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"value"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreCollectionMeta"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"selectedFacets"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionFacet"}}}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreCollection"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"seo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSeo"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"breadcrumbList"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreBreadcrumbList"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"meta"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionMeta"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"slug"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"type"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionType"}}},directives:[]}]}],loc:{start:0,end:424}};q.loc.source={body:"enum StoreCollectionType {\n Department\n Category\n Brand\n Cluster\n}\n\ntype StoreCollectionFacet {\n key: String!\n value: String!\n}\n\ntype StoreCollectionMeta {\n selectedFacets: [StoreCollectionFacet!]!\n}\n\ntype StoreCollection {\n # Meta tag data\n seo: StoreSeo!\n # location for structured data\n breadcrumbList: StoreBreadcrumbList!\n meta: StoreCollectionMeta!\n id: ID!\n slug: String!\n type: StoreCollectionType!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var R={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreFacet"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"key"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"label"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"values"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreFacetValue"}}}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"type"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreFacetType"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreFacetValue"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"value"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"label"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"selected"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"quantity"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:240}};R.loc.source={body:"type StoreFacet {\n key: String!\n label: String!\n values: [StoreFacetValue!]!\n type: StoreFacetType!\n}\n\ntype StoreFacetValue {\n value: String!\n label: String!\n selected: Boolean!\n # Number of items with this facet\n quantity: Int!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var E={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreImage"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"url"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"alternateName"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreImage"},directives:[],fields:[{kind:"InputValueDefinition",name:{kind:"Name",value:"url"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"alternateName"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:123}};E.loc.source={body:"type StoreImage {\n url: String!\n alternateName: String!\n}\n\ninput IStoreImage {\n url: String!\n alternateName: String!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var j={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"Mutation"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"validateCart"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"cart"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreCart"}}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"StoreCart"}},directives:[]}]}],loc:{start:0,end:148}};j.loc.source={body:"type Mutation {\n # Returns the order if anything changed with the order. Null if the order is valid\n validateCart(cart: IStoreCart!): StoreCart\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var _={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreOffer"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"listPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"sellingPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"priceCurrency"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"price"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"priceValidUntil"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"itemCondition"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"availability"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"seller"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOrganization"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"itemOffered"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"quantity"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreOffer"},directives:[],fields:[{kind:"InputValueDefinition",name:{kind:"Name",value:"price"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"listPrice"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"seller"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreOrganization"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"itemOffered"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreProduct"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"quantity"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:419}};_.loc.source={body:"type StoreOffer {\n listPrice: Float!\n sellingPrice: Float!\n priceCurrency: String!\n # Also known as spotPrice\n price: Float!\n priceValidUntil: String!\n itemCondition: String!\n availability: String!\n seller: StoreOrganization!\n itemOffered: StoreProduct!\n quantity: Int!\n}\n\ninput IStoreOffer {\n price: Float!\n listPrice: Float!\n seller: IStoreOrganization!\n itemOffered: IStoreProduct!\n quantity: Int!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var A={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreOrder"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"orderNumber"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"acceptedOffer"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOffer"}}}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreOrder"},directives:[],fields:[{kind:"InputValueDefinition",name:{kind:"Name",value:"orderNumber"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"acceptedOffer"},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreOffer"}}}}},directives:[]}]}],loc:{start:0,end:154}};A.loc.source={body:"type StoreOrder {\n orderNumber: String!\n acceptedOffer: [StoreOffer!]!\n}\n\ninput IStoreOrder {\n orderNumber: String!\n acceptedOffer: [IStoreOffer!]!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var G={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreOrganization"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"identifier"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreOrganization"},directives:[],fields:[{kind:"InputValueDefinition",name:{kind:"Name",value:"identifier"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:101}};G.loc.source={body:"type StoreOrganization {\n identifier: String!\n}\n\ninput IStoreOrganization {\n identifier: String!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var x={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StorePageInfo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"hasNextPage"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"hasPreviousPage"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"startCursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"endCursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"totalCount"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:197}};x.loc.source={body:"type StorePageInfo {\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n startCursor: String!\n endCursor: String!\n # Total number of items(products/collections), not pages\n totalCount: Int!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var $={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreProduct"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"seo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSeo"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"breadcrumbList"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreBreadcrumbList"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"slug"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"productID"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"brand"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreBrand"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"description"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"image"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreImage"}}}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"offers"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreAggregateOffer"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"sku"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"gtin"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"review"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreReview"}}}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"aggregateRating"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreAggregateRating"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"isVariantOf"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductGroup"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreProduct"},directives:[],fields:[{kind:"InputValueDefinition",name:{kind:"Name",value:"sku"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"name"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"image"},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreImage"}}}}},directives:[]}]}],loc:{start:0,end:528}};$.loc.source={body:"type StoreProduct {\n # Meta tag data\n seo: StoreSeo!\n # Location for structured data\n breadcrumbList: StoreBreadcrumbList!\n # Where to retrieve this entity\n slug: String!\n name: String!\n productID: String!\n brand: StoreBrand!\n description: String!\n image: [StoreImage!]!\n offers: StoreAggregateOffer!\n sku: String!\n gtin: String!\n review: [StoreReview!]!\n aggregateRating: StoreAggregateRating!\n isVariantOf: StoreProductGroup!\n}\n\ninput IStoreProduct {\n sku: String!\n name: String!\n image: [IStoreImage!]!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var B={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreProductGroup"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"hasVariant"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"productGroupID"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:100}};B.loc.source={body:"type StoreProductGroup {\n hasVariant: [StoreProduct!]!\n productGroupID: String!\n name: String!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Q={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreProductEdge"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"node"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"cursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreProductConnection"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"pageInfo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StorePageInfo"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"edges"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductEdge"}}}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreCollectionEdge"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"node"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollection"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"cursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreCollectionConnection"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"pageInfo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StorePageInfo"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"edges"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionEdge"}}}}},directives:[]}]},{kind:"EnumTypeDefinition",name:{kind:"Name",value:"StoreSort"},directives:[],values:[{kind:"EnumValueDefinition",name:{kind:"Name",value:"price_desc"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"price_asc"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"orders_desc"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"name_desc"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"name_asc"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"release_desc"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"discount_desc"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"score_desc"},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreSelectedFacet"},directives:[],fields:[{kind:"InputValueDefinition",name:{kind:"Name",value:"key"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"value"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"EnumTypeDefinition",name:{kind:"Name",value:"StoreFacetType"},directives:[],values:[{kind:"EnumValueDefinition",name:{kind:"Name",value:"BOOLEAN"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"RANGE"},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreSearchResult"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"products"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductConnection"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"facets"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreFacet"}}}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"Query"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"product"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"locator"},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreSelectedFacet"}}}}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"collection"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"slug"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollection"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"search"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"first"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"after"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"sort"},type:{kind:"NamedType",name:{kind:"Name",value:"StoreSort"}},defaultValue:{kind:"EnumValue",value:"score_desc"},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"term"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},defaultValue:{kind:"StringValue",value:"",block:!1},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"selectedFacets"},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreSelectedFacet"}}}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSearchResult"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"allProducts"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"first"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"after"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductConnection"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"allCollections"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"first"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"after"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionConnection"}}},directives:[]}]}],loc:{start:0,end:1077}};Q.loc.source={body:'type StoreProductEdge {\n node: StoreProduct!\n cursor: String!\n}\n\ntype StoreProductConnection {\n pageInfo: StorePageInfo!\n edges: [StoreProductEdge!]!\n}\n\ntype StoreCollectionEdge {\n node: StoreCollection!\n cursor: String!\n}\n\ntype StoreCollectionConnection {\n pageInfo: StorePageInfo!\n edges: [StoreCollectionEdge!]!\n}\n\nenum StoreSort {\n price_desc\n price_asc\n orders_desc\n name_desc\n name_asc\n release_desc\n discount_desc\n score_desc\n}\n\ninput IStoreSelectedFacet {\n key: String!\n value: String!\n}\n\nenum StoreFacetType {\n BOOLEAN\n RANGE\n}\n\ntype StoreSearchResult {\n products: StoreProductConnection!\n facets: [StoreFacet!]!\n}\n\ntype Query {\n product(locator: [IStoreSelectedFacet!]!): StoreProduct!\n\n collection(slug: String!): StoreCollection!\n\n search(\n first: Int!\n after: String\n sort: StoreSort = score_desc\n term: String = ""\n selectedFacets: [IStoreSelectedFacet!]\n ): StoreSearchResult!\n\n allProducts(first: Int!, after: String): StoreProductConnection!\n\n allCollections(first: Int!, after: String): StoreCollectionConnection!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var M={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreReviewRating"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"ratingValue"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"bestRating"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreReview"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"reviewRating"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreReviewRating"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"author"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreAuthor"}}},directives:[]}]}],loc:{start:0,end:150}};M.loc.source={body:"type StoreReviewRating {\n ratingValue: Float!\n bestRating: Float!\n}\n\ntype StoreReview {\n reviewRating: StoreReviewRating!\n author: StoreAuthor!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var z={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreSeo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"title"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"titleTemplate"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"description"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"canonical"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:104}};z.loc.source={body:"type StoreSeo {\n title: String!\n titleTemplate: String!\n description: String!\n canonical: String!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var U={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreCartMessage"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"text"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"status"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreStatus"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreCart"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"order"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOrder"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"messages"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCartMessage"}}}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreCart"},directives:[],fields:[{kind:"InputValueDefinition",name:{kind:"Name",value:"order"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreOrder"}}},directives:[]}]}],loc:{start:0,end:183}};U.loc.source={body:"type StoreCartMessage {\n text: String!\n status: StoreStatus!\n}\n\ntype StoreCart {\n order: StoreOrder!\n messages: [StoreCartMessage!]!\n}\n\ninput IStoreCart {\n order: IStoreOrder!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var W={kind:"Document",definitions:[{kind:"EnumTypeDefinition",name:{kind:"Name",value:"StoreStatus"},directives:[],values:[{kind:"EnumValueDefinition",name:{kind:"Name",value:"INFO"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"WARNING"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"ERROR"},directives:[]}]}],loc:{start:0,end:46}};W.loc.source={body:"enum StoreStatus {\n INFO\n WARNING\n ERROR\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};const H=[Q,j,L,w,q,R,E,x,$,z,_,P,M,V,B,G,C,A,U,W].map(r.print).join("\n"),J={vtex:{getResolvers:e=>b,getContextFactory:e=>n=>(n.storage={channel:e.channel},n.clients=((e,n)=>({search:m(e,n),commerce:(({account:e,environment:n},i)=>{const t=`http://${e}.${n}.com.br`;return{catalog:{brand:{list:()=>l(t+"/api/catalog_system/pub/brand/list")},category:{tree:(e=3)=>l(`${t}/api/catalog_system/pub/category/tree/${e}`)},portal:{pagetype:e=>l(`${t}/api/catalog_system/pub/portal/pagetype/${e}`)}},checkout:{simulation:(e,{salesChannel:n}={salesChannel:i.storage.channel})=>{const a=new URLSearchParams({sc:n});return l(`${t}/api/checkout/pub/orderForms/simulation?${a.toString()}`,{...o,body:JSON.stringify(e)})},orderForm:({id:e,refreshOutdatedData:n=!0,salesChannel:a=i.storage.channel})=>{const d=new URLSearchParams({refreshOutdatedData:n.toString(),sc:a});return l(`${t}/api/checkout/pub/orderForm/${e}?${d.toString()}`,o)},updateOrderFormItems:({id:e,orderItems:n,allowOutdatedData:a="paymentData",salesChannel:d=i.storage.channel})=>{const r=new URLSearchParams({allowOutdatedData:a,sc:d});return l(`${t}/api/checkout/pub/orderForm/${e}/items?${r}`,{...o,body:JSON.stringify({orderItems:n}),method:"PATCH"})}}}})(e,n)}))(e,n),n.loaders=((e,{clients:n})=>({skuLoader:((e,n)=>new t(async e=>{const i=e.map(e=>{const n=e.find(({key:e})=>"id"===e);if(!n)throw new Error("Error while loading SKU. Needs to pass an id to selected facets");return n.value}),t=i.reduce((e,n,i)=>({...e,[n]:i}),{}),{products:a}=await n.search.products({query:"sku:"+i.join(";"),page:0,count:i.length});if(a.length!==i.length)throw new Error(`Sku batching went wrong. Asked for ${i.length} sku(s) but search api returned ${a.length} sku(s)`);const d=new Array(a.length);for(const e of a){const n=e.skus.find(e=>null!=t[e.id]);if(null==n)throw new Error("Could not find sku for product "+e.id);d[t[n.id]]=u(n,e)}return d},{maxBatchSize:99}))(0,n),simulationLoader:((e,n)=>new t(async e=>{const i=[...e.flat()],t=await n.commerce.checkout.simulation({items:i}),a=t.items.reduce((e,n)=>{const i=n.requestIndex;return"number"==typeof i&&i<e.length&&(e[i]=n),e},Array(i.length).fill(null)),d=e.reduce((e,n)=>[...e,n.length+e[e.length-1]],[0]);return e.map((e,n)=>({...t,items:a.slice(d[n],d[n+1]).filter(e=>Boolean(e))}))},{maxBatchSize:20}))(0,n)}))(0,n),n)}},K=()=>H,X=e=>J[e.platform].getResolvers(e);exports.getContextFactory=e=>J[e.platform].getContextFactory(e),exports.getResolvers=X,exports.getSchema=async e=>n.makeExecutableSchema({resolvers:X(e),typeDefs:K()}),exports.getTypeDefs=K;
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("@graphql-tools/schema"),i=e(require("isomorphic-unfetch")),t=e(require("dataloader")),a=e(require("@sindresorhus/slugify")),d=e(require("fast-deep-equal")),r=require("graphql");const l=async(e,n)=>{const t=await i(e,n);if(t.ok)return t.json();const a=await t.text();throw new Error(a)},o={method:"POST",headers:{"content-type":"application/json"}},m=({account:e,environment:n},i)=>{const t=`http://portal.${n}.com.br/search-api/v1/${e}`,a={key:"trade-policy",value:i.storage.channel},d=({query:e="",page:n,count:i,sort:d="",selectedFacets:r=[],type:o,fuzzy:m="0"})=>{const u=new URLSearchParams({page:(n+1).toString(),count:i.toString(),query:e,sort:d,fuzzy:m}),s=(p=r,void 0===p.find(({key:e})=>e===a.key)?[...p,a]:p).map(({key:e,value:n})=>`${e}/${n}`).join("/");var p;return l(`${t}/api/split/${o}/${s}?${u.toString()}`)};return{facets:e=>d({...e,type:"attribute_search"}),products:e=>d({...e,type:"product_search"})}};class u extends Error{constructor(e){super(e),this.name="BadRequestError"}}const s=(e,n)=>({...e,isVariantOf:n}),p=e=>a(e,{separator:"-",lowercase:!0}),c=e=>"brand"===e.type,k=e=>"string"==typeof e.pageType,y={id:({id:e})=>e.toString(),slug:({name:e})=>p(e),seo:e=>c(e)||k(e)?{title:e.title,description:e.metaTagDescription}:{title:e.Title,description:e.MetaTagDescription},type:e=>c(e)?"Brand":k(e)?e.pageType:0===e.level?"Department":"Category",meta:e=>c(e)?{selectedFacets:[{key:"brand",value:p(e.name)}]}:{selectedFacets:new URL(k(e)?"https://"+e.url:e.url).pathname.slice(1).split("/").map((e,n)=>({key:"category-"+(n+1),value:p(e)}))},breadcrumbList:()=>({itemListElement:[],numberOfItems:0})},N=e=>[e.itemOffered.sku,e.seller.identifier,e.price].join("::"),v=(e,n)=>({listPrice:e.listPrice/100,price:e.sellingPrice/100,quantity:e.quantity,seller:{identifier:e.seller},itemOffered:{sku:e.id,image:[],name:e.name},index:n}),f=e=>({quantity:e.quantity,seller:e.seller.identifier,id:e.itemOffered.sku,index:e.index}),g=e=>e.reduce((e,n)=>{var i;const t=N(n);return e.set(t,null!=(i=e.get(t))?i:n),e},new Map),S={name:"image",value:"https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg"},T=(e,n)=>`${e}-${n}`,D=(e,n)=>`/${T(e,n)}/p`,h=e=>Array.isArray(e)&&e.length>0?e:null,F=e=>{const n=e.split("-").pop();if(null==n)throw new u("Error while extracting sku id from product slug");return n},O=({key:e,value:n})=>{switch(e){case"channel":return{key:"trade-policy",value:n};case"slug":return{key:"id",value:F(n)};default:return{key:e,value:n}}},I={price_desc:"price:desc",price_asc:"price:asc",orders_desc:"orders:desc",name_desc:"name:desc",name_asc:"name:asc",release_desc:"release:desc",discount_desc:"discount:desc",score_desc:""},b={product:async(e,{locator:n},i)=>{var t,a;i.storage={...i.storage,channel:null!=(t=null==(a=n.find(e=>"channel"===e.key))?void 0:a.value)?t:i.storage.channel};const{loaders:{skuLoader:d}}=i;return d.load(n.map(O))},collection:async(e,{slug:n},i)=>{const{clients:{commerce:t}}=i;return t.catalog.portal.pagetype(n)},search:async(e,{first:n,after:i,sort:t,term:a,selectedFacets:d},r)=>{var l,o,m;r.storage={...r.storage,channel:null!=(l=null==d||null==(o=d.find(e=>"channel"===e.key))?void 0:o.value)?l:r.storage.channel};const u=i?Number(i):0;return{page:Math.ceil(u/n),count:n,query:a,sort:I[null!=t?t:"score_desc"],selectedFacets:null!=(m=null==d?void 0:d.map(O))?m:[]}},allProducts:async(e,{first:n,after:i},t)=>{const{clients:{search:a}}=t,d=i?Number(i):0,r=await a.products({page:Math.ceil(d/n),count:n}),l=r.products.map(e=>e.skus.map(n=>s(n,e))).flat().filter(e=>e.sellers.length>0);return{pageInfo:{hasNextPage:r.pagination.after.length>0,hasPreviousPage:r.pagination.before.length>0,startCursor:"0",endCursor:r.total.toString(),totalCount:r.total},edges:l.map((e,n)=>({node:e,cursor:(d+n).toString()}))}},allCollections:async(e,n,i)=>{const{clients:{commerce:t}}=i,[a,d]=await Promise.all([t.catalog.brand.list(),t.catalog.category.tree()]),r=[],l=(e,n)=>{r.push({...e,level:n});for(const i of e.children)l(i,n+1)};for(const e of d)l(e,0);return{pageInfo:{hasNextPage:!1,hasPreviousPage:!1,startCursor:"0",endCursor:"0"},edges:[...a.map(e=>({...e,type:"brand"})),...r].filter(e=>Boolean(y.slug(e,null,i,null))).map((e,n)=>({node:e,cursor:n.toString()}))}}},C={StoreCollection:y,StoreAggregateOffer:{highPrice:({items:e})=>{var n,i;return e.reduce((e,n)=>e>n.sellingPrice?e:n.sellingPrice,null!=(n=null==(i=e[0])?void 0:i.sellingPrice)?n:0)/100},lowPrice:({items:e})=>{var n,i;return e.reduce((e,n)=>e<n.sellingPrice?e:n.sellingPrice,null!=(n=null==(i=e[0])?void 0:i.sellingPrice)?n:0)/100},offerCount:({items:e})=>e.length,priceCurrency:()=>"",offers:({items:e,product:n})=>e.map(e=>({...e,product:n}))},StoreProduct:{productID:({id:e})=>e,name:({isVariantOf:e,name:n})=>null!=n?n:e.name,slug:({isVariantOf:{link:e},id:n})=>T(e,n),description:({isVariantOf:{description:e}})=>e,seo:({isVariantOf:{name:e,description:n}})=>({title:e,description:n}),brand:({isVariantOf:{brand:e}})=>({name:e}),breadcrumbList:({isVariantOf:{categoryTrees:e,name:n,link:i},id:t})=>({itemListElement:[...e.map(({categoryNames:e},n)=>({name:e[e.length-1],item:"/"+e.join("/").toLowerCase(),position:n+1})),{name:n,item:D(i,t),position:e.length+1}],numberOfItems:e.length}),image:({isVariantOf:e,images:n})=>{var i,t;return(null!=(i=null!=(t=h(n))?t:h(e.images))?i:[S]).map(({name:e,value:n})=>({alternateName:null!=e?e:"",url:n.replace("vteximg.com.br","vtexassets.com")}))},sku:({isVariantOf:{skus:[e]}})=>e.id,gtin:({reference:e})=>null!=e?e:"",review:()=>[],aggregateRating:()=>({}),offers:async(e,n,i)=>{var t;const{loaders:{simulationLoader:a},storage:{channel:d}}=i,{id:r,policies:l}=e,o=null==(t=l.find(e=>e.id===d))?void 0:t.sellers;if(null==o)throw new Error(`Product with id ${r} has no sellers for channel ${d}.`);const m=o.map(e=>e.id),u=Array.from(new Set(m)).map(e=>({quantity:1,seller:e,id:r}));return{...await a.load(u),product:e}},isVariantOf:({isVariantOf:e})=>e},StoreSeo:{title:({title:e})=>null!=e?e:"",description:({description:e})=>null!=e?e:"",titleTemplate:()=>"",canonical:()=>""},StoreFacet:{key:({key:e})=>e,label:({label:e})=>e,values:({values:e})=>e,type:({type:e})=>"text"===e?"BOOLEAN":"RANGE"},StoreFacetValue:{value:({key:e,from:n,to:i})=>null!=e?e:`${n}-to-${i}`,label:({label:e})=>null!=e?e:"unknown",selected:({active:e})=>e,quantity:({count:e})=>e},StoreOffer:{priceCurrency:()=>"",priceValidUntil:({priceValidUntil:e})=>null!=e?e:"",itemCondition:()=>"https://schema.org/NewCondition",availability:({availability:e})=>"available"===e?"https://schema.org/InStock":"https://schema.org/OutOfStock",seller:({seller:e})=>({identifier:e}),price:({sellingPrice:e})=>e/100,sellingPrice:({sellingPrice:e})=>e/100,listPrice:({listPrice:e})=>e/100,itemOffered:({product:e})=>e,quantity:({quantity:e})=>e},StoreAggregateRating:{ratingValue:()=>5,reviewCount:()=>0},StoreReview:{reviewRating:()=>({ratingValue:5,bestRating:5}),author:()=>({name:""})},StoreProductGroup:{hasVariant:e=>e.skus.map(n=>s(n,e)),productGroupID:({product:e})=>e,name:({name:e})=>e},StoreSearchResult:{products:async(e,n,i)=>{const{clients:{search:t}}=i,a=await t.products(e),d=a.products.map(e=>{const n=e.skus.find(e=>e.sellers.length>0);return n&&s(n,e)}).filter(e=>!!e);return{pageInfo:{hasNextPage:a.pagination.after.length>0,hasPreviousPage:a.pagination.before.length>0,startCursor:"0",endCursor:a.total.toString(),totalCount:a.total},edges:d.map((e,n)=>({node:e,cursor:n.toString()}))}},facets:async(e,n,i)=>{const{clients:{search:t}}=i;return(await t.facets(e)).attributes}},Query:b,Mutation:{validateCart:async(e,{cart:{order:{orderNumber:n,acceptedOffer:i}}},t)=>{const{clients:{commerce:a},loaders:{skuLoader:r}}=t,l=await a.checkout.orderForm({id:n}),o=g(i),m=g(l.items.map(v)),u=Array.from(o.values()),s=Array.from(m.values()),{itemsToAdd:p,itemsToUpdate:c}=u.reduce((e,n)=>{const i=m.get(N(n));return i?e.itemsToUpdate.push({...i,quantity:n.quantity}):e.itemsToAdd.push(n),e},{itemsToAdd:[],itemsToUpdate:[]}),k=[...p,...c,...s.filter(e=>!o.has(N(e))).map(e=>({...e,quantity:0}))].map(f);if(0===k.length)return null;const y=await a.checkout.updateOrderFormItems({id:l.orderFormId,orderItems:k});return((e,n)=>{const i=({orderFormId:e,messages:n,items:i,salesChannel:t})=>({orderFormId:e,messages:n,salesChannel:t,items:i.map(({uniqueId:e,quantity:n,seller:i,sellingPrice:t,availability:a})=>({uniqueId:e,quantity:n,seller:i,sellingPrice:t,availability:a}))});return d(i(e),i(n))})(l,y)?null:{order:{orderNumber:y.orderFormId,acceptedOffer:y.items.map(e=>({...e,product:r.load([{key:"id",value:e.id}])}))},messages:y.messages.map(({text:e,status:n})=>({text:e,status:n.toUpperCase()}))}}}};var P={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreAggregateOffer"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"highPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"lowPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"offerCount"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"priceCurrency"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"offers"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOffer"}}}}},directives:[]}]}],loc:{start:0,end:261}};P.loc.source={body:"type StoreAggregateOffer {\n # Highest spot price amongst all sellers\n highPrice: Float!\n # Lowest spot price amongst all sellers\n lowPrice: Float!\n # Number of sellers selling this sku\n offerCount: Int!\n priceCurrency: String!\n offers: [StoreOffer!]!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var V={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreAggregateRating"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"ratingValue"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"reviewCount"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:72}};V.loc.source={body:"type StoreAggregateRating {\n ratingValue: Float!\n reviewCount: Int!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var L={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreAuthor"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:37}};L.loc.source={body:"type StoreAuthor {\n name: String!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var w={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreBrand"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:36}};w.loc.source={body:"type StoreBrand {\n name: String!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var q={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreListItem"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"item"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"position"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreBreadcrumbList"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"itemListElement"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreListItem"}}}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"numberOfItems"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:161}};q.loc.source={body:"type StoreListItem {\n item: String!\n name: String!\n position: Int!\n}\n\ntype StoreBreadcrumbList {\n itemListElement: [StoreListItem!]!\n numberOfItems: Int!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var R={kind:"Document",definitions:[{kind:"EnumTypeDefinition",name:{kind:"Name",value:"StoreCollectionType"},directives:[],values:[{kind:"EnumValueDefinition",name:{kind:"Name",value:"Department"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"Category"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"Brand"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"Cluster"},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreCollectionFacet"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"key"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"value"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreCollectionMeta"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"selectedFacets"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionFacet"}}}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreCollection"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"seo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSeo"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"breadcrumbList"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreBreadcrumbList"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"meta"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionMeta"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"slug"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"type"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionType"}}},directives:[]}]}],loc:{start:0,end:424}};R.loc.source={body:"enum StoreCollectionType {\n Department\n Category\n Brand\n Cluster\n}\n\ntype StoreCollectionFacet {\n key: String!\n value: String!\n}\n\ntype StoreCollectionMeta {\n selectedFacets: [StoreCollectionFacet!]!\n}\n\ntype StoreCollection {\n # Meta tag data\n seo: StoreSeo!\n # location for structured data\n breadcrumbList: StoreBreadcrumbList!\n meta: StoreCollectionMeta!\n id: ID!\n slug: String!\n type: StoreCollectionType!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var E={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreFacet"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"key"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"label"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"values"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreFacetValue"}}}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"type"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreFacetType"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreFacetValue"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"value"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"label"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"selected"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"quantity"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:240}};E.loc.source={body:"type StoreFacet {\n key: String!\n label: String!\n values: [StoreFacetValue!]!\n type: StoreFacetType!\n}\n\ntype StoreFacetValue {\n value: String!\n label: String!\n selected: Boolean!\n # Number of items with this facet\n quantity: Int!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var j={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreImage"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"url"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"alternateName"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreImage"},directives:[],fields:[{kind:"InputValueDefinition",name:{kind:"Name",value:"url"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"alternateName"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:123}};j.loc.source={body:"type StoreImage {\n url: String!\n alternateName: String!\n}\n\ninput IStoreImage {\n url: String!\n alternateName: String!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var _={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"Mutation"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"validateCart"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"cart"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreCart"}}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"StoreCart"}},directives:[]}]}],loc:{start:0,end:148}};_.loc.source={body:"type Mutation {\n # Returns the order if anything changed with the order. Null if the order is valid\n validateCart(cart: IStoreCart!): StoreCart\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var A={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreOffer"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"listPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"sellingPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"priceCurrency"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"price"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"priceValidUntil"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"itemCondition"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"availability"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"seller"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOrganization"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"itemOffered"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"quantity"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreOffer"},directives:[],fields:[{kind:"InputValueDefinition",name:{kind:"Name",value:"price"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"listPrice"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"seller"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreOrganization"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"itemOffered"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreProduct"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"quantity"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:419}};A.loc.source={body:"type StoreOffer {\n listPrice: Float!\n sellingPrice: Float!\n priceCurrency: String!\n # Also known as spotPrice\n price: Float!\n priceValidUntil: String!\n itemCondition: String!\n availability: String!\n seller: StoreOrganization!\n itemOffered: StoreProduct!\n quantity: Int!\n}\n\ninput IStoreOffer {\n price: Float!\n listPrice: Float!\n seller: IStoreOrganization!\n itemOffered: IStoreProduct!\n quantity: Int!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var G={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreOrder"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"orderNumber"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"acceptedOffer"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOffer"}}}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreOrder"},directives:[],fields:[{kind:"InputValueDefinition",name:{kind:"Name",value:"orderNumber"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"acceptedOffer"},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreOffer"}}}}},directives:[]}]}],loc:{start:0,end:154}};G.loc.source={body:"type StoreOrder {\n orderNumber: String!\n acceptedOffer: [StoreOffer!]!\n}\n\ninput IStoreOrder {\n orderNumber: String!\n acceptedOffer: [IStoreOffer!]!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var x={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreOrganization"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"identifier"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreOrganization"},directives:[],fields:[{kind:"InputValueDefinition",name:{kind:"Name",value:"identifier"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:101}};x.loc.source={body:"type StoreOrganization {\n identifier: String!\n}\n\ninput IStoreOrganization {\n identifier: String!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var $={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StorePageInfo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"hasNextPage"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"hasPreviousPage"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"startCursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"endCursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"totalCount"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:197}};$.loc.source={body:"type StorePageInfo {\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n startCursor: String!\n endCursor: String!\n # Total number of items(products/collections), not pages\n totalCount: Int!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var B={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreProduct"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"seo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSeo"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"breadcrumbList"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreBreadcrumbList"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"slug"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"productID"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"brand"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreBrand"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"description"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"image"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreImage"}}}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"offers"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreAggregateOffer"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"sku"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"gtin"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"review"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreReview"}}}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"aggregateRating"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreAggregateRating"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"isVariantOf"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductGroup"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreProduct"},directives:[],fields:[{kind:"InputValueDefinition",name:{kind:"Name",value:"sku"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"name"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"image"},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreImage"}}}}},directives:[]}]}],loc:{start:0,end:528}};B.loc.source={body:"type StoreProduct {\n # Meta tag data\n seo: StoreSeo!\n # Location for structured data\n breadcrumbList: StoreBreadcrumbList!\n # Where to retrieve this entity\n slug: String!\n name: String!\n productID: String!\n brand: StoreBrand!\n description: String!\n image: [StoreImage!]!\n offers: StoreAggregateOffer!\n sku: String!\n gtin: String!\n review: [StoreReview!]!\n aggregateRating: StoreAggregateRating!\n isVariantOf: StoreProductGroup!\n}\n\ninput IStoreProduct {\n sku: String!\n name: String!\n image: [IStoreImage!]!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var Q={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreProductGroup"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"hasVariant"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"productGroupID"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:100}};Q.loc.source={body:"type StoreProductGroup {\n hasVariant: [StoreProduct!]!\n productGroupID: String!\n name: String!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var M={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreProductEdge"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"node"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"cursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreProductConnection"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"pageInfo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StorePageInfo"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"edges"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductEdge"}}}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreCollectionEdge"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"node"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollection"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"cursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreCollectionConnection"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"pageInfo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StorePageInfo"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"edges"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionEdge"}}}}},directives:[]}]},{kind:"EnumTypeDefinition",name:{kind:"Name",value:"StoreSort"},directives:[],values:[{kind:"EnumValueDefinition",name:{kind:"Name",value:"price_desc"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"price_asc"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"orders_desc"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"name_desc"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"name_asc"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"release_desc"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"discount_desc"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"score_desc"},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreSelectedFacet"},directives:[],fields:[{kind:"InputValueDefinition",name:{kind:"Name",value:"key"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"value"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"EnumTypeDefinition",name:{kind:"Name",value:"StoreFacetType"},directives:[],values:[{kind:"EnumValueDefinition",name:{kind:"Name",value:"BOOLEAN"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"RANGE"},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreSearchResult"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"products"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductConnection"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"facets"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreFacet"}}}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"Query"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"product"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"locator"},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreSelectedFacet"}}}}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"collection"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"slug"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollection"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"search"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"first"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"after"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"sort"},type:{kind:"NamedType",name:{kind:"Name",value:"StoreSort"}},defaultValue:{kind:"EnumValue",value:"score_desc"},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"term"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},defaultValue:{kind:"StringValue",value:"",block:!1},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"selectedFacets"},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreSelectedFacet"}}}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSearchResult"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"allProducts"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"first"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"after"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductConnection"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"allCollections"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"first"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"after"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionConnection"}}},directives:[]}]}],loc:{start:0,end:1077}};M.loc.source={body:'type StoreProductEdge {\n node: StoreProduct!\n cursor: String!\n}\n\ntype StoreProductConnection {\n pageInfo: StorePageInfo!\n edges: [StoreProductEdge!]!\n}\n\ntype StoreCollectionEdge {\n node: StoreCollection!\n cursor: String!\n}\n\ntype StoreCollectionConnection {\n pageInfo: StorePageInfo!\n edges: [StoreCollectionEdge!]!\n}\n\nenum StoreSort {\n price_desc\n price_asc\n orders_desc\n name_desc\n name_asc\n release_desc\n discount_desc\n score_desc\n}\n\ninput IStoreSelectedFacet {\n key: String!\n value: String!\n}\n\nenum StoreFacetType {\n BOOLEAN\n RANGE\n}\n\ntype StoreSearchResult {\n products: StoreProductConnection!\n facets: [StoreFacet!]!\n}\n\ntype Query {\n product(locator: [IStoreSelectedFacet!]!): StoreProduct!\n\n collection(slug: String!): StoreCollection!\n\n search(\n first: Int!\n after: String\n sort: StoreSort = score_desc\n term: String = ""\n selectedFacets: [IStoreSelectedFacet!]\n ): StoreSearchResult!\n\n allProducts(first: Int!, after: String): StoreProductConnection!\n\n allCollections(first: Int!, after: String): StoreCollectionConnection!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var z={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreReviewRating"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"ratingValue"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"bestRating"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreReview"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"reviewRating"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreReviewRating"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"author"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreAuthor"}}},directives:[]}]}],loc:{start:0,end:150}};z.loc.source={body:"type StoreReviewRating {\n ratingValue: Float!\n bestRating: Float!\n}\n\ntype StoreReview {\n reviewRating: StoreReviewRating!\n author: StoreAuthor!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var U={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreSeo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"title"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"titleTemplate"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"description"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"canonical"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:104}};U.loc.source={body:"type StoreSeo {\n title: String!\n titleTemplate: String!\n description: String!\n canonical: String!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var W={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreCartMessage"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"text"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"status"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreStatus"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"StoreCart"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",name:{kind:"Name",value:"order"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOrder"}}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"messages"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCartMessage"}}}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreCart"},directives:[],fields:[{kind:"InputValueDefinition",name:{kind:"Name",value:"order"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreOrder"}}},directives:[]}]}],loc:{start:0,end:183}};W.loc.source={body:"type StoreCartMessage {\n text: String!\n status: StoreStatus!\n}\n\ntype StoreCart {\n order: StoreOrder!\n messages: [StoreCartMessage!]!\n}\n\ninput IStoreCart {\n order: IStoreOrder!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var H={kind:"Document",definitions:[{kind:"EnumTypeDefinition",name:{kind:"Name",value:"StoreStatus"},directives:[],values:[{kind:"EnumValueDefinition",name:{kind:"Name",value:"INFO"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"WARNING"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"ERROR"},directives:[]}]}],loc:{start:0,end:46}};H.loc.source={body:"enum StoreStatus {\n INFO\n WARNING\n ERROR\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};const J=[M,_,w,q,R,E,j,$,B,U,A,V,z,L,Q,x,P,G,W,H].map(r.print).join("\n"),K={vtex:{getResolvers:e=>C,getContextFactory:e=>n=>(n.storage={channel:e.channel},n.clients=((e,n)=>({search:m(e,n),commerce:(({account:e,environment:n},i)=>{const t=`http://${e}.${n}.com.br`;return{catalog:{brand:{list:()=>l(t+"/api/catalog_system/pub/brand/list")},category:{tree:(e=3)=>l(`${t}/api/catalog_system/pub/category/tree/${e}`)},portal:{pagetype:e=>l(`${t}/api/catalog_system/pub/portal/pagetype/${e}`)}},checkout:{simulation:(e,{salesChannel:n}={salesChannel:i.storage.channel})=>{const a=new URLSearchParams({sc:n});return l(`${t}/api/checkout/pub/orderForms/simulation?${a.toString()}`,{...o,body:JSON.stringify(e)})},orderForm:({id:e,refreshOutdatedData:n=!0,salesChannel:a=i.storage.channel})=>{const d=new URLSearchParams({refreshOutdatedData:n.toString(),sc:a});return l(`${t}/api/checkout/pub/orderForm/${e}?${d.toString()}`,o)},updateOrderFormItems:({id:e,orderItems:n,allowOutdatedData:a="paymentData",salesChannel:d=i.storage.channel})=>{const r=new URLSearchParams({allowOutdatedData:a,sc:d});return l(`${t}/api/checkout/pub/orderForm/${e}/items?${r}`,{...o,body:JSON.stringify({orderItems:n}),method:"PATCH"})}}}})(e,n)}))(e,n),n.loaders=((e,{clients:n})=>({skuLoader:((e,n)=>new t(async e=>{const i=e.map(e=>{const n=e.find(({key:e})=>"id"===e);if(!n)throw new u("Error while loading SKU. Needs to pass an id to selected facets");return n.value}),t=i.reduce((e,n,i)=>({...e,[n]:i}),{}),{products:a}=await n.search.products({query:"sku:"+i.join(";"),page:0,count:i.length});if(a.length!==i.length)throw new u(`Sku batching went wrong. Asked for ${i.length} sku(s) but search api returned ${a.length} sku(s)`);const d=new Array(a.length);for(const e of a){const n=e.skus.find(e=>null!=t[e.id]);if(null==n)throw new Error("Could not find sku for product "+e.id);d[t[n.id]]=s(n,e)}return d},{maxBatchSize:99}))(0,n),simulationLoader:((e,n)=>new t(async e=>{const i=[...e.flat()],t=await n.commerce.checkout.simulation({items:i}),a=t.items.reduce((e,n)=>{const i=n.requestIndex;return"number"==typeof i&&i<e.length&&(e[i]=n),e},Array(i.length).fill(null)),d=e.reduce((e,n)=>[...e,n.length+e[e.length-1]],[0]);return e.map((e,n)=>({...t,items:a.slice(d[n],d[n+1]).filter(e=>Boolean(e))}))},{maxBatchSize:20}))(0,n)}))(0,n),n)}},X=()=>J,Y=e=>K[e.platform].getResolvers(e);exports.getContextFactory=e=>K[e.platform].getContextFactory(e),exports.getResolvers=Y,exports.getSchema=async e=>n.makeExecutableSchema({resolvers:Y(e),typeDefs:X()}),exports.getTypeDefs=X;
//# sourceMappingURL=api.cjs.production.min.js.map

@@ -183,2 +183,10 @@ import { makeExecutableSchema } from '@graphql-tools/schema';

class BadRequestError extends Error {
constructor(message) {
super(message);
this.name = 'BadRequestError';
}
}
const enhanceSku = (sku, product) => ({ ...sku,

@@ -196,3 +204,3 @@ isVariantOf: product

if (!maybeFacet) {
throw new Error('Error while loading SKU. Needs to pass an id to selected facets');
throw new BadRequestError('Error while loading SKU. Needs to pass an id to selected facets');
}

@@ -214,3 +222,3 @@

if (products.length !== skuIds.length) {
throw new Error(`Sku batching went wrong. Asked for ${skuIds.length} sku(s) but search api returned ${products.length} sku(s)`);
throw new BadRequestError(`Sku batching went wrong. Asked for ${skuIds.length} sku(s) but search api returned ${products.length} sku(s)`);
}

@@ -697,3 +705,3 @@

if (id == null) {
throw new Error('Error while extracting sku id from product slug');
throw new BadRequestError('Error while extracting sku id from product slug');
}

@@ -700,0 +708,0 @@

{
"name": "@faststore/api",
"version": "1.3.6",
"version": "1.3.7",
"license": "MIT",

@@ -45,3 +45,3 @@ "main": "dist/index.js",

},
"gitHead": "b1badead35dc43b41f25480a66f4e81cc9a8e22a"
"gitHead": "bcb84e17fb73c2700d6a8bb95fb6a499aa167f23"
}
import DataLoader from 'dataloader'
import { BadRequestError } from '../utils/errors'
import { enhanceSku } from '../utils/enhanceSku'

@@ -15,3 +16,3 @@ import type { EnhancedSku } from '../utils/enhanceSku'

if (!maybeFacet) {
throw new Error(
throw new BadRequestError(
'Error while loading SKU. Needs to pass an id to selected facets'

@@ -36,3 +37,3 @@ )

if (products.length !== skuIds.length) {
throw new Error(
throw new BadRequestError(
`Sku batching went wrong. Asked for ${skuIds.length} sku(s) but search api returned ${products.length} sku(s)`

@@ -39,0 +40,0 @@ )

@@ -0,1 +1,3 @@

import { BadRequestError } from './errors'
export interface SelectedFacet {

@@ -10,3 +12,3 @@ key: string

if (id == null) {
throw new Error('Error while extracting sku id from product slug')
throw new BadRequestError('Error while extracting sku id from product slug')
}

@@ -13,0 +15,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc