@faststore/api
Advanced tools
Comparing version 1.2.35 to 1.2.36
@@ -6,2 +6,10 @@ # Change Log | ||
## 1.2.36 (2021-11-16) | ||
**Note:** Version bump only for package @faststore/api | ||
## 1.2.35 (2021-11-16) | ||
@@ -8,0 +16,0 @@ |
@@ -91,5 +91,6 @@ 'use strict'; | ||
const IntelligentSearch = ({ | ||
account | ||
account, | ||
environment | ||
}, ctx) => { | ||
const base = `http://search.biggylabs.com.br/search-api/v1/${account}`; | ||
const base = `http://portal.${environment}.com.br/search-api/v1/${account}`; | ||
@@ -96,0 +97,0 @@ const addDefaultFacets = facets => { |
@@ -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},n)=>{const i="http://search.biggylabs.com.br/search-api/v1/"+e,t=({query:e="",page:t,count:a,sort:d="",selectedFacets:r=[],type:o,fuzzy:m="0"})=>{const u=new URLSearchParams({page:(t+1).toString(),count:a.toString(),query:e,sort:d,fuzzy:m}),s=(e=>{const i=Object.fromEntries(e.map(({key:e,value:n})=>[e,n]));return Object.entries({"trade-policy":n.storage.channel,...i}).map(([e,n])=>({key:e,value:n}))})(r).map(({key:e,value:n})=>`${e}/${n}`).join("/");return l(`${i}/api/split/${o}/${s}?${u.toString()}`)};return{facets:e=>t({...e,type:"attribute_search"}),products:e=>t({...e,type:"product_search"})}},u=(e,n)=>({...e,isVariantOf:n}),s=e=>a(e,{separator:"-",lowercase:!0}),p=e=>"brand"===e.type,c={id:({id:e})=>e.toString(),slug:({name:e})=>s(e),seo:e=>p(e)?{title:e.title,description:e.metaTagDescription}:{title:e.Title,description:e.MetaTagDescription},type:e=>p(e)?"Brand":0===e.level?"Department":"Category",meta:e=>p(e)?{selectedFacets:[{key:"brand",value:s(e.name)}]}:{selectedFacets:new URL(e.url).pathname.slice(1).split("/").map((e,n)=>({key:"category-"+(n+1),value:s(e)}))},breadcrumbList:()=>({itemListElement:[],numberOfItems:0})},k=e=>[e.itemOffered.sku,e.seller.identifier,e.price].join("::"),y=(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}),N=e=>({quantity:e.quantity,seller:e.seller.identifier,id:e.itemOffered.sku,index:e.index}),v=e=>e.reduce((e,n)=>{var i;const t=k(n);return e.set(t,null!=(i=e.get(t))?i:n),e},new Map),f={name:"image",value:"https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg"},g=(e,n)=>`${e}-${n}`,S=(e,n)=>`/${g(e,n)}/p`,T=e=>Array.isArray(e)&&e.length>0?e:null,D=e=>{const n=e.split("-").pop();if(null==n)throw new Error("Error while extracting sku id from product slug");return n},h=({key:e,value:n})=>{switch(e){case"channel":return{key:"trade-policy",value:n};case"slug":return{key:"id",value:D(n)};default:return{key:e,value:n}}},F={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:""},O={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(h))},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:F[null!=t?t:"score_desc"],selectedFacets:null!=(m=null==d?void 0:d.map(h))?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(c.slug(e,null,i,null))).map((e,n)=>({node:e,cursor:n.toString()}))}}},b={StoreCollection:c,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})=>g(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:S(i,t),position:e.length+1}],numberOfItems:e.length}),image:({isVariantOf:e,images:n})=>{var i,t;return(null!=(i=null!=(t=T(n))?t:T(e.images))?i:[f]).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:O,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=v(i),m=v(l.items.map(y)),u=Array.from(o.values()),s=Array.from(m.values()),{itemsToAdd:p,itemsToUpdate:c}=u.reduce((e,n)=>{const i=m.get(k(n));return i?e.itemsToUpdate.push({...i,quantity:n.quantity}):e.itemsToAdd.push(n),e},{itemsToAdd:[],itemsToUpdate:[]}),f=[...p,...c,...s.filter(e=>!o.has(k(e))).map(e=>({...e,quantity:0}))].map(N);if(0===f.length)return null;const g=await a.checkout.updateOrderFormItems({id:l.orderFormId,orderItems:f});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 I={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}};I.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 C={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}};C.loc.source={body:"type StoreAggregateRating {\n ratingValue: Float!\n reviewCount: Int!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var P={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}};P.loc.source={body:"type StoreAuthor {\n name: String!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var V={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}};V.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 L={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}};L.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 q={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}};q.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 R={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}};R.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 E={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}};E.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 j={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}};j.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 _={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}};_.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 A={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}};A.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 G={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}};G.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 x={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}};x.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 $={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}};$.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 B={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:"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:1214}};B.loc.source={body:'type StoreProductEdge {\n node: StoreProduct!\n cursor: String!\n}\n\ntype StoreProductConnection {\n pageInfo: StorePageInfo!\n edges: [StoreProductEdge!]!\n}\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 search(\n # Relay style pagination args. To know more: https://relay.dev/graphql/connections.htm\n first: Int!\n # Relay style pagination args. To know more: https://relay.dev/graphql/connections.htm\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 Q={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}};Q.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 M={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}};M.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 z={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}};z.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 U={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}};U.loc.source={body:"enum StoreStatus {\n INFO\n WARNING\n ERROR\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};const W=[B,E,V,w,L,q,R,G,x,M,j,C,Q,P,$,A,I,_,z,U].map(r.print).join("\n"),H={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}`)}},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)}},J=()=>W,K=e=>H[e.platform].getResolvers(e);exports.getContextFactory=e=>H[e.platform].getContextFactory(e),exports.getResolvers=K,exports.getSchema=async e=>n.makeExecutableSchema({resolvers:K(e),typeDefs:J()}),exports.getTypeDefs=J; | ||
"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=({query:e="",page:n,count:a,sort:d="",selectedFacets:r=[],type:o,fuzzy:m="0"})=>{const u=new URLSearchParams({page:(n+1).toString(),count:a.toString(),query:e,sort:d,fuzzy:m}),s=(e=>{const n=Object.fromEntries(e.map(({key:e,value:n})=>[e,n]));return Object.entries({"trade-policy":i.storage.channel,...n}).map(([e,n])=>({key:e,value:n}))})(r).map(({key:e,value:n})=>`${e}/${n}`).join("/");return l(`${t}/api/split/${o}/${s}?${u.toString()}`)};return{facets:e=>a({...e,type:"attribute_search"}),products:e=>a({...e,type:"product_search"})}},u=(e,n)=>({...e,isVariantOf:n}),s=e=>a(e,{separator:"-",lowercase:!0}),p=e=>"brand"===e.type,c={id:({id:e})=>e.toString(),slug:({name:e})=>s(e),seo:e=>p(e)?{title:e.title,description:e.metaTagDescription}:{title:e.Title,description:e.MetaTagDescription},type:e=>p(e)?"Brand":0===e.level?"Department":"Category",meta:e=>p(e)?{selectedFacets:[{key:"brand",value:s(e.name)}]}:{selectedFacets:new URL(e.url).pathname.slice(1).split("/").map((e,n)=>({key:"category-"+(n+1),value:s(e)}))},breadcrumbList:()=>({itemListElement:[],numberOfItems:0})},k=e=>[e.itemOffered.sku,e.seller.identifier,e.price].join("::"),y=(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}),N=e=>({quantity:e.quantity,seller:e.seller.identifier,id:e.itemOffered.sku,index:e.index}),v=e=>e.reduce((e,n)=>{var i;const t=k(n);return e.set(t,null!=(i=e.get(t))?i:n),e},new Map),f={name:"image",value:"https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg"},g=(e,n)=>`${e}-${n}`,S=(e,n)=>`/${g(e,n)}/p`,T=e=>Array.isArray(e)&&e.length>0?e:null,D=e=>{const n=e.split("-").pop();if(null==n)throw new Error("Error while extracting sku id from product slug");return n},h=({key:e,value:n})=>{switch(e){case"channel":return{key:"trade-policy",value:n};case"slug":return{key:"id",value:D(n)};default:return{key:e,value:n}}},F={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:""},O={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(h))},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:F[null!=t?t:"score_desc"],selectedFacets:null!=(m=null==d?void 0:d.map(h))?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(c.slug(e,null,i,null))).map((e,n)=>({node:e,cursor:n.toString()}))}}},b={StoreCollection:c,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})=>g(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:S(i,t),position:e.length+1}],numberOfItems:e.length}),image:({isVariantOf:e,images:n})=>{var i,t;return(null!=(i=null!=(t=T(n))?t:T(e.images))?i:[f]).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:O,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=v(i),m=v(l.items.map(y)),u=Array.from(o.values()),s=Array.from(m.values()),{itemsToAdd:p,itemsToUpdate:c}=u.reduce((e,n)=>{const i=m.get(k(n));return i?e.itemsToUpdate.push({...i,quantity:n.quantity}):e.itemsToAdd.push(n),e},{itemsToAdd:[],itemsToUpdate:[]}),f=[...p,...c,...s.filter(e=>!o.has(k(e))).map(e=>({...e,quantity:0}))].map(N);if(0===f.length)return null;const g=await a.checkout.updateOrderFormItems({id:l.orderFormId,orderItems:f});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 I={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}};I.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 C={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}};C.loc.source={body:"type StoreAggregateRating {\n ratingValue: Float!\n reviewCount: Int!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var P={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}};P.loc.source={body:"type StoreAuthor {\n name: String!\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var V={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}};V.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 L={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}};L.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 q={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}};q.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 R={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}};R.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 E={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}};E.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 j={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}};j.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 _={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}};_.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 A={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}};A.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 G={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}};G.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 x={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}};x.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 $={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}};$.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 B={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:"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:1214}};B.loc.source={body:'type StoreProductEdge {\n node: StoreProduct!\n cursor: String!\n}\n\ntype StoreProductConnection {\n pageInfo: StorePageInfo!\n edges: [StoreProductEdge!]!\n}\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 search(\n # Relay style pagination args. To know more: https://relay.dev/graphql/connections.htm\n first: Int!\n # Relay style pagination args. To know more: https://relay.dev/graphql/connections.htm\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 Q={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}};Q.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 M={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}};M.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 z={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}};z.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 U={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}};U.loc.source={body:"enum StoreStatus {\n INFO\n WARNING\n ERROR\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};const W=[B,E,V,w,L,q,R,G,x,M,j,C,Q,P,$,A,I,_,z,U].map(r.print).join("\n"),H={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}`)}},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)}},J=()=>W,K=e=>H[e.platform].getResolvers(e);exports.getContextFactory=e=>H[e.platform].getContextFactory(e),exports.getResolvers=K,exports.getSchema=async e=>n.makeExecutableSchema({resolvers:K(e),typeDefs:J()}),exports.getTypeDefs=J; | ||
//# sourceMappingURL=api.cjs.production.min.js.map |
@@ -85,5 +85,6 @@ import { makeExecutableSchema } from '@graphql-tools/schema'; | ||
const IntelligentSearch = ({ | ||
account | ||
account, | ||
environment | ||
}, ctx) => { | ||
const base = `http://search.biggylabs.com.br/search-api/v1/${account}`; | ||
const base = `http://portal.${environment}.com.br/search-api/v1/${account}`; | ||
@@ -90,0 +91,0 @@ const addDefaultFacets = facets => { |
@@ -19,5 +19,5 @@ import type { Context, Options } from '../../index'; | ||
} | ||
export declare const IntelligentSearch: ({ account }: Options, ctx: Context) => { | ||
export declare const IntelligentSearch: ({ account, environment }: Options, ctx: Context) => { | ||
facets: (args: Omit<SearchArgs, 'type'>) => Promise<AttributeSearchResult>; | ||
products: (args: Omit<SearchArgs, 'type'>) => Promise<ProductSearchResult>; | ||
}; |
{ | ||
"name": "@faststore/api", | ||
"version": "1.2.35", | ||
"version": "1.2.36", | ||
"license": "MIT", | ||
@@ -45,3 +45,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "e567b79ac230b21b6908eab0d3ee6623d4ac2fd4" | ||
"gitHead": "f4abe462adc5a54d88fbc6e75746f549bca9ac19" | ||
} |
@@ -32,4 +32,7 @@ import type { Context, Options } from '../../index' | ||
export const IntelligentSearch = ({ account }: Options, ctx: Context) => { | ||
const base = `http://search.biggylabs.com.br/search-api/v1/${account}` | ||
export const IntelligentSearch = ( | ||
{ account, environment }: Options, | ||
ctx: Context | ||
) => { | ||
const base = `http://portal.${environment}.com.br/search-api/v1/${account}` | ||
@@ -36,0 +39,0 @@ const addDefaultFacets = (facets: SelectedFacet[]) => { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
479895
5987