@faststore/api 2.2.42 → 2.2.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (519) hide show
  1. package/dist/cjs/package.json +79 -0
  2. package/dist/{__generated__ → cjs/src/__generated__}/schema.d.ts +1045 -1045
  3. package/dist/cjs/src/__generated__/schema.js +7 -0
  4. package/dist/cjs/src/__generated__/schema.js.map +1 -0
  5. package/dist/{directives → cjs/src/directives}/cacheControl.d.ts +9 -9
  6. package/dist/cjs/src/directives/cacheControl.js +45 -0
  7. package/dist/cjs/src/directives/cacheControl.js.map +1 -0
  8. package/dist/{directives → cjs/src/directives}/index.d.ts +5 -5
  9. package/dist/cjs/src/directives/index.js +3 -0
  10. package/dist/cjs/src/directives/index.js.map +1 -0
  11. package/dist/{index.d.ts → cjs/src/index.d.ts} +163 -163
  12. package/dist/cjs/src/index.js +38 -0
  13. package/dist/cjs/src/index.js.map +1 -0
  14. package/dist/{platforms → cjs/src/platforms}/errors.d.ts +19 -19
  15. package/dist/cjs/src/platforms/errors.js +30 -0
  16. package/dist/cjs/src/platforms/errors.js.map +1 -0
  17. package/dist/{platforms → cjs/src/platforms}/vtex/clients/commerce/index.d.ts +75 -75
  18. package/dist/cjs/src/platforms/vtex/clients/commerce/index.js +165 -0
  19. package/dist/cjs/src/platforms/vtex/clients/commerce/index.js.map +1 -0
  20. package/dist/{platforms → cjs/src/platforms}/vtex/clients/commerce/types/Address.d.ts +16 -16
  21. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Address.js +3 -0
  22. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Address.js.map +1 -0
  23. package/dist/{platforms → cjs/src/platforms}/vtex/clients/commerce/types/Brand.d.ts +8 -8
  24. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Brand.js +3 -0
  25. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Brand.js.map +1 -0
  26. package/dist/{platforms → cjs/src/platforms}/vtex/clients/commerce/types/CategoryTree.d.ts +9 -9
  27. package/dist/cjs/src/platforms/vtex/clients/commerce/types/CategoryTree.js +3 -0
  28. package/dist/cjs/src/platforms/vtex/clients/commerce/types/CategoryTree.js.map +1 -0
  29. package/dist/{platforms → cjs/src/platforms}/vtex/clients/commerce/types/Newsletter.d.ts +4 -4
  30. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Newsletter.js +3 -0
  31. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Newsletter.js.map +1 -0
  32. package/dist/{platforms → cjs/src/platforms}/vtex/clients/commerce/types/OrderForm.d.ts +371 -371
  33. package/dist/cjs/src/platforms/vtex/clients/commerce/types/OrderForm.js +3 -0
  34. package/dist/cjs/src/platforms/vtex/clients/commerce/types/OrderForm.js.map +1 -0
  35. package/dist/{platforms → cjs/src/platforms}/vtex/clients/commerce/types/Portal.d.ts +17 -17
  36. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Portal.js +3 -0
  37. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Portal.js.map +1 -0
  38. package/dist/{platforms → cjs/src/platforms}/vtex/clients/commerce/types/Product.d.ts +174 -174
  39. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Product.js +53 -0
  40. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Product.js.map +1 -0
  41. package/dist/{platforms → cjs/src/platforms}/vtex/clients/commerce/types/Region.d.ts +19 -19
  42. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Region.js +3 -0
  43. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Region.js.map +1 -0
  44. package/dist/{platforms → cjs/src/platforms}/vtex/clients/commerce/types/SalesChannel.d.ts +24 -24
  45. package/dist/cjs/src/platforms/vtex/clients/commerce/types/SalesChannel.js +3 -0
  46. package/dist/cjs/src/platforms/vtex/clients/commerce/types/SalesChannel.js.map +1 -0
  47. package/dist/{platforms → cjs/src/platforms}/vtex/clients/commerce/types/Session.d.ts +33 -33
  48. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Session.js +3 -0
  49. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Session.js.map +1 -0
  50. package/dist/{platforms → cjs/src/platforms}/vtex/clients/commerce/types/ShippingData.d.ts +38 -38
  51. package/dist/cjs/src/platforms/vtex/clients/commerce/types/ShippingData.js +3 -0
  52. package/dist/cjs/src/platforms/vtex/clients/commerce/types/ShippingData.js.map +1 -0
  53. package/dist/{platforms → cjs/src/platforms}/vtex/clients/commerce/types/Simulation.d.ts +154 -154
  54. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Simulation.js +3 -0
  55. package/dist/cjs/src/platforms/vtex/clients/commerce/types/Simulation.js.map +1 -0
  56. package/dist/{platforms → cjs/src/platforms}/vtex/clients/fetch.d.ts +1 -1
  57. package/dist/cjs/src/platforms/vtex/clients/fetch.js +24 -0
  58. package/dist/cjs/src/platforms/vtex/clients/fetch.js.map +1 -0
  59. package/dist/{platforms → cjs/src/platforms}/vtex/clients/index.d.ts +71 -71
  60. package/dist/cjs/src/platforms/vtex/clients/index.js +18 -0
  61. package/dist/cjs/src/platforms/vtex/clients/index.js.map +1 -0
  62. package/dist/{platforms → cjs/src/platforms}/vtex/clients/search/index.d.ts +26 -26
  63. package/dist/cjs/src/platforms/vtex/clients/search/index.js +88 -0
  64. package/dist/cjs/src/platforms/vtex/clients/search/index.js.map +1 -0
  65. package/dist/{platforms → cjs/src/platforms}/vtex/clients/search/types/AttributeSearchResult.d.ts +30 -30
  66. package/dist/cjs/src/platforms/vtex/clients/search/types/AttributeSearchResult.js +3 -0
  67. package/dist/cjs/src/platforms/vtex/clients/search/types/AttributeSearchResult.js.map +1 -0
  68. package/dist/{platforms → cjs/src/platforms}/vtex/clients/search/types/FacetSearchResult.d.ts +31 -31
  69. package/dist/cjs/src/platforms/vtex/clients/search/types/FacetSearchResult.js +3 -0
  70. package/dist/cjs/src/platforms/vtex/clients/search/types/FacetSearchResult.js.map +1 -0
  71. package/dist/{platforms → cjs/src/platforms}/vtex/clients/search/types/ProductSearchResult.d.ts +206 -206
  72. package/dist/cjs/src/platforms/vtex/clients/search/types/ProductSearchResult.js +3 -0
  73. package/dist/cjs/src/platforms/vtex/clients/search/types/ProductSearchResult.js.map +1 -0
  74. package/dist/{platforms → cjs/src/platforms}/vtex/clients/sp/index.d.ts +14 -14
  75. package/dist/cjs/src/platforms/vtex/clients/sp/index.js +49 -0
  76. package/dist/cjs/src/platforms/vtex/clients/sp/index.js.map +1 -0
  77. package/dist/{platforms → cjs/src/platforms}/vtex/index.d.ts +188 -188
  78. package/dist/cjs/src/platforms/vtex/index.js +59 -0
  79. package/dist/cjs/src/platforms/vtex/index.js.map +1 -0
  80. package/dist/{platforms → cjs/src/platforms}/vtex/loaders/collection.d.ts +6 -6
  81. package/dist/cjs/src/platforms/vtex/loaders/collection.js +38 -0
  82. package/dist/cjs/src/platforms/vtex/loaders/collection.js.map +1 -0
  83. package/dist/{platforms → cjs/src/platforms}/vtex/loaders/index.d.ts +8 -8
  84. package/dist/cjs/src/platforms/vtex/loaders/index.js +21 -0
  85. package/dist/cjs/src/platforms/vtex/loaders/index.js.map +1 -0
  86. package/dist/{platforms → cjs/src/platforms}/vtex/loaders/salesChannel.d.ts +5 -5
  87. package/dist/cjs/src/platforms/vtex/loaders/salesChannel.js +11 -0
  88. package/dist/cjs/src/platforms/vtex/loaders/salesChannel.js.map +1 -0
  89. package/dist/{platforms → cjs/src/platforms}/vtex/loaders/simulation.d.ts +5 -5
  90. package/dist/cjs/src/platforms/vtex/loaders/simulation.js +44 -0
  91. package/dist/cjs/src/platforms/vtex/loaders/simulation.js.map +1 -0
  92. package/dist/{platforms → cjs/src/platforms}/vtex/loaders/sku.d.ts +5 -5
  93. package/dist/cjs/src/platforms/vtex/loaders/sku.js +33 -0
  94. package/dist/cjs/src/platforms/vtex/loaders/sku.js.map +1 -0
  95. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/aggregateOffer.d.ts +7 -7
  96. package/dist/cjs/src/platforms/vtex/resolvers/aggregateOffer.js +23 -0
  97. package/dist/cjs/src/platforms/vtex/resolvers/aggregateOffer.js.map +1 -0
  98. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/aggregateRating.d.ts +2 -2
  99. package/dist/cjs/src/platforms/vtex/resolvers/aggregateRating.js +9 -0
  100. package/dist/cjs/src/platforms/vtex/resolvers/aggregateRating.js.map +1 -0
  101. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/collection.d.ts +8 -8
  102. package/dist/cjs/src/platforms/vtex/resolvers/collection.js +81 -0
  103. package/dist/cjs/src/platforms/vtex/resolvers/collection.js.map +1 -0
  104. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/faceValue.d.ts +3 -3
  105. package/dist/cjs/src/platforms/vtex/resolvers/faceValue.js +10 -0
  106. package/dist/cjs/src/platforms/vtex/resolvers/faceValue.js.map +1 -0
  107. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/facet.d.ts +6 -6
  108. package/dist/cjs/src/platforms/vtex/resolvers/facet.js +50 -0
  109. package/dist/cjs/src/platforms/vtex/resolvers/facet.js.map +1 -0
  110. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/mutation.d.ts +59 -59
  111. package/dist/cjs/src/platforms/vtex/resolvers/mutation.js +12 -0
  112. package/dist/cjs/src/platforms/vtex/resolvers/mutation.js.map +1 -0
  113. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/objectOrString.d.ts +2 -2
  114. package/dist/cjs/src/platforms/vtex/resolvers/objectOrString.js +41 -0
  115. package/dist/cjs/src/platforms/vtex/resolvers/objectOrString.js.map +1 -0
  116. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/offer.d.ts +12 -12
  117. package/dist/cjs/src/platforms/vtex/resolvers/offer.js +94 -0
  118. package/dist/cjs/src/platforms/vtex/resolvers/offer.js.map +1 -0
  119. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/organization.d.ts +5 -5
  120. package/dist/cjs/src/platforms/vtex/resolvers/organization.js +7 -0
  121. package/dist/cjs/src/platforms/vtex/resolvers/organization.js.map +1 -0
  122. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/product.d.ts +14 -14
  123. package/dist/cjs/src/platforms/vtex/resolvers/product.js +78 -0
  124. package/dist/cjs/src/platforms/vtex/resolvers/product.js.map +1 -0
  125. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/productGroup.d.ts +5 -5
  126. package/dist/cjs/src/platforms/vtex/resolvers/productGroup.js +22 -0
  127. package/dist/cjs/src/platforms/vtex/resolvers/productGroup.js.map +1 -0
  128. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/propertyValue.d.ts +4 -4
  129. package/dist/cjs/src/platforms/vtex/resolvers/propertyValue.js +11 -0
  130. package/dist/cjs/src/platforms/vtex/resolvers/propertyValue.js.map +1 -0
  131. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/query.d.ts +72 -72
  132. package/dist/cjs/src/platforms/vtex/resolvers/query.js +223 -0
  133. package/dist/cjs/src/platforms/vtex/resolvers/query.js.map +1 -0
  134. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/review.d.ts +2 -2
  135. package/dist/cjs/src/platforms/vtex/resolvers/review.js +13 -0
  136. package/dist/cjs/src/platforms/vtex/resolvers/review.js.map +1 -0
  137. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/root.d.ts +12 -12
  138. package/dist/cjs/src/platforms/vtex/resolvers/root.js +3 -0
  139. package/dist/cjs/src/platforms/vtex/resolvers/root.js.map +1 -0
  140. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/searchResult.d.ts +8 -8
  141. package/dist/cjs/src/platforms/vtex/resolvers/searchResult.js +97 -0
  142. package/dist/cjs/src/platforms/vtex/resolvers/searchResult.js.map +1 -0
  143. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/seo.d.ts +7 -7
  144. package/dist/cjs/src/platforms/vtex/resolvers/seo.js +10 -0
  145. package/dist/cjs/src/platforms/vtex/resolvers/seo.js.map +1 -0
  146. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/shippingSLA.d.ts +13 -13
  147. package/dist/cjs/src/platforms/vtex/resolvers/shippingSLA.js +48 -0
  148. package/dist/cjs/src/platforms/vtex/resolvers/shippingSLA.js.map +1 -0
  149. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/skuVariations.d.ts +5 -5
  150. package/dist/cjs/src/platforms/vtex/resolvers/skuVariations.js +17 -0
  151. package/dist/cjs/src/platforms/vtex/resolvers/skuVariations.js.map +1 -0
  152. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/subscribeToNewsletter.d.ts +3 -3
  153. package/dist/cjs/src/platforms/vtex/resolvers/subscribeToNewsletter.js +9 -0
  154. package/dist/cjs/src/platforms/vtex/resolvers/subscribeToNewsletter.js.map +1 -0
  155. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/validateCart.d.ts +70 -70
  156. package/dist/cjs/src/platforms/vtex/resolvers/validateCart.js +282 -0
  157. package/dist/cjs/src/platforms/vtex/resolvers/validateCart.js.map +1 -0
  158. package/dist/{platforms → cjs/src/platforms}/vtex/resolvers/validateSession.d.ts +3 -3
  159. package/dist/cjs/src/platforms/vtex/resolvers/validateSession.js +58 -0
  160. package/dist/cjs/src/platforms/vtex/resolvers/validateSession.js.map +1 -0
  161. package/dist/{platforms → cjs/src/platforms}/vtex/utils/canonical.d.ts +2 -2
  162. package/dist/cjs/src/platforms/vtex/utils/canonical.js +6 -0
  163. package/dist/cjs/src/platforms/vtex/utils/canonical.js.map +1 -0
  164. package/dist/{platforms → cjs/src/platforms}/vtex/utils/channel.d.ts +9 -9
  165. package/dist/cjs/src/platforms/vtex/utils/channel.js +23 -0
  166. package/dist/cjs/src/platforms/vtex/utils/channel.js.map +1 -0
  167. package/dist/{platforms → cjs/src/platforms}/vtex/utils/contex.d.ts +3 -3
  168. package/dist/cjs/src/platforms/vtex/utils/contex.js +14 -0
  169. package/dist/cjs/src/platforms/vtex/utils/contex.js.map +1 -0
  170. package/dist/{platforms → cjs/src/platforms}/vtex/utils/createNewAddress.d.ts +3 -3
  171. package/dist/cjs/src/platforms/vtex/utils/createNewAddress.js +34 -0
  172. package/dist/cjs/src/platforms/vtex/utils/createNewAddress.js.map +1 -0
  173. package/dist/{platforms → cjs/src/platforms}/vtex/utils/enhanceCommercialOffer.d.ts +10 -10
  174. package/dist/cjs/src/platforms/vtex/utils/enhanceCommercialOffer.js +10 -0
  175. package/dist/cjs/src/platforms/vtex/utils/enhanceCommercialOffer.js.map +1 -0
  176. package/dist/{platforms → cjs/src/platforms}/vtex/utils/enhanceSku.d.ts +5 -5
  177. package/dist/cjs/src/platforms/vtex/utils/enhanceSku.js +18 -0
  178. package/dist/cjs/src/platforms/vtex/utils/enhanceSku.js.map +1 -0
  179. package/dist/{platforms → cjs/src/platforms}/vtex/utils/facets.d.ts +32 -31
  180. package/dist/cjs/src/platforms/vtex/utils/facets.js +65 -0
  181. package/dist/cjs/src/platforms/vtex/utils/facets.js.map +1 -0
  182. package/dist/{platforms → cjs/src/platforms}/vtex/utils/getAddressOrderForm.d.ts +3 -3
  183. package/dist/cjs/src/platforms/vtex/utils/getAddressOrderForm.js +42 -0
  184. package/dist/cjs/src/platforms/vtex/utils/getAddressOrderForm.js.map +1 -0
  185. package/dist/{platforms → cjs/src/platforms}/vtex/utils/md5.d.ts +1 -1
  186. package/dist/cjs/src/platforms/vtex/utils/md5.js +8 -0
  187. package/dist/cjs/src/platforms/vtex/utils/md5.js.map +1 -0
  188. package/dist/{platforms → cjs/src/platforms}/vtex/utils/orderStatistics.d.ts +4 -4
  189. package/dist/cjs/src/platforms/vtex/utils/orderStatistics.js +18 -0
  190. package/dist/cjs/src/platforms/vtex/utils/orderStatistics.js.map +1 -0
  191. package/dist/{platforms → cjs/src/platforms}/vtex/utils/productStock.d.ts +7 -7
  192. package/dist/cjs/src/platforms/vtex/utils/productStock.js +25 -0
  193. package/dist/cjs/src/platforms/vtex/utils/productStock.js.map +1 -0
  194. package/dist/{platforms → cjs/src/platforms}/vtex/utils/propertyValue.d.ts +12 -12
  195. package/dist/cjs/src/platforms/vtex/utils/propertyValue.js +21 -0
  196. package/dist/cjs/src/platforms/vtex/utils/propertyValue.js.map +1 -0
  197. package/dist/{platforms → cjs/src/platforms}/vtex/utils/sanitizeHtml.d.ts +17 -17
  198. package/dist/cjs/src/platforms/vtex/utils/sanitizeHtml.js +23 -0
  199. package/dist/cjs/src/platforms/vtex/utils/sanitizeHtml.js.map +1 -0
  200. package/dist/{platforms → cjs/src/platforms}/vtex/utils/shouldUpdateShippingData.d.ts +6 -6
  201. package/dist/cjs/src/platforms/vtex/utils/shouldUpdateShippingData.js +72 -0
  202. package/dist/cjs/src/platforms/vtex/utils/shouldUpdateShippingData.js.map +1 -0
  203. package/dist/{platforms → cjs/src/platforms}/vtex/utils/sku.d.ts +8 -8
  204. package/dist/cjs/src/platforms/vtex/utils/sku.js +22 -0
  205. package/dist/cjs/src/platforms/vtex/utils/sku.js.map +1 -0
  206. package/dist/{platforms → cjs/src/platforms}/vtex/utils/skuVariants.d.ts +15 -15
  207. package/dist/cjs/src/platforms/vtex/utils/skuVariants.js +139 -0
  208. package/dist/cjs/src/platforms/vtex/utils/skuVariants.js.map +1 -0
  209. package/dist/{platforms → cjs/src/platforms}/vtex/utils/slugify.d.ts +1 -1
  210. package/dist/cjs/src/platforms/vtex/utils/slugify.js +43 -0
  211. package/dist/cjs/src/platforms/vtex/utils/slugify.js.map +1 -0
  212. package/dist/{platforms → cjs/src/platforms}/vtex/utils/sort.d.ts +10 -10
  213. package/dist/cjs/src/platforms/vtex/utils/sort.js +14 -0
  214. package/dist/cjs/src/platforms/vtex/utils/sort.js.map +1 -0
  215. package/dist/{telemetry → cjs/src/telemetry}/index.d.ts +8 -8
  216. package/dist/cjs/src/telemetry/index.js +77 -0
  217. package/dist/cjs/src/telemetry/index.js.map +1 -0
  218. package/dist/{telemetry → cjs/src/telemetry}/useFaststoreTelemetry.d.ts +24 -24
  219. package/dist/cjs/src/telemetry/useFaststoreTelemetry.js +174 -0
  220. package/dist/cjs/src/telemetry/useFaststoreTelemetry.js.map +1 -0
  221. package/dist/cjs/src/typeDefs/address.graphql +45 -0
  222. package/dist/cjs/src/typeDefs/aggregateOffer.graphql +25 -0
  223. package/dist/cjs/src/typeDefs/aggregateRating.graphql +13 -0
  224. package/dist/cjs/src/typeDefs/author.graphql +9 -0
  225. package/dist/cjs/src/typeDefs/brand.graphql +9 -0
  226. package/dist/cjs/src/typeDefs/breadcrumb.graphql +31 -0
  227. package/dist/cjs/src/typeDefs/cart.graphql +37 -0
  228. package/dist/cjs/src/typeDefs/collection.graphql +83 -0
  229. package/dist/cjs/src/typeDefs/facet.graphql +77 -0
  230. package/dist/cjs/src/typeDefs/image.graphql +27 -0
  231. package/dist/{typeDefs → cjs/src/typeDefs}/index.d.ts +1 -1
  232. package/dist/cjs/src/typeDefs/index.js +10 -0
  233. package/dist/cjs/src/typeDefs/index.js.map +1 -0
  234. package/dist/cjs/src/typeDefs/mutation.graphql +14 -0
  235. package/dist/cjs/src/typeDefs/newsletter.graphql +24 -0
  236. package/dist/cjs/src/typeDefs/objectOrString.graphql +1 -0
  237. package/dist/cjs/src/typeDefs/offer.graphql +71 -0
  238. package/dist/cjs/src/typeDefs/order.graphql +31 -0
  239. package/dist/cjs/src/typeDefs/organization.graphql +19 -0
  240. package/dist/cjs/src/typeDefs/pageInfo.graphql +25 -0
  241. package/dist/cjs/src/typeDefs/person.graphql +43 -0
  242. package/dist/cjs/src/typeDefs/product.graphql +91 -0
  243. package/dist/cjs/src/typeDefs/productGroup.graphql +27 -0
  244. package/dist/cjs/src/typeDefs/propertyValue.graphql +40 -0
  245. package/dist/cjs/src/typeDefs/query.graphql +377 -0
  246. package/dist/cjs/src/typeDefs/review.graphql +27 -0
  247. package/dist/cjs/src/typeDefs/seo.graphql +21 -0
  248. package/dist/cjs/src/typeDefs/session.graphql +194 -0
  249. package/dist/cjs/src/typeDefs/shipping.graphql +331 -0
  250. package/dist/cjs/src/typeDefs/skuVariants.graphql +90 -0
  251. package/dist/cjs/src/typeDefs/status.graphql +8 -0
  252. package/dist/cjs/src/typings/index.d.ts +3 -0
  253. package/dist/cjs/src/typings/index.js +3 -0
  254. package/dist/cjs/src/typings/index.js.map +1 -0
  255. package/dist/esm/package.json +79 -0
  256. package/dist/esm/src/__generated__/schema.d.ts +1045 -0
  257. package/dist/esm/src/__generated__/schema.js +6 -0
  258. package/dist/esm/src/__generated__/schema.js.map +1 -0
  259. package/dist/esm/src/directives/cacheControl.d.ts +9 -0
  260. package/dist/esm/src/directives/cacheControl.js +41 -0
  261. package/dist/esm/src/directives/cacheControl.js.map +1 -0
  262. package/dist/esm/src/directives/index.d.ts +5 -0
  263. package/dist/esm/src/directives/index.js +2 -0
  264. package/dist/esm/src/directives/index.js.map +1 -0
  265. package/dist/esm/src/index.d.ts +163 -0
  266. package/dist/esm/src/index.js +29 -0
  267. package/dist/esm/src/index.js.map +1 -0
  268. package/dist/esm/src/platforms/errors.d.ts +19 -0
  269. package/dist/esm/src/platforms/errors.js +22 -0
  270. package/dist/esm/src/platforms/errors.js.map +1 -0
  271. package/dist/esm/src/platforms/vtex/clients/commerce/index.d.ts +75 -0
  272. package/dist/esm/src/platforms/vtex/clients/commerce/index.js +161 -0
  273. package/dist/esm/src/platforms/vtex/clients/commerce/index.js.map +1 -0
  274. package/dist/esm/src/platforms/vtex/clients/commerce/types/Address.d.ts +16 -0
  275. package/dist/esm/src/platforms/vtex/clients/commerce/types/Address.js +2 -0
  276. package/dist/esm/src/platforms/vtex/clients/commerce/types/Address.js.map +1 -0
  277. package/dist/esm/src/platforms/vtex/clients/commerce/types/Brand.d.ts +8 -0
  278. package/dist/esm/src/platforms/vtex/clients/commerce/types/Brand.js +2 -0
  279. package/dist/esm/src/platforms/vtex/clients/commerce/types/Brand.js.map +1 -0
  280. package/dist/esm/src/platforms/vtex/clients/commerce/types/CategoryTree.d.ts +9 -0
  281. package/dist/esm/src/platforms/vtex/clients/commerce/types/CategoryTree.js +2 -0
  282. package/dist/esm/src/platforms/vtex/clients/commerce/types/CategoryTree.js.map +1 -0
  283. package/dist/esm/src/platforms/vtex/clients/commerce/types/Newsletter.d.ts +4 -0
  284. package/dist/esm/src/platforms/vtex/clients/commerce/types/Newsletter.js +2 -0
  285. package/dist/esm/src/platforms/vtex/clients/commerce/types/Newsletter.js.map +1 -0
  286. package/dist/esm/src/platforms/vtex/clients/commerce/types/OrderForm.d.ts +371 -0
  287. package/dist/esm/src/platforms/vtex/clients/commerce/types/OrderForm.js +2 -0
  288. package/dist/esm/src/platforms/vtex/clients/commerce/types/OrderForm.js.map +1 -0
  289. package/dist/esm/src/platforms/vtex/clients/commerce/types/Portal.d.ts +17 -0
  290. package/dist/esm/src/platforms/vtex/clients/commerce/types/Portal.js +2 -0
  291. package/dist/esm/src/platforms/vtex/clients/commerce/types/Portal.js.map +1 -0
  292. package/dist/esm/src/platforms/vtex/clients/commerce/types/Product.d.ts +174 -0
  293. package/dist/esm/src/platforms/vtex/clients/commerce/types/Product.js +52 -0
  294. package/dist/esm/src/platforms/vtex/clients/commerce/types/Product.js.map +1 -0
  295. package/dist/esm/src/platforms/vtex/clients/commerce/types/Region.d.ts +19 -0
  296. package/dist/esm/src/platforms/vtex/clients/commerce/types/Region.js +2 -0
  297. package/dist/esm/src/platforms/vtex/clients/commerce/types/Region.js.map +1 -0
  298. package/dist/esm/src/platforms/vtex/clients/commerce/types/SalesChannel.d.ts +24 -0
  299. package/dist/esm/src/platforms/vtex/clients/commerce/types/SalesChannel.js +2 -0
  300. package/dist/esm/src/platforms/vtex/clients/commerce/types/SalesChannel.js.map +1 -0
  301. package/dist/esm/src/platforms/vtex/clients/commerce/types/Session.d.ts +33 -0
  302. package/dist/esm/src/platforms/vtex/clients/commerce/types/Session.js +2 -0
  303. package/dist/esm/src/platforms/vtex/clients/commerce/types/Session.js.map +1 -0
  304. package/dist/esm/src/platforms/vtex/clients/commerce/types/ShippingData.d.ts +38 -0
  305. package/dist/esm/src/platforms/vtex/clients/commerce/types/ShippingData.js +2 -0
  306. package/dist/esm/src/platforms/vtex/clients/commerce/types/ShippingData.js.map +1 -0
  307. package/dist/esm/src/platforms/vtex/clients/commerce/types/Simulation.d.ts +154 -0
  308. package/dist/esm/src/platforms/vtex/clients/commerce/types/Simulation.js +2 -0
  309. package/dist/esm/src/platforms/vtex/clients/commerce/types/Simulation.js.map +1 -0
  310. package/dist/esm/src/platforms/vtex/clients/fetch.d.ts +1 -0
  311. package/dist/esm/src/platforms/vtex/clients/fetch.js +19 -0
  312. package/dist/esm/src/platforms/vtex/clients/fetch.js.map +1 -0
  313. package/dist/esm/src/platforms/vtex/clients/index.d.ts +71 -0
  314. package/dist/esm/src/platforms/vtex/clients/index.js +14 -0
  315. package/dist/esm/src/platforms/vtex/clients/index.js.map +1 -0
  316. package/dist/esm/src/platforms/vtex/clients/search/index.d.ts +26 -0
  317. package/dist/esm/src/platforms/vtex/clients/search/index.js +83 -0
  318. package/dist/esm/src/platforms/vtex/clients/search/index.js.map +1 -0
  319. package/dist/esm/src/platforms/vtex/clients/search/types/AttributeSearchResult.d.ts +30 -0
  320. package/dist/esm/src/platforms/vtex/clients/search/types/AttributeSearchResult.js +2 -0
  321. package/dist/esm/src/platforms/vtex/clients/search/types/AttributeSearchResult.js.map +1 -0
  322. package/dist/esm/src/platforms/vtex/clients/search/types/FacetSearchResult.d.ts +31 -0
  323. package/dist/esm/src/platforms/vtex/clients/search/types/FacetSearchResult.js +2 -0
  324. package/dist/esm/src/platforms/vtex/clients/search/types/FacetSearchResult.js.map +1 -0
  325. package/dist/esm/src/platforms/vtex/clients/search/types/ProductSearchResult.d.ts +206 -0
  326. package/dist/esm/src/platforms/vtex/clients/search/types/ProductSearchResult.js +2 -0
  327. package/dist/esm/src/platforms/vtex/clients/search/types/ProductSearchResult.js.map +1 -0
  328. package/dist/esm/src/platforms/vtex/clients/sp/index.d.ts +14 -0
  329. package/dist/esm/src/platforms/vtex/clients/sp/index.js +45 -0
  330. package/dist/esm/src/platforms/vtex/clients/sp/index.js.map +1 -0
  331. package/dist/esm/src/platforms/vtex/index.d.ts +188 -0
  332. package/dist/esm/src/platforms/vtex/index.js +53 -0
  333. package/dist/esm/src/platforms/vtex/index.js.map +1 -0
  334. package/dist/esm/src/platforms/vtex/loaders/collection.d.ts +6 -0
  335. package/dist/esm/src/platforms/vtex/loaders/collection.js +32 -0
  336. package/dist/esm/src/platforms/vtex/loaders/collection.js.map +1 -0
  337. package/dist/esm/src/platforms/vtex/loaders/index.d.ts +8 -0
  338. package/dist/esm/src/platforms/vtex/loaders/index.js +17 -0
  339. package/dist/esm/src/platforms/vtex/loaders/index.js.map +1 -0
  340. package/dist/esm/src/platforms/vtex/loaders/salesChannel.d.ts +5 -0
  341. package/dist/esm/src/platforms/vtex/loaders/salesChannel.js +6 -0
  342. package/dist/esm/src/platforms/vtex/loaders/salesChannel.js.map +1 -0
  343. package/dist/esm/src/platforms/vtex/loaders/simulation.d.ts +5 -0
  344. package/dist/esm/src/platforms/vtex/loaders/simulation.js +39 -0
  345. package/dist/esm/src/platforms/vtex/loaders/simulation.js.map +1 -0
  346. package/dist/esm/src/platforms/vtex/loaders/sku.d.ts +5 -0
  347. package/dist/esm/src/platforms/vtex/loaders/sku.js +28 -0
  348. package/dist/esm/src/platforms/vtex/loaders/sku.js.map +1 -0
  349. package/dist/esm/src/platforms/vtex/resolvers/aggregateOffer.d.ts +7 -0
  350. package/dist/esm/src/platforms/vtex/resolvers/aggregateOffer.js +20 -0
  351. package/dist/esm/src/platforms/vtex/resolvers/aggregateOffer.js.map +1 -0
  352. package/dist/esm/src/platforms/vtex/resolvers/aggregateRating.d.ts +2 -0
  353. package/dist/esm/src/platforms/vtex/resolvers/aggregateRating.js +6 -0
  354. package/dist/esm/src/platforms/vtex/resolvers/aggregateRating.js.map +1 -0
  355. package/dist/esm/src/platforms/vtex/resolvers/collection.d.ts +8 -0
  356. package/dist/esm/src/platforms/vtex/resolvers/collection.js +78 -0
  357. package/dist/esm/src/platforms/vtex/resolvers/collection.js.map +1 -0
  358. package/dist/esm/src/platforms/vtex/resolvers/faceValue.d.ts +3 -0
  359. package/dist/esm/src/platforms/vtex/resolvers/faceValue.js +7 -0
  360. package/dist/esm/src/platforms/vtex/resolvers/faceValue.js.map +1 -0
  361. package/dist/esm/src/platforms/vtex/resolvers/facet.d.ts +6 -0
  362. package/dist/esm/src/platforms/vtex/resolvers/facet.js +47 -0
  363. package/dist/esm/src/platforms/vtex/resolvers/facet.js.map +1 -0
  364. package/dist/esm/src/platforms/vtex/resolvers/mutation.d.ts +59 -0
  365. package/dist/esm/src/platforms/vtex/resolvers/mutation.js +9 -0
  366. package/dist/esm/src/platforms/vtex/resolvers/mutation.js.map +1 -0
  367. package/dist/esm/src/platforms/vtex/resolvers/objectOrString.d.ts +2 -0
  368. package/dist/esm/src/platforms/vtex/resolvers/objectOrString.js +38 -0
  369. package/dist/esm/src/platforms/vtex/resolvers/objectOrString.js.map +1 -0
  370. package/dist/esm/src/platforms/vtex/resolvers/offer.d.ts +12 -0
  371. package/dist/esm/src/platforms/vtex/resolvers/offer.js +91 -0
  372. package/dist/esm/src/platforms/vtex/resolvers/offer.js.map +1 -0
  373. package/dist/esm/src/platforms/vtex/resolvers/organization.d.ts +5 -0
  374. package/dist/esm/src/platforms/vtex/resolvers/organization.js +4 -0
  375. package/dist/esm/src/platforms/vtex/resolvers/organization.js.map +1 -0
  376. package/dist/esm/src/platforms/vtex/resolvers/product.d.ts +14 -0
  377. package/dist/esm/src/platforms/vtex/resolvers/product.js +75 -0
  378. package/dist/esm/src/platforms/vtex/resolvers/product.js.map +1 -0
  379. package/dist/esm/src/platforms/vtex/resolvers/productGroup.d.ts +5 -0
  380. package/dist/esm/src/platforms/vtex/resolvers/productGroup.js +19 -0
  381. package/dist/esm/src/platforms/vtex/resolvers/productGroup.js.map +1 -0
  382. package/dist/esm/src/platforms/vtex/resolvers/propertyValue.d.ts +4 -0
  383. package/dist/esm/src/platforms/vtex/resolvers/propertyValue.js +8 -0
  384. package/dist/esm/src/platforms/vtex/resolvers/propertyValue.js.map +1 -0
  385. package/dist/esm/src/platforms/vtex/resolvers/query.d.ts +72 -0
  386. package/dist/esm/src/platforms/vtex/resolvers/query.js +220 -0
  387. package/dist/esm/src/platforms/vtex/resolvers/query.js.map +1 -0
  388. package/dist/esm/src/platforms/vtex/resolvers/review.d.ts +2 -0
  389. package/dist/esm/src/platforms/vtex/resolvers/review.js +10 -0
  390. package/dist/esm/src/platforms/vtex/resolvers/review.js.map +1 -0
  391. package/dist/esm/src/platforms/vtex/resolvers/root.d.ts +12 -0
  392. package/dist/esm/src/platforms/vtex/resolvers/root.js +2 -0
  393. package/dist/esm/src/platforms/vtex/resolvers/root.js.map +1 -0
  394. package/dist/esm/src/platforms/vtex/resolvers/searchResult.d.ts +8 -0
  395. package/dist/esm/src/platforms/vtex/resolvers/searchResult.js +94 -0
  396. package/dist/esm/src/platforms/vtex/resolvers/searchResult.js.map +1 -0
  397. package/dist/esm/src/platforms/vtex/resolvers/seo.d.ts +7 -0
  398. package/dist/esm/src/platforms/vtex/resolvers/seo.js +7 -0
  399. package/dist/esm/src/platforms/vtex/resolvers/seo.js.map +1 -0
  400. package/dist/esm/src/platforms/vtex/resolvers/shippingSLA.d.ts +13 -0
  401. package/dist/esm/src/platforms/vtex/resolvers/shippingSLA.js +44 -0
  402. package/dist/esm/src/platforms/vtex/resolvers/shippingSLA.js.map +1 -0
  403. package/dist/esm/src/platforms/vtex/resolvers/skuVariations.d.ts +5 -0
  404. package/dist/esm/src/platforms/vtex/resolvers/skuVariations.js +14 -0
  405. package/dist/esm/src/platforms/vtex/resolvers/skuVariations.js.map +1 -0
  406. package/dist/esm/src/platforms/vtex/resolvers/subscribeToNewsletter.d.ts +3 -0
  407. package/dist/esm/src/platforms/vtex/resolvers/subscribeToNewsletter.js +5 -0
  408. package/dist/esm/src/platforms/vtex/resolvers/subscribeToNewsletter.js.map +1 -0
  409. package/dist/esm/src/platforms/vtex/resolvers/validateCart.d.ts +70 -0
  410. package/dist/esm/src/platforms/vtex/resolvers/validateCart.js +277 -0
  411. package/dist/esm/src/platforms/vtex/resolvers/validateCart.js.map +1 -0
  412. package/dist/esm/src/platforms/vtex/resolvers/validateSession.d.ts +3 -0
  413. package/dist/esm/src/platforms/vtex/resolvers/validateSession.js +53 -0
  414. package/dist/esm/src/platforms/vtex/resolvers/validateSession.js.map +1 -0
  415. package/dist/esm/src/platforms/vtex/utils/canonical.d.ts +2 -0
  416. package/dist/esm/src/platforms/vtex/utils/canonical.js +2 -0
  417. package/dist/esm/src/platforms/vtex/utils/canonical.js.map +1 -0
  418. package/dist/esm/src/platforms/vtex/utils/channel.d.ts +9 -0
  419. package/dist/esm/src/platforms/vtex/utils/channel.js +20 -0
  420. package/dist/esm/src/platforms/vtex/utils/channel.js.map +1 -0
  421. package/dist/esm/src/platforms/vtex/utils/contex.d.ts +3 -0
  422. package/dist/esm/src/platforms/vtex/utils/contex.js +8 -0
  423. package/dist/esm/src/platforms/vtex/utils/contex.js.map +1 -0
  424. package/dist/esm/src/platforms/vtex/utils/createNewAddress.d.ts +3 -0
  425. package/dist/esm/src/platforms/vtex/utils/createNewAddress.js +30 -0
  426. package/dist/esm/src/platforms/vtex/utils/createNewAddress.js.map +1 -0
  427. package/dist/esm/src/platforms/vtex/utils/enhanceCommercialOffer.d.ts +10 -0
  428. package/dist/esm/src/platforms/vtex/utils/enhanceCommercialOffer.js +6 -0
  429. package/dist/esm/src/platforms/vtex/utils/enhanceCommercialOffer.js.map +1 -0
  430. package/dist/esm/src/platforms/vtex/utils/enhanceSku.d.ts +5 -0
  431. package/dist/esm/src/platforms/vtex/utils/enhanceSku.js +14 -0
  432. package/dist/esm/src/platforms/vtex/utils/enhanceSku.js.map +1 -0
  433. package/dist/esm/src/platforms/vtex/utils/facets.d.ts +32 -0
  434. package/dist/esm/src/platforms/vtex/utils/facets.js +54 -0
  435. package/dist/esm/src/platforms/vtex/utils/facets.js.map +1 -0
  436. package/dist/esm/src/platforms/vtex/utils/getAddressOrderForm.d.ts +3 -0
  437. package/dist/esm/src/platforms/vtex/utils/getAddressOrderForm.js +38 -0
  438. package/dist/esm/src/platforms/vtex/utils/getAddressOrderForm.js.map +1 -0
  439. package/dist/esm/src/platforms/vtex/utils/md5.d.ts +1 -0
  440. package/dist/esm/src/platforms/vtex/utils/md5.js +3 -0
  441. package/dist/esm/src/platforms/vtex/utils/md5.js.map +1 -0
  442. package/dist/esm/src/platforms/vtex/utils/orderStatistics.d.ts +4 -0
  443. package/dist/esm/src/platforms/vtex/utils/orderStatistics.js +14 -0
  444. package/dist/esm/src/platforms/vtex/utils/orderStatistics.js.map +1 -0
  445. package/dist/esm/src/platforms/vtex/utils/productStock.d.ts +7 -0
  446. package/dist/esm/src/platforms/vtex/utils/productStock.js +16 -0
  447. package/dist/esm/src/platforms/vtex/utils/productStock.js.map +1 -0
  448. package/dist/esm/src/platforms/vtex/utils/propertyValue.d.ts +12 -0
  449. package/dist/esm/src/platforms/vtex/utils/propertyValue.js +16 -0
  450. package/dist/esm/src/platforms/vtex/utils/propertyValue.js.map +1 -0
  451. package/dist/esm/src/platforms/vtex/utils/sanitizeHtml.d.ts +17 -0
  452. package/dist/esm/src/platforms/vtex/utils/sanitizeHtml.js +18 -0
  453. package/dist/esm/src/platforms/vtex/utils/sanitizeHtml.js.map +1 -0
  454. package/dist/esm/src/platforms/vtex/utils/shouldUpdateShippingData.d.ts +6 -0
  455. package/dist/esm/src/platforms/vtex/utils/shouldUpdateShippingData.js +68 -0
  456. package/dist/esm/src/platforms/vtex/utils/shouldUpdateShippingData.js.map +1 -0
  457. package/dist/esm/src/platforms/vtex/utils/sku.d.ts +8 -0
  458. package/dist/esm/src/platforms/vtex/utils/sku.js +17 -0
  459. package/dist/esm/src/platforms/vtex/utils/sku.js.map +1 -0
  460. package/dist/esm/src/platforms/vtex/utils/skuVariants.d.ts +15 -0
  461. package/dist/esm/src/platforms/vtex/utils/skuVariants.js +132 -0
  462. package/dist/esm/src/platforms/vtex/utils/skuVariants.js.map +1 -0
  463. package/dist/esm/src/platforms/vtex/utils/slugify.d.ts +1 -0
  464. package/dist/esm/src/platforms/vtex/utils/slugify.js +39 -0
  465. package/dist/esm/src/platforms/vtex/utils/slugify.js.map +1 -0
  466. package/dist/esm/src/platforms/vtex/utils/sort.d.ts +10 -0
  467. package/dist/esm/src/platforms/vtex/utils/sort.js +11 -0
  468. package/dist/esm/src/platforms/vtex/utils/sort.js.map +1 -0
  469. package/dist/esm/src/telemetry/index.d.ts +8 -0
  470. package/dist/esm/src/telemetry/index.js +72 -0
  471. package/dist/esm/src/telemetry/index.js.map +1 -0
  472. package/dist/esm/src/telemetry/useFaststoreTelemetry.d.ts +24 -0
  473. package/dist/esm/src/telemetry/useFaststoreTelemetry.js +170 -0
  474. package/dist/esm/src/telemetry/useFaststoreTelemetry.js.map +1 -0
  475. package/dist/esm/src/typeDefs/address.graphql +45 -0
  476. package/dist/esm/src/typeDefs/aggregateOffer.graphql +25 -0
  477. package/dist/esm/src/typeDefs/aggregateRating.graphql +13 -0
  478. package/dist/esm/src/typeDefs/author.graphql +9 -0
  479. package/dist/esm/src/typeDefs/brand.graphql +9 -0
  480. package/dist/esm/src/typeDefs/breadcrumb.graphql +31 -0
  481. package/dist/esm/src/typeDefs/cart.graphql +37 -0
  482. package/dist/esm/src/typeDefs/collection.graphql +83 -0
  483. package/dist/esm/src/typeDefs/facet.graphql +77 -0
  484. package/dist/esm/src/typeDefs/image.graphql +27 -0
  485. package/dist/esm/src/typeDefs/index.d.ts +1 -0
  486. package/dist/esm/src/typeDefs/index.js +7 -0
  487. package/dist/esm/src/typeDefs/index.js.map +1 -0
  488. package/dist/esm/src/typeDefs/mutation.graphql +14 -0
  489. package/dist/esm/src/typeDefs/newsletter.graphql +24 -0
  490. package/dist/esm/src/typeDefs/objectOrString.graphql +1 -0
  491. package/dist/esm/src/typeDefs/offer.graphql +71 -0
  492. package/dist/esm/src/typeDefs/order.graphql +31 -0
  493. package/dist/esm/src/typeDefs/organization.graphql +19 -0
  494. package/dist/esm/src/typeDefs/pageInfo.graphql +25 -0
  495. package/dist/esm/src/typeDefs/person.graphql +43 -0
  496. package/dist/esm/src/typeDefs/product.graphql +91 -0
  497. package/dist/esm/src/typeDefs/productGroup.graphql +27 -0
  498. package/dist/esm/src/typeDefs/propertyValue.graphql +40 -0
  499. package/dist/esm/src/typeDefs/query.graphql +377 -0
  500. package/dist/esm/src/typeDefs/review.graphql +27 -0
  501. package/dist/esm/src/typeDefs/seo.graphql +21 -0
  502. package/dist/esm/src/typeDefs/session.graphql +194 -0
  503. package/dist/esm/src/typeDefs/shipping.graphql +331 -0
  504. package/dist/esm/src/typeDefs/skuVariants.graphql +90 -0
  505. package/dist/esm/src/typeDefs/status.graphql +8 -0
  506. package/dist/esm/src/typings/index.d.ts +3 -0
  507. package/dist/esm/src/typings/index.js +2 -0
  508. package/dist/esm/src/typings/index.js.map +1 -0
  509. package/package.json +34 -17
  510. package/src/index.ts +1 -1
  511. package/src/typeDefs/index.ts +3 -58
  512. package/dist/api.cjs.development.js +0 -2946
  513. package/dist/api.cjs.development.js.map +0 -1
  514. package/dist/api.cjs.production.min.js +0 -2
  515. package/dist/api.cjs.production.min.js.map +0 -1
  516. package/dist/api.esm.js +0 -2932
  517. package/dist/api.esm.js.map +0 -1
  518. package/dist/index.js +0 -8
  519. package/dist/typings/index.d.ts +0 -3
@@ -1,2946 +0,0 @@
1
- 'use strict';
2
-
3
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
-
5
- var schema = require('@graphql-tools/schema');
6
- var fetch = _interopDefault(require('isomorphic-unfetch'));
7
- var DataLoader = _interopDefault(require('dataloader'));
8
- var pLimit = _interopDefault(require('p-limit'));
9
- var sanitizeHtmlLib = _interopDefault(require('sanitize-html'));
10
- var deepEquals = _interopDefault(require('fast-deep-equal'));
11
- var crypto = _interopDefault(require('crypto'));
12
- var graphql = require('graphql');
13
- var language = require('graphql/language');
14
- var utils = require('@graphql-tools/utils');
15
- var sdkTraceBase = require('@opentelemetry/sdk-trace-base');
16
- var resources = require('@opentelemetry/resources');
17
- var exporterTraceOtlpGrpc = require('@opentelemetry/exporter-trace-otlp-grpc');
18
- var sdkLogs = require('@opentelemetry/sdk-logs');
19
- var exporterLogsOtlpGrpc = require('@opentelemetry/exporter-logs-otlp-grpc');
20
- var core = require('@envelop/core');
21
- var onResolve = require('@envelop/on-resolve');
22
- var api = require('@opentelemetry/api');
23
- var apiLogs = require('@opentelemetry/api-logs');
24
-
25
- var name = "@faststore/api";
26
- var version = "2.2.38";
27
- var license = "MIT";
28
- var main = "dist/index.js";
29
- var typings = "dist/index.d.ts";
30
- var module$1 = "dist/api.esm.js";
31
- var repository = "vtex/faststore";
32
- var files = [
33
- "dist",
34
- "src"
35
- ];
36
- var browserslist = "node 12";
37
- var engines = {
38
- node: ">=12"
39
- };
40
- var scripts = {
41
- dev: "concurrently \"yarn generate -w\" \"tsdx watch\"",
42
- "dev:server": "tsdx watch --entry ./local/server.ts --target node --onSuccess \"node ./dist\"",
43
- build: "graphql-codegen --config codegen.yml && tsdx build",
44
- lint: "eslint src/**/*.ts",
45
- test: "tsdx test",
46
- generate: "graphql-codegen --config codegen.yml"
47
- };
48
- var dependencies = {
49
- "@envelop/on-resolve": "^2.0.6",
50
- "@graphql-tools/schema": "^9.0.0",
51
- "@opentelemetry/exporter-logs-otlp-grpc": "^0.39.1",
52
- "@opentelemetry/exporter-trace-otlp-grpc": "^0.39.1",
53
- "@opentelemetry/sdk-logs": "^0.39.1",
54
- "@opentelemetry/sdk-trace-base": "^1.13.0",
55
- "@rollup/plugin-graphql": "^1.0.0",
56
- dataloader: "^2.1.0",
57
- "fast-deep-equal": "^3.1.3",
58
- "isomorphic-unfetch": "^3.1.0",
59
- "p-limit": "^3.1.0",
60
- "sanitize-html": "^2.11.0"
61
- };
62
- var devDependencies = {
63
- "@envelop/core": "^2.6.0",
64
- "@faststore/eslint-config": "^2.2.38",
65
- "@faststore/shared": "^2.2.38",
66
- "@graphql-codegen/cli": "2.2.0",
67
- "@graphql-codegen/typescript": "2.2.2",
68
- "@types/express": "^4.17.16",
69
- "@types/sanitize-html": "^2.9.1",
70
- concurrently: "^6.2.1",
71
- eslint: "7.32.0",
72
- express: "^4.17.3",
73
- "express-graphql": "^0.12.0",
74
- graphql: "^15.6.0",
75
- "jest-transform-graphql": "^2.1.0",
76
- "ts-jest": "25.5.1",
77
- tsdx: "^0.14.1",
78
- tslib: "^2.3.1",
79
- typescript: "^4.4.2"
80
- };
81
- var peerDependencies = {
82
- "@envelop/core": "^1 || ^2",
83
- graphql: "^15.6.0"
84
- };
85
- var packageJson = {
86
- name: name,
87
- version: version,
88
- license: license,
89
- main: main,
90
- typings: typings,
91
- module: module$1,
92
- repository: repository,
93
- files: files,
94
- browserslist: browserslist,
95
- engines: engines,
96
- scripts: scripts,
97
- dependencies: dependencies,
98
- devDependencies: devDependencies,
99
- peerDependencies: peerDependencies
100
- };
101
-
102
- const USER_AGENT = `${packageJson.name}@${packageJson.version}`;
103
- const fetchAPI = async (info, init) => {
104
- const response = await fetch(info, {
105
- ...init,
106
- headers: {
107
- ...(init == null ? void 0 : init.headers),
108
- 'User-Agent': USER_AGENT
109
- }
110
- });
111
- if (response.ok) {
112
- return response.status !== 204 ? response.json() : undefined;
113
- }
114
- console.error(info, init, response);
115
- const text = await response.text();
116
- throw new Error(text);
117
- };
118
-
119
- const BASE_INIT = {
120
- method: 'POST',
121
- headers: {
122
- 'content-type': 'application/json'
123
- }
124
- };
125
- const VtexCommerce = ({
126
- account,
127
- environment,
128
- incrementAddress
129
- }, ctx) => {
130
- const base = `https://${account}.${environment}.com.br`;
131
- return {
132
- catalog: {
133
- salesChannel: sc => fetchAPI(`${base}/api/catalog_system/pub/saleschannel/${sc}`),
134
- brand: {
135
- list: () => fetchAPI(`${base}/api/catalog_system/pub/brand/list`)
136
- },
137
- category: {
138
- tree: (depth = 3) => fetchAPI(`${base}/api/catalog_system/pub/category/tree/${depth}`)
139
- },
140
- portal: {
141
- pagetype: slug => fetchAPI(`${base}/api/catalog_system/pub/portal/pagetype/${slug}`)
142
- },
143
- products: {
144
- crossselling: ({
145
- type,
146
- productId,
147
- groupByProduct = true
148
- }) => {
149
- const params = new URLSearchParams({
150
- sc: ctx.storage.channel.salesChannel,
151
- groupByProduct: groupByProduct.toString()
152
- });
153
- return fetchAPI(`${base}/api/catalog_system/pub/products/crossselling/${type}/${productId}?${params}`);
154
- }
155
- }
156
- },
157
- checkout: {
158
- simulation: (args, {
159
- salesChannel
160
- } = ctx.storage.channel) => {
161
- const params = new URLSearchParams({
162
- sc: salesChannel
163
- });
164
- return fetchAPI(`${base}/api/checkout/pub/orderForms/simulation?${params.toString()}`, {
165
- ...BASE_INIT,
166
- body: JSON.stringify(args)
167
- });
168
- },
169
- shippingData: ({
170
- id,
171
- index,
172
- deliveryMode,
173
- selectedAddresses
174
- }, setDeliveryWindow) => {
175
- var _deliveryMode$deliver, _deliveryMode$deliver2;
176
- const deliveryWindow = setDeliveryWindow ? {
177
- startDateUtc: deliveryMode == null ? void 0 : (_deliveryMode$deliver = deliveryMode.deliveryWindow) == null ? void 0 : _deliveryMode$deliver.startDate,
178
- endDateUtc: deliveryMode == null ? void 0 : (_deliveryMode$deliver2 = deliveryMode.deliveryWindow) == null ? void 0 : _deliveryMode$deliver2.endDate
179
- } : null;
180
- const mappedBody = {
181
- logisticsInfo: Array.from({
182
- length: index
183
- }, (_, itemIndex) => ({
184
- itemIndex,
185
- selectedDeliveryChannel: (deliveryMode == null ? void 0 : deliveryMode.deliveryChannel) || null,
186
- selectedSla: (deliveryMode == null ? void 0 : deliveryMode.deliveryMethod) || null,
187
- deliveryWindow: deliveryWindow
188
- })),
189
- selectedAddresses: selectedAddresses,
190
- clearAddressIfPostalCodeNotFound: incrementAddress
191
- };
192
- return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/attachments/shippingData`, {
193
- ...BASE_INIT,
194
- body: JSON.stringify(mappedBody),
195
- headers: {
196
- 'content-type': 'application/json',
197
- cookie: ctx.headers.cookie
198
- }
199
- });
200
- },
201
- orderForm: ({
202
- id,
203
- refreshOutdatedData = true,
204
- channel = ctx.storage.channel
205
- }) => {
206
- const {
207
- salesChannel
208
- } = channel;
209
- const params = new URLSearchParams({
210
- refreshOutdatedData: refreshOutdatedData.toString(),
211
- sc: salesChannel
212
- });
213
- const requestInit = ctx.headers ? {
214
- ...BASE_INIT,
215
- headers: {
216
- 'content-type': 'application/json',
217
- cookie: ctx.headers.cookie
218
- }
219
- } : BASE_INIT;
220
- return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}?${params.toString()}`, requestInit);
221
- },
222
- clearOrderFormMessages: ({
223
- id
224
- }) => {
225
- return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/messages/clear`, {
226
- ...BASE_INIT,
227
- body: '{}'
228
- });
229
- },
230
- updateOrderFormItems: ({
231
- id,
232
- orderItems,
233
- allowOutdatedData = 'paymentData',
234
- salesChannel = ctx.storage.channel.salesChannel,
235
- shouldSplitItem = true
236
- }) => {
237
- const params = new URLSearchParams({
238
- allowOutdatedData,
239
- sc: salesChannel
240
- });
241
- const items = JSON.stringify({
242
- orderItems,
243
- noSplitItem: !shouldSplitItem
244
- });
245
- const requestInit = ctx.headers ? {
246
- headers: {
247
- 'content-type': 'application/json',
248
- cookie: ctx.headers.cookie
249
- },
250
- body: items,
251
- method: 'PATCH'
252
- } : {
253
- headers: {
254
- 'content-type': 'application/json'
255
- },
256
- body: items,
257
- method: 'PATCH'
258
- };
259
- return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/items?${params}`, requestInit);
260
- },
261
- setCustomData: ({
262
- id,
263
- appId,
264
- key,
265
- value
266
- }) => {
267
- return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/customData/${appId}/${key}`, {
268
- ...BASE_INIT,
269
- body: JSON.stringify({
270
- value
271
- }),
272
- method: 'PUT'
273
- });
274
- },
275
- region: async ({
276
- postalCode,
277
- geoCoordinates,
278
- country,
279
- salesChannel
280
- }) => {
281
- const params = new URLSearchParams({
282
- country: country,
283
- sc: salesChannel != null ? salesChannel : ''
284
- });
285
- postalCode ? params.append('postalCode', postalCode) : params.append('geoCoordinates', `${geoCoordinates == null ? void 0 : geoCoordinates.longitude};${geoCoordinates == null ? void 0 : geoCoordinates.latitude}`);
286
- const url = `${base}/api/checkout/pub/regions/?${params.toString()}`;
287
- return fetchAPI(url);
288
- },
289
- address: async ({
290
- postalCode,
291
- country
292
- }) => {
293
- return fetchAPI(`${base}/api/checkout/pub/postal-code/${country}/${postalCode}`);
294
- }
295
- },
296
- session: search => {
297
- const params = new URLSearchParams(search);
298
- params.set('items', 'profile.id,profile.email,profile.firstName,profile.lastName,store.channel,store.countryCode,store.cultureInfo,store.currencyCode,store.currencySymbol');
299
- return fetchAPI(`${base}/api/sessions?${params.toString()}`, {
300
- method: 'POST',
301
- headers: {
302
- 'content-type': 'application/json',
303
- cookie: ctx.headers.cookie
304
- },
305
- body: '{}'
306
- });
307
- },
308
- subscribeToNewsletter: data => {
309
- return fetchAPI(`${base}/api/dataentities/NL/documents/`, {
310
- ...BASE_INIT,
311
- body: JSON.stringify({
312
- ...data,
313
- isNewsletterOptIn: true
314
- }),
315
- method: 'PATCH'
316
- });
317
- }
318
- };
319
- };
320
-
321
- const POLICY_KEY = 'trade-policy';
322
- const REGION_KEY = 'region-id';
323
- const CHANNEL_KEYS = /*#__PURE__*/new Set([POLICY_KEY, REGION_KEY]);
324
- const IntelligentSearch = ({
325
- account,
326
- environment,
327
- hideUnavailableItems
328
- }, ctx) => {
329
- const base = `https://${account}.${environment}.com.br/api/io`;
330
- const getPolicyFacet = () => {
331
- const {
332
- salesChannel
333
- } = ctx.storage.channel;
334
- if (!salesChannel) {
335
- return null;
336
- }
337
- return {
338
- key: POLICY_KEY,
339
- value: salesChannel
340
- };
341
- };
342
- const getRegionFacet = () => {
343
- const {
344
- regionId,
345
- seller
346
- } = ctx.storage.channel;
347
- const sellerRegionId = seller ? Buffer.from(`SW#${seller}`).toString('base64') : null;
348
- const facet = sellerRegionId != null ? sellerRegionId : regionId;
349
- if (!facet) {
350
- return null;
351
- }
352
- return {
353
- key: REGION_KEY,
354
- value: facet
355
- };
356
- };
357
- const addDefaultFacets = facets => {
358
- var _facets$find, _facets$find2;
359
- const withDefaultFacets = facets.filter(({
360
- key
361
- }) => !CHANNEL_KEYS.has(key));
362
- const policyFacet = (_facets$find = facets.find(({
363
- key
364
- }) => key === POLICY_KEY)) != null ? _facets$find : getPolicyFacet();
365
- const regionFacet = (_facets$find2 = facets.find(({
366
- key
367
- }) => key === REGION_KEY)) != null ? _facets$find2 : getRegionFacet();
368
- if (policyFacet !== null) {
369
- withDefaultFacets.push(policyFacet);
370
- }
371
- if (regionFacet !== null) {
372
- withDefaultFacets.push(regionFacet);
373
- }
374
- return withDefaultFacets;
375
- };
376
- const search = ({
377
- query = '',
378
- page,
379
- count,
380
- sort = '',
381
- selectedFacets = [],
382
- type,
383
- fuzzy = 'auto'
384
- }) => {
385
- const params = new URLSearchParams({
386
- page: (page + 1).toString(),
387
- count: count.toString(),
388
- query,
389
- sort,
390
- fuzzy,
391
- locale: ctx.storage.locale
392
- });
393
- if (hideUnavailableItems !== undefined) {
394
- params.append('hideUnavailableItems', hideUnavailableItems.toString());
395
- }
396
- const pathname = addDefaultFacets(selectedFacets).map(({
397
- key,
398
- value
399
- }) => `${key}/${value}`).join('/');
400
- return fetchAPI(`${base}/_v/api/intelligent-search/${type}/${pathname}?${params.toString()}`);
401
- };
402
- const products = args => search({
403
- ...args,
404
- type: 'product_search'
405
- });
406
- const suggestedTerms = args => {
407
- var _args$query$toString, _args$query;
408
- const params = new URLSearchParams({
409
- query: (_args$query$toString = (_args$query = args.query) == null ? void 0 : _args$query.toString()) != null ? _args$query$toString : '',
410
- locale: ctx.storage.locale
411
- });
412
- return fetchAPI(`${base}/_v/api/intelligent-search/search_suggestions?${params.toString()}`);
413
- };
414
- const topSearches = () => {
415
- const params = new URLSearchParams({
416
- locale: ctx.storage.locale
417
- });
418
- return fetchAPI(`${base}/_v/api/intelligent-search/top_searches?${params.toString()}`);
419
- };
420
- const facets = args => search({
421
- ...args,
422
- type: 'facets'
423
- });
424
- return {
425
- facets,
426
- products,
427
- suggestedTerms,
428
- topSearches
429
- };
430
- };
431
-
432
- /**
433
- * Client for SP, Intelligent search's analytics event API
434
- * More info at: https://www.notion.so/vtexhandbook/Event-API-Documentation-48eee26730cf4d7f80f8fd7262231f84
435
- */
436
- const THIRTY_MINUTES_S = 30 * 60;
437
- const ONE_YEAR_S = 365 * 24 * 3600;
438
- const randomUUID = () => (Math.random() * 1e6).toFixed(0);
439
- const timelapsed = past => (Date.now() - past) / 1e3;
440
- const createId = expiresSecond => {
441
- let payload = randomUUID();
442
- let createdAt = Date.now();
443
- return () => {
444
- if (timelapsed(createdAt) > expiresSecond) {
445
- payload = randomUUID();
446
- createdAt = Date.now();
447
- }
448
- return payload;
449
- };
450
- };
451
- const user = {
452
- anonymous: /*#__PURE__*/createId(ONE_YEAR_S),
453
- session: /*#__PURE__*/createId(THIRTY_MINUTES_S)
454
- };
455
- const SP = ({
456
- account
457
- }, _) => {
458
- const base = `https://sp.vtex.com/event-api/v1/${account}/event`;
459
- const sendEvent = options => {
460
- return fetchAPI(base, {
461
- method: 'POST',
462
- body: JSON.stringify({
463
- ...options,
464
- agent: '@faststore/api',
465
- anonymous: user.anonymous(),
466
- session: user.session()
467
- }),
468
- headers: {
469
- 'content-type': 'application/json'
470
- }
471
- });
472
- };
473
- return {
474
- sendEvent
475
- };
476
- };
477
-
478
- const getClients = (options, ctx) => {
479
- const search = IntelligentSearch(options, ctx);
480
- const commerce = VtexCommerce(options, ctx);
481
- const sp = SP(options);
482
- return {
483
- search,
484
- commerce,
485
- sp
486
- };
487
- };
488
-
489
- const getSalesChannelLoader = (_, clients) => {
490
- const loader = async channels => Promise.all(channels.map(sc => clients.commerce.catalog.salesChannel(sc)));
491
- return new DataLoader(loader);
492
- };
493
-
494
- // Limits concurrent requests to the API per request cycle
495
- const CONCURRENT_REQUESTS_MAX = 1;
496
- const getSimulationLoader = (_, clients) => {
497
- const limit = pLimit(CONCURRENT_REQUESTS_MAX);
498
- const loader = async simulationArgs => {
499
- const allItems = simulationArgs.reduce((acc, {
500
- items
501
- }) => {
502
- return [...acc, items];
503
- }, []);
504
- const items = [...allItems.flat()];
505
- const simulation = await clients.commerce.checkout.simulation({
506
- country: simulationArgs[0].country,
507
- postalCode: simulationArgs[0].postalCode,
508
- items
509
- });
510
- // Sort and filter simulation since Checkout API may return
511
- // items that we didn't ask for
512
- const simulated = simulation.items.reduce((acc, item) => {
513
- const index = item.requestIndex;
514
- if (typeof index === 'number' && index < acc.length) {
515
- acc[index] = item;
516
- }
517
- return acc;
518
- }, Array(items.length).fill(null));
519
- const itemsIndices = allItems.reduce((acc, curr) => [...acc, curr.length + acc[acc.length - 1]], [0]);
520
- return allItems.map((__, index) => ({
521
- ...simulation,
522
- items: simulated.slice(itemsIndices[index], itemsIndices[index + 1]).filter(item => Boolean(item))
523
- }));
524
- };
525
- const limited = async allItems => limit(loader, allItems);
526
- return new DataLoader(limited, {
527
- maxBatchSize: 50
528
- });
529
- };
530
-
531
- /**
532
- * For now, we're using sanitize-html's default set
533
- * of allowed tags and attributes, which don't even include img elements
534
- *
535
- * It is known many client depends on pontentially vulnerable tags, such as script tags
536
- * We chose to be restrictive at first, and document those restrictions later.
537
- *
538
- * When expanding the set of allowed tags and attributes, please consider performance, privacy and security.
539
- *
540
- * This possibily breaks compatibility with Portal and Store Framework,
541
- * which both allows an enormous amount of tags and attributes
542
- *
543
- * This was a thoughtful decision that can be reviewed in the future given
544
- * research was made to back up those changes.
545
- */
546
- const sanitizeHtml = (dirty, options) => sanitizeHtmlLib(dirty, options);
547
-
548
- function sanitizeProduct(product) {
549
- return {
550
- ...product,
551
- description: product.description ? sanitizeHtml(product.description) : product.description
552
- };
553
- }
554
- const enhanceSku = (item, product) => ({
555
- ...item,
556
- isVariantOf: sanitizeProduct(product)
557
- });
558
-
559
- class FastStoreError extends Error {
560
- constructor(extensions, message) {
561
- super(message);
562
- this.extensions = extensions;
563
- this.name = 'FastStoreError';
564
- }
565
- }
566
- class BadRequestError extends FastStoreError {
567
- constructor(message) {
568
- super({
569
- status: 400,
570
- type: 'BadRequestError'
571
- }, message);
572
- }
573
- }
574
- class NotFoundError extends FastStoreError {
575
- constructor(message) {
576
- super({
577
- status: 404,
578
- type: 'NotFoundError'
579
- }, message);
580
- }
581
- }
582
- const isFastStoreError = error => (error == null ? void 0 : error.name) === 'FastStoreError';
583
- const isNotFoundError = error => {
584
- var _error$extensions;
585
- return (error == null ? void 0 : (_error$extensions = error.extensions) == null ? void 0 : _error$extensions.type) === 'NotFoundError';
586
- };
587
- const isBadRequestError = error => {
588
- var _error$extensions2;
589
- return (error == null ? void 0 : (_error$extensions2 = error.extensions) == null ? void 0 : _error$extensions2.type) === 'BadRequestError';
590
- };
591
-
592
- const getSkuLoader = (_, clients) => {
593
- const loader = async skuIds => {
594
- const {
595
- products
596
- } = await clients.search.products({
597
- query: `sku:${skuIds.join(';')}`,
598
- page: 0,
599
- count: skuIds.length
600
- });
601
- const skuBySkuId = products.reduce((acc, product) => {
602
- for (const sku of product.items) {
603
- acc[sku.itemId] = enhanceSku(sku, product);
604
- }
605
- return acc;
606
- }, {});
607
- const skus = skuIds.map(skuId => skuBySkuId[skuId]);
608
- const missingSkus = skuIds.filter(skuId => !skuBySkuId[skuId]);
609
- if (missingSkus.length > 0) {
610
- throw new NotFoundError(`Search API did not found the following skus: ${missingSkus.join(',')}`);
611
- }
612
- return skus;
613
- };
614
- return new DataLoader(loader, {
615
- maxBatchSize: 99
616
- });
617
- };
618
-
619
- // Limits concurrent requests to 20 so that they don't timeout
620
- const CONCURRENT_REQUESTS_MAX$1 = 20;
621
- const collectionPageTypes = /*#__PURE__*/new Set(['brand', 'category', 'department', 'subcategory', 'collection', 'cluster']);
622
- const isCollectionPageType = x => typeof x.pageType === 'string' && collectionPageTypes.has(x.pageType.toLowerCase());
623
- const getCollectionLoader = (_, clients) => {
624
- const limit = pLimit(CONCURRENT_REQUESTS_MAX$1);
625
- const loader = async slugs => {
626
- return Promise.all(slugs.map(slug => limit(async () => {
627
- const page = await clients.commerce.catalog.portal.pagetype(slug);
628
- if (isCollectionPageType(page)) {
629
- return page;
630
- }
631
- throw new NotFoundError(`Catalog returned ${page.pageType} for slug: ${slug}. This usually happens when there is more than one category with the same name in the same category tree level.`);
632
- })));
633
- };
634
- return new DataLoader(loader, {
635
- // DataLoader is being used to cache requests, not to batch them
636
- batch: false
637
- });
638
- };
639
-
640
- const getLoaders = (options, {
641
- clients
642
- }) => {
643
- const skuLoader = getSkuLoader(options, clients);
644
- const simulationLoader = getSimulationLoader(options, clients);
645
- const collectionLoader = getCollectionLoader(options, clients);
646
- const salesChannelLoader = getSalesChannelLoader(options, clients);
647
- return {
648
- skuLoader,
649
- simulationLoader,
650
- collectionLoader,
651
- salesChannelLoader
652
- };
653
- };
654
-
655
- const inStock = offer => offer.AvailableQuantity > 0;
656
- const price = offer => {
657
- var _offer$spotPrice;
658
- return (_offer$spotPrice = offer.spotPrice) != null ? _offer$spotPrice : 0;
659
- };
660
- const sellingPrice = offer => {
661
- var _offer$Price;
662
- return (_offer$Price = offer.Price) != null ? _offer$Price : 0;
663
- };
664
- const availability = available => available ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock';
665
- // Smallest Available Spot Price First
666
- const bestOfferFirst = (a, b) => {
667
- if (inStock(a) && !inStock(b)) {
668
- return -1;
669
- }
670
- if (!inStock(a) && inStock(b)) {
671
- return 1;
672
- }
673
- return price(a) - price(b);
674
- };
675
- const inStockOrderFormItem = itemAvailability => itemAvailability === 'available';
676
-
677
- const StoreAggregateOffer = {
678
- highPrice: offers => {
679
- const availableOffers = offers.filter(inStock);
680
- const highOffer = availableOffers[availableOffers.length - 1];
681
- return highOffer != null ? price(highOffer) : 0;
682
- },
683
- lowPrice: offers => {
684
- const [lowOffer] = offers.filter(inStock);
685
- return lowOffer ? price(lowOffer) : 0;
686
- },
687
- offerCount: offers => offers.length,
688
- priceCurrency: async (_, __, ctx) => {
689
- var _sc$CurrencyCode;
690
- const {
691
- loaders: {
692
- salesChannelLoader
693
- },
694
- storage: {
695
- channel
696
- }
697
- } = ctx;
698
- const sc = await salesChannelLoader.load(channel.salesChannel);
699
- return (_sc$CurrencyCode = sc.CurrencyCode) != null ? _sc$CurrencyCode : '';
700
- },
701
- offers: offers => offers
702
- };
703
-
704
- // TODO: Add a review system integration
705
- const StoreAggregateRating = {
706
- ratingValue: () => 5,
707
- reviewCount: () => 0
708
- };
709
-
710
- /**
711
- * VTEX catalog slugify function
712
- *
713
- * Copied from:
714
- * https://github.com/vtex/rewriter/blob/1ce2010783e0586cab42534ce2fb7a983d8a3a84/node/clients/catalog.ts#L72
715
- *
716
- * Sometimes, we need to slugify strings for creating urls. An example is the
717
- * brand urls, where we create them from the brand's name.
718
- * This slugify function should match exactly what VTEX catalog generates. Any mismatch
719
- * will lead to broken links.
720
- * Hopefully, we had this function implemented on VTEX IO and we've been using it for
721
- * years now. However, looking at the code, I think we can save lots of computing. I'm
722
- * in a hurry for doing these tests now, so I'll leave a small TODO.
723
- *
724
- * TODO: Research for better ways of computing this slugify function. Things I'd try are:
725
- * - Join those 3 regexs for special characters into a single one.
726
- * - Replace the regexp of `removeDiacritics` function with a Map. We can make the complexity
727
- * of this function be O(n) with n=string.length
728
- *
729
- */
730
- const from = 'ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a';
731
- const to = 'AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa';
732
- const removeDiacritics = str => {
733
- let newStr = str.slice(0);
734
- for (let i = 0; i < from.length; i++) {
735
- newStr = newStr.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
736
- }
737
- return newStr;
738
- };
739
- const slugifySpecialCharacters = str => {
740
- return str.replace(/[·/_,:]/, '-');
741
- };
742
- function slugify(str) {
743
- const noCommas = str.replace(/,/g, '');
744
- const replaced = noCommas.replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, '-');
745
- const slugified = slugifySpecialCharacters(removeDiacritics(replaced));
746
- return slugified.toLowerCase();
747
- }
748
-
749
- const isBrand = x => x.type === 'brand' || isCollectionPageType(x) && x.pageType.toLowerCase() === 'brand';
750
- const isCollection = x => isCollectionPageType(x) && x.pageType.toLowerCase() === 'collection';
751
- const slugifyRoot = root => {
752
- if (isBrand(root) || isCollection(root)) {
753
- return slugify(root.name);
754
- }
755
- if (isCollectionPageType(root)) {
756
- return new URL(`https://${root.url}`).pathname.slice(1).toLowerCase();
757
- }
758
- return new URL(root.url).pathname.slice(1).toLowerCase();
759
- };
760
- const StoreCollection = {
761
- id: ({
762
- id
763
- }) => id.toString(),
764
- slug: root => slugifyRoot(root),
765
- seo: root => isBrand(root) || isCollectionPageType(root) ? {
766
- title: root.title,
767
- description: root.metaTagDescription
768
- } : {
769
- title: root.Title,
770
- description: root.MetaTagDescription
771
- },
772
- type: root => isBrand(root) ? 'Brand' : isCollectionPageType(root) ? root.pageType : root.level === 0 ? 'Department' : 'Category',
773
- meta: root => {
774
- const slug = slugifyRoot(root);
775
- return isBrand(root) ? {
776
- selectedFacets: [{
777
- key: 'brand',
778
- value: slug
779
- }]
780
- } : isCollection(root) ? {
781
- selectedFacets: [{
782
- key: 'productclusterids',
783
- value: root.id
784
- }]
785
- } : {
786
- selectedFacets: slug.split('/').map((segment, index) => ({
787
- key: `category-${index + 1}`,
788
- value: segment
789
- }))
790
- };
791
- },
792
- breadcrumbList: async (root, _, ctx) => {
793
- const {
794
- loaders: {
795
- collectionLoader
796
- }
797
- } = ctx;
798
- const slug = slugifyRoot(root);
799
- /**
800
- * Split slug into segments so we fetch all data for
801
- * the breadcrumb. For instance, if we get `/foo/bar`
802
- * we need all metadata for both `/foo` and `/bar` and
803
- * thus we need to fetch pageType for `/foo` and `/bar`
804
- */
805
- const segments = slug.split('/').filter(segment => Boolean(segment));
806
- const slugs = segments.map((__, index) => segments.slice(0, index + 1).join('/'));
807
- const collections = await Promise.all(slugs.map(async s => {
808
- const collection = await collectionLoader.load(s);
809
- return {
810
- slug: s,
811
- ...collection
812
- };
813
- }));
814
- return {
815
- itemListElement: collections.map((collection, index) => ({
816
- item: isCollection(collection) ? `/${collection.slug}` : new URL(`https://${collection.url}`).pathname.toLowerCase(),
817
- name: collection.name,
818
- position: index + 1
819
- })),
820
- numberOfItems: collections.length
821
- };
822
- }
823
- };
824
-
825
- const FACET_CROSS_SELLING_MAP = {
826
- buy: "whoboughtalsobought",
827
- view: "whosawalsosaw",
828
- similars: "similars",
829
- viewAndBought: "whosawalsobought",
830
- accessories: "accessories",
831
- suggestions: "suggestions"
832
- };
833
- /**
834
- * Transform facets from the store to VTEX platform facets.
835
- * For instance, the channel in Store becomes trade-policy and regionId in VTEX's realm
836
- * */
837
- const transformSelectedFacet = ({
838
- key,
839
- value
840
- }) => {
841
- switch (key) {
842
- case 'price':
843
- {
844
- return {
845
- key,
846
- value: value.replace('-to-', ':')
847
- };
848
- }
849
- case 'channel':
850
- case 'locale':
851
- case "buy":
852
- case "view":
853
- case "similars":
854
- case "viewAndBought":
855
- case "accessories":
856
- case "suggestions":
857
- {
858
- return []; // remove this facet from search
859
- }
860
-
861
- default:
862
- return {
863
- key,
864
- value
865
- };
866
- }
867
- };
868
- const parseRange = range => {
869
- const splitted = range.split(':').map(Number);
870
- if (splitted.length !== 2 || Number.isNaN(splitted[0]) || Number.isNaN(splitted[1])) {
871
- return null;
872
- }
873
- return splitted;
874
- };
875
- const isCrossSelling = x => typeof FACET_CROSS_SELLING_MAP[x] === "string";
876
- const findCrossSelling = facets => {
877
- var _filtered$;
878
- const filtered = facets == null ? void 0 : facets.filter(x => isCrossSelling(x.key));
879
- if (Array.isArray(filtered) && filtered.length > 1) {
880
- throw new BadRequestError(`You passed ${filtered.length} cross selling facets but only one is allowed. Please leave one of the following facet: ${filtered.map(x => x.key).join(',')}`);
881
- }
882
- return (_filtered$ = filtered == null ? void 0 : filtered[0]) != null ? _filtered$ : null;
883
- };
884
- const findSlug = facets => {
885
- var _facets$find$value, _facets$find;
886
- return (_facets$find$value = facets == null ? void 0 : (_facets$find = facets.find(x => x.key === 'slug')) == null ? void 0 : _facets$find.value) != null ? _facets$find$value : null;
887
- };
888
- const findSkuId = facets => {
889
- var _facets$find$value2, _facets$find2;
890
- return (_facets$find$value2 = facets == null ? void 0 : (_facets$find2 = facets.find(x => x.key === 'id')) == null ? void 0 : _facets$find2.value) != null ? _facets$find$value2 : null;
891
- };
892
- const findLocale = facets => {
893
- var _facets$find$value3, _facets$find3;
894
- return (_facets$find$value3 = facets == null ? void 0 : (_facets$find3 = facets.find(x => x.key === 'locale')) == null ? void 0 : _facets$find3.value) != null ? _facets$find$value3 : null;
895
- };
896
- const findChannel = facets => {
897
- var _facets$find$value4, _facets$find4;
898
- return (_facets$find$value4 = facets == null ? void 0 : (_facets$find4 = facets.find(facet => facet.key === 'channel')) == null ? void 0 : _facets$find4.value) != null ? _facets$find$value4 : null;
899
- };
900
-
901
- /**
902
- * More info at: https://en.wikipedia.org/wiki/Order_statistic
903
- */
904
- // O(n) search to find the max of an array
905
- const min = (array, cmp) => {
906
- let best = 0;
907
- for (let curr = 1; curr < array.length; curr++) {
908
- if (cmp(array[best], array[curr]) > 0) {
909
- best = curr;
910
- }
911
- }
912
- return array[best];
913
- };
914
-
915
- const StoreFacet = {
916
- __resolveType: ({
917
- type
918
- }) => type === 'TEXT' ? 'StoreFacetBoolean' : 'StoreFacetRange'
919
- };
920
- const StoreFacetBoolean = {
921
- key: ({
922
- key
923
- }) => key,
924
- label: ({
925
- name
926
- }) => name,
927
- values: ({
928
- values
929
- }) => values.sort((a, b) => a.name.localeCompare(b.name))
930
- };
931
- const StoreFacetRange = {
932
- key: ({
933
- key
934
- }) => key,
935
- label: ({
936
- name
937
- }) => name,
938
- min: ({
939
- values,
940
- key
941
- }, _, {
942
- storage: {
943
- searchArgs
944
- }
945
- }) => {
946
- var _searchArgs$selectedF, _searchArgs$selectedF2, _searchArgs$selectedF3, _facet$range$from, _selectedRange$;
947
- /**
948
- * Fetch the selected range the user queried.
949
- *
950
- * This is necessary because, differently from boolean facets, Search API does
951
- * not return the selected values, making us have to implement it in here
952
- */
953
- const selectedRange = parseRange((_searchArgs$selectedF = searchArgs == null ? void 0 : (_searchArgs$selectedF2 = searchArgs.selectedFacets) == null ? void 0 : (_searchArgs$selectedF3 = _searchArgs$selectedF2.find(facet => facet.key === key)) == null ? void 0 : _searchArgs$selectedF3.value) != null ? _searchArgs$selectedF : '');
954
- const facet = min(values, (a, b) => a.range.from - b.range.from);
955
- const globalMin = (_facet$range$from = facet == null ? void 0 : facet.range.from) != null ? _facet$range$from : 0;
956
- return {
957
- selected: (_selectedRange$ = selectedRange == null ? void 0 : selectedRange[0]) != null ? _selectedRange$ : globalMin,
958
- absolute: globalMin
959
- };
960
- },
961
- max: ({
962
- values,
963
- key
964
- }, _, {
965
- storage: {
966
- searchArgs
967
- }
968
- }) => {
969
- var _searchArgs$selectedF4, _searchArgs$selectedF5, _searchArgs$selectedF6, _facet$range$to, _selectedRange$2;
970
- /**
971
- * Fetch the selected range the user queried.
972
- *
973
- * This is necessary because, differently from boolean facets, Search API does
974
- * not return the selected values, making us have to implement it in here
975
- */
976
- const selectedRange = parseRange((_searchArgs$selectedF4 = searchArgs == null ? void 0 : (_searchArgs$selectedF5 = searchArgs.selectedFacets) == null ? void 0 : (_searchArgs$selectedF6 = _searchArgs$selectedF5.find(facet => facet.key === key)) == null ? void 0 : _searchArgs$selectedF6.value) != null ? _searchArgs$selectedF4 : '');
977
- const facet = min(values, (a, b) => b.range.to - a.range.to);
978
- const globalMax = (_facet$range$to = facet == null ? void 0 : facet.range.to) != null ? _facet$range$to : 0;
979
- return {
980
- selected: (_selectedRange$2 = selectedRange == null ? void 0 : selectedRange[1]) != null ? _selectedRange$2 : globalMax,
981
- absolute: globalMax
982
- };
983
- }
984
- };
985
-
986
- const StoreFacetValueBoolean = {
987
- value: ({
988
- value
989
- }) => value,
990
- label: ({
991
- name
992
- }) => name || 'unknown',
993
- selected: ({
994
- selected
995
- }) => selected,
996
- quantity: ({
997
- quantity
998
- }) => quantity
999
- };
1000
-
1001
- const subscribeToNewsletter = async (_, {
1002
- data
1003
- }, {
1004
- clients: {
1005
- commerce
1006
- }
1007
- }) => {
1008
- const response = await commerce.subscribeToNewsletter(data);
1009
- return {
1010
- id: response == null ? void 0 : response.Id
1011
- };
1012
- };
1013
-
1014
- class ChannelMarshal {
1015
- static parse(channelString) {
1016
- try {
1017
- var _parsedChannel$seller, _parsedChannel$region, _parsedChannel$salesC;
1018
- const parsedChannel = JSON.parse(channelString);
1019
- return {
1020
- seller: (_parsedChannel$seller = parsedChannel.seller) != null ? _parsedChannel$seller : '',
1021
- regionId: (_parsedChannel$region = parsedChannel.regionId) != null ? _parsedChannel$region : '',
1022
- salesChannel: (_parsedChannel$salesC = parsedChannel.salesChannel) != null ? _parsedChannel$salesC : ''
1023
- };
1024
- } catch (error) {
1025
- console.error(error);
1026
- throw new Error('Malformed channel string');
1027
- }
1028
- }
1029
- static stringify(channel) {
1030
- return JSON.stringify(channel);
1031
- }
1032
- }
1033
-
1034
- const mutateChannelContext = (ctx, channelString) => {
1035
- ctx.storage.channel = ChannelMarshal.parse(channelString);
1036
- };
1037
- const mutateLocaleContext = (ctx, locale) => {
1038
- ctx.storage.locale = locale;
1039
- };
1040
-
1041
- const md5 = payload => crypto.createHash('md5').update(payload).digest('hex');
1042
-
1043
- const VALUE_REFERENCES = {
1044
- attachment: 'ATTACHMENT',
1045
- specification: 'SPECIFICATION'
1046
- };
1047
- function attachmentToPropertyValue(attachment) {
1048
- return {
1049
- name: attachment.name,
1050
- value: attachment.content,
1051
- valueReference: VALUE_REFERENCES.attachment
1052
- };
1053
- }
1054
- function getPropertyId(item) {
1055
- return md5(`${item.name}:${JSON.stringify(item.value)}:${item.valueReference}`);
1056
- }
1057
-
1058
- const shouldUpdateShippingData = (orderForm, session) => {
1059
- var _orderForm$shippingDa, _orderForm$shippingDa2;
1060
- if (!hasSessionPostalCodeOrGeoCoordinates(session)) {
1061
- return {
1062
- updateShipping: false,
1063
- addressChanged: false
1064
- };
1065
- }
1066
- if (!hasItems(orderForm)) {
1067
- return {
1068
- updateShipping: false,
1069
- addressChanged: false
1070
- };
1071
- }
1072
- const [selectedAddress] = (_orderForm$shippingDa = orderForm == null ? void 0 : (_orderForm$shippingDa2 = orderForm.shippingData) == null ? void 0 : _orderForm$shippingDa2.selectedAddresses) != null ? _orderForm$shippingDa : [];
1073
- if (checkPostalCode(selectedAddress, session.postalCode) || checkGeoCoordinates(selectedAddress, session.geoCoordinates) || checkAddressType(selectedAddress, session.addressType)) {
1074
- return {
1075
- updateShipping: true,
1076
- addressChanged: true
1077
- };
1078
- }
1079
- // The logisticsInfo will always exist if there´s at least one item inside the cart
1080
- const {
1081
- logisticsInfo
1082
- } = orderForm.shippingData;
1083
- if (shouldUpdateDeliveryInfo(logisticsInfo, session)) {
1084
- return {
1085
- updateShipping: true,
1086
- addressChanged: false
1087
- };
1088
- }
1089
- return {
1090
- updateShipping: false,
1091
- addressChanged: false
1092
- };
1093
- };
1094
- // Validate if theres any postal Code or GeoCoordinates set at the session
1095
- const hasSessionPostalCodeOrGeoCoordinates = session => {
1096
- var _session$geoCoordinat, _session$geoCoordinat2;
1097
- return !!session.postalCode || ((_session$geoCoordinat = session.geoCoordinates) == null ? void 0 : _session$geoCoordinat.latitude) && ((_session$geoCoordinat2 = session.geoCoordinates) == null ? void 0 : _session$geoCoordinat2.longitude);
1098
- };
1099
- // Validate if theres a difference between the session postal code and orderForm postal code
1100
- const checkPostalCode = (address, postalCode) => {
1101
- return typeof postalCode === 'string' && (address == null ? void 0 : address.postalCode) !== postalCode;
1102
- };
1103
- // Validate if theres a difference between the session geoCoords and orderForm geoCoords
1104
- const checkGeoCoordinates = (address, geoCoordinates) => {
1105
- return typeof (geoCoordinates == null ? void 0 : geoCoordinates.latitude) === 'number' && typeof (geoCoordinates == null ? void 0 : geoCoordinates.longitude) === 'number' && ((address == null ? void 0 : address.geoCoordinates[0]) !== (geoCoordinates == null ? void 0 : geoCoordinates.longitude) || (address == null ? void 0 : address.geoCoordinates[1]) !== (geoCoordinates == null ? void 0 : geoCoordinates.latitude));
1106
- };
1107
- const checkAddressType = (address, addressType) => {
1108
- return typeof addressType === 'string' && (address == null ? void 0 : address.addressType) !== addressType;
1109
- };
1110
- // Validate if theres any item inside the orderForm
1111
- const hasItems = orderForm => {
1112
- return orderForm.items.length !== 0;
1113
- };
1114
- const shouldUpdateDeliveryInfo = (logisticsInfo, session) => {
1115
- var _session$deliveryMode, _session$deliveryMode2, _session$deliveryMode3;
1116
- const deliveryChannel = session == null ? void 0 : (_session$deliveryMode = session.deliveryMode) == null ? void 0 : _session$deliveryMode.deliveryChannel;
1117
- const deliveryMethod = session == null ? void 0 : (_session$deliveryMode2 = session.deliveryMode) == null ? void 0 : _session$deliveryMode2.deliveryMethod;
1118
- const {
1119
- startDate,
1120
- endDate
1121
- } = (session == null ? void 0 : (_session$deliveryMode3 = session.deliveryMode) == null ? void 0 : _session$deliveryMode3.deliveryWindow) || {};
1122
- return logisticsInfo.some(({
1123
- selectedDeliveryChannel,
1124
- selectedSla,
1125
- slas
1126
- }) => {
1127
- const checkDeliveryChannel = deliveryChannel && selectedDeliveryChannel !== deliveryChannel;
1128
- const checkDeliveryMethod = deliveryMethod && selectedSla !== deliveryMethod;
1129
- return slas == null ? void 0 : slas.some(sla => {
1130
- var _sla$deliveryWindow, _sla$deliveryWindow2, _sla$availableDeliver;
1131
- if (checkDeliveryChannel && sla.deliveryChannel === deliveryChannel || checkDeliveryMethod && sla.id === deliveryMethod) {
1132
- return true;
1133
- }
1134
- return startDate && endDate && sla.deliveryChannel === deliveryChannel && sla.id === deliveryMethod && (!(sla != null && sla.deliveryWindow) || (sla == null ? void 0 : (_sla$deliveryWindow = sla.deliveryWindow) == null ? void 0 : _sla$deliveryWindow.startDateUtc) !== startDate || (sla == null ? void 0 : (_sla$deliveryWindow2 = sla.deliveryWindow) == null ? void 0 : _sla$deliveryWindow2.endDateUtc) !== endDate) && ((_sla$availableDeliver = sla.availableDeliveryWindows) == null ? void 0 : _sla$availableDeliver.some(window => (window == null ? void 0 : window.startDateUtc) === startDate && (window == null ? void 0 : window.endDateUtc) === endDate));
1135
- });
1136
- });
1137
- };
1138
-
1139
- const getAddressOrderForm = (orderForm, session, addressChanged) => {
1140
- var _orderForm$shippingDa, _orderForm$shippingDa2, _orderForm$shippingDa3, _orderForm$shippingDa4;
1141
- const postalCode = session.postalCode;
1142
- const geoCoordinates = session.geoCoordinates;
1143
- const availableAddresses = (_orderForm$shippingDa = orderForm == null ? void 0 : (_orderForm$shippingDa2 = orderForm.shippingData) == null ? void 0 : _orderForm$shippingDa2.availableAddresses) != null ? _orderForm$shippingDa : [];
1144
- const selectedAddresses = (_orderForm$shippingDa3 = orderForm == null ? void 0 : (_orderForm$shippingDa4 = orderForm.shippingData) == null ? void 0 : _orderForm$shippingDa4.selectedAddresses) != null ? _orderForm$shippingDa3 : [];
1145
- // Validate if no change for the address was made and the deliveryMode has changed we can return the address from the orderForm
1146
- if (!addressChanged && selectedAddresses.length > 0) {
1147
- return [selectedAddresses[0]];
1148
- }
1149
- // Validate if the address from the session already exists at the availableAddresses from the OrderForm to avoid duplication
1150
- if (addressChanged && availableAddresses.length > 0) {
1151
- for (const address of availableAddresses) {
1152
- if (postalCode && geoCoordinates) {
1153
- const addressMatcher = address.postalCode === postalCode || address.geoCoordinates[0] === geoCoordinates.longitude && address.geoCoordinates[1] === geoCoordinates.latitude;
1154
- if (addressMatcher) {
1155
- return [address];
1156
- }
1157
- }
1158
- if (postalCode && !geoCoordinates) {
1159
- const addressMatcher = address.postalCode === postalCode;
1160
- if (addressMatcher) {
1161
- return [address];
1162
- }
1163
- }
1164
- if (geoCoordinates && !postalCode) {
1165
- const addressMatcher = address.geoCoordinates[0] === geoCoordinates.longitude && address.geoCoordinates[1] === geoCoordinates.latitude;
1166
- if (addressMatcher) {
1167
- return [address];
1168
- }
1169
- }
1170
- }
1171
- }
1172
- return null;
1173
- };
1174
-
1175
- const createNewAddress = session => {
1176
- const postalCode = session.postalCode;
1177
- const geoCoordinates = session.geoCoordinates;
1178
- // If the address from the session has changed and it do not exist we will create the new one
1179
- const addressSession = {
1180
- addressType: session.addressType || null,
1181
- postalCode: postalCode || null,
1182
- city: null,
1183
- state: null,
1184
- country: session.country || null,
1185
- street: null,
1186
- number: null,
1187
- neighborhood: null,
1188
- complement: null,
1189
- reference: null,
1190
- geoCoordinates: []
1191
- };
1192
- if (geoCoordinates) {
1193
- const latitude = typeof geoCoordinates === 'object' && 'latitude' in geoCoordinates ? geoCoordinates.latitude : null;
1194
- const longitude = typeof geoCoordinates === 'object' && 'longitude' in geoCoordinates ? geoCoordinates.longitude : null;
1195
- addressSession.geoCoordinates = latitude !== null && longitude !== null ? [longitude, latitude] : [];
1196
- }
1197
- return [addressSession];
1198
- };
1199
-
1200
- const isAttachment = value => value.valueReference === VALUE_REFERENCES.attachment;
1201
- const getId = item => {
1202
- var _item$itemOffered$add;
1203
- return [item.itemOffered.sku, item.seller.identifier, item.price < 0.01 ? 'Gift' : undefined, (_item$itemOffered$add = item.itemOffered.additionalProperty) == null ? void 0 : _item$itemOffered$add.filter(isAttachment).map(getPropertyId).join('-')].filter(Boolean).join('::');
1204
- };
1205
- const orderFormItemToOffer = (item, index) => ({
1206
- listPrice: item.listPrice / 100,
1207
- price: item.sellingPrice / 100,
1208
- quantity: item.quantity,
1209
- seller: {
1210
- identifier: item.seller
1211
- },
1212
- itemOffered: {
1213
- sku: item.id,
1214
- image: [],
1215
- name: item.name,
1216
- additionalProperty: item.attachments.map(attachmentToPropertyValue)
1217
- },
1218
- index
1219
- });
1220
- const offerToOrderItemInput = offer => {
1221
- var _offer$itemOffered$ad, _offer$itemOffered$ad2;
1222
- return {
1223
- quantity: offer.quantity,
1224
- seller: offer.seller.identifier,
1225
- id: offer.itemOffered.sku,
1226
- index: offer.index,
1227
- attachments: ((_offer$itemOffered$ad = (_offer$itemOffered$ad2 = offer.itemOffered.additionalProperty) == null ? void 0 : _offer$itemOffered$ad2.filter(isAttachment)) != null ? _offer$itemOffered$ad : []).map(attachment => ({
1228
- name: attachment.name,
1229
- content: attachment.value
1230
- }))
1231
- };
1232
- };
1233
- const groupById = offers => offers.reduce((acc, item) => {
1234
- var _acc$get;
1235
- const id = getId(item);
1236
- if (!acc.has(id)) {
1237
- acc.set(id, []);
1238
- }
1239
- (_acc$get = acc.get(id)) == null ? void 0 : _acc$get.push(item);
1240
- return acc;
1241
- }, new Map());
1242
- const equals = (storeOrder, orderForm) => {
1243
- const pick = (item, index) => ({
1244
- ...item,
1245
- itemOffered: {
1246
- sku: item.itemOffered.sku
1247
- },
1248
- index
1249
- });
1250
- const orderFormItems = orderForm.items.map(orderFormItemToOffer).map(pick);
1251
- const storeOrderItems = storeOrder.acceptedOffer.map(pick);
1252
- const isSameOrder = storeOrder.orderNumber === orderForm.orderFormId;
1253
- const orderItemsAreSync = deepEquals(orderFormItems, storeOrderItems);
1254
- return isSameOrder && orderItemsAreSync;
1255
- };
1256
- const joinItems = form => {
1257
- const itemsById = form.items.reduce((acc, item) => {
1258
- const id = getId(orderFormItemToOffer(item));
1259
- if (!acc[id]) {
1260
- acc[id] = [];
1261
- }
1262
- acc[id].push(item);
1263
- return acc;
1264
- }, {});
1265
- return {
1266
- ...form,
1267
- items: Object.values(itemsById).map(items => {
1268
- const [item] = items;
1269
- const quantity = items.reduce((acc, i) => acc + i.quantity, 0);
1270
- const totalPrice = items.reduce((acc, i) => {
1271
- var _i$priceDefinition$to, _i$priceDefinition, _i$quantity, _i$sellingPrice;
1272
- return acc + ((_i$priceDefinition$to = i == null ? void 0 : (_i$priceDefinition = i.priceDefinition) == null ? void 0 : _i$priceDefinition.total) != null ? _i$priceDefinition$to : ((_i$quantity = i == null ? void 0 : i.quantity) != null ? _i$quantity : 0) * ((_i$sellingPrice = i == null ? void 0 : i.sellingPrice) != null ? _i$sellingPrice : 0));
1273
- }, 0);
1274
- return {
1275
- ...item,
1276
- quantity,
1277
- sellingPrice: totalPrice / quantity
1278
- };
1279
- })
1280
- };
1281
- };
1282
- const orderFormToCart = async (form, skuLoader) => {
1283
- return {
1284
- order: {
1285
- orderNumber: form.orderFormId,
1286
- acceptedOffer: form.items.map(async item => ({
1287
- ...item,
1288
- product: await skuLoader.load(item.id)
1289
- }))
1290
- },
1291
- messages: form.messages.map(({
1292
- text,
1293
- status
1294
- }) => ({
1295
- text,
1296
- status: status.toUpperCase()
1297
- }))
1298
- };
1299
- };
1300
- const getOrderFormEtag = ({
1301
- items
1302
- }) => md5(JSON.stringify(items));
1303
- const setOrderFormEtag = async (form, commerce) => {
1304
- try {
1305
- const orderForm = await commerce.checkout.setCustomData({
1306
- id: form.orderFormId,
1307
- appId: 'faststore',
1308
- key: 'cartEtag',
1309
- value: getOrderFormEtag(form)
1310
- });
1311
- return orderForm;
1312
- } catch (err) {
1313
- console.error('Error while setting custom data to orderForm.\n Make sure to add the following custom app to the orderForm: \n{"fields":["cartEtag"],"id":"faststore","major":1}.\n More info at: https://developers.vtex.com/vtex-rest-api/docs/customizable-fields-with-checkout-api');
1314
- throw err;
1315
- }
1316
- };
1317
- /**
1318
- * Checks if cartEtag stored on customData is up to date
1319
- * @description If cartEtag is not up to date, this means that
1320
- * another system changed the cart, like Checkout UI or Order Placed
1321
- */
1322
- const isOrderFormStale = form => {
1323
- var _form$customData, _faststoreData$fields;
1324
- const faststoreData = (_form$customData = form.customData) == null ? void 0 : _form$customData.customApps.find(app => app.id === 'faststore');
1325
- const oldEtag = faststoreData == null ? void 0 : (_faststoreData$fields = faststoreData.fields) == null ? void 0 : _faststoreData$fields.cartEtag;
1326
- if (oldEtag == null) {
1327
- return true;
1328
- }
1329
- const newEtag = getOrderFormEtag(form);
1330
- return newEtag !== oldEtag;
1331
- };
1332
- // Returns the regionalized orderForm
1333
- const getOrderForm = async (id, {
1334
- clients: {
1335
- commerce
1336
- }
1337
- }) => {
1338
- return commerce.checkout.orderForm({
1339
- id
1340
- });
1341
- };
1342
- const clearOrderFormMessages = async (id, {
1343
- clients: {
1344
- commerce
1345
- }
1346
- }) => {
1347
- return commerce.checkout.clearOrderFormMessages({
1348
- id
1349
- });
1350
- };
1351
- const updateOrderFormShippingData = async (orderForm, session, {
1352
- clients: {
1353
- commerce
1354
- }
1355
- }) => {
1356
- // Stores that are not yet providing the session while validating the cart
1357
- // should not be able to update the shipping data
1358
- //
1359
- // This was causing errors while validating regionalizated carts
1360
- // because the following code was trying to change the shippingData to an undefined address/session
1361
- if (!session) {
1362
- return orderForm;
1363
- }
1364
- const {
1365
- updateShipping,
1366
- addressChanged
1367
- } = shouldUpdateShippingData(orderForm, session);
1368
- if (updateShipping) {
1369
- var _session$deliveryMode;
1370
- // Check if the orderForm address matches the one from the session
1371
- const oldAddress = getAddressOrderForm(orderForm, session, addressChanged);
1372
- const address = oldAddress ? oldAddress : createNewAddress(session);
1373
- const selectedAddresses = address;
1374
- const hasDeliveryWindow = (_session$deliveryMode = session.deliveryMode) != null && _session$deliveryMode.deliveryWindow ? true : false;
1375
- if (hasDeliveryWindow) {
1376
- // if you have a Delivery Window you have to first get the delivery window to set the desired after
1377
- await commerce.checkout.shippingData({
1378
- id: orderForm.orderFormId,
1379
- index: orderForm.items.length,
1380
- deliveryMode: session.deliveryMode,
1381
- selectedAddresses: selectedAddresses
1382
- }, false);
1383
- }
1384
- return commerce.checkout.shippingData({
1385
- id: orderForm.orderFormId,
1386
- index: orderForm.items.length,
1387
- deliveryMode: session.deliveryMode,
1388
- selectedAddresses: selectedAddresses
1389
- }, true);
1390
- }
1391
- return orderForm;
1392
- };
1393
- /**
1394
- * This resolver implements the optimistic cart behavior. The main idea in here
1395
- * is that we receive a cart from the UI (as query params) and we validate it with
1396
- * the commerce platform. If the cart is valid, we return null, if the cart is
1397
- * invalid according to the commerce platform, we return the new cart the UI should use
1398
- * instead.
1399
- *
1400
- * The algorithm is something like:
1401
- * 1. Fetch orderForm from VTEX
1402
- * 2. Compute delta changes between the orderForm and the UI's cart
1403
- * 3. Update the orderForm in VTEX platform accordingly
1404
- * 4. If any changes were made, send to the UI the new cart. Null otherwise
1405
- */
1406
- const validateCart = async (_, {
1407
- cart: {
1408
- order
1409
- },
1410
- session
1411
- }, ctx) => {
1412
- const {
1413
- orderNumber,
1414
- acceptedOffer,
1415
- shouldSplitItem
1416
- } = order;
1417
- const {
1418
- clients: {
1419
- commerce
1420
- },
1421
- loaders: {
1422
- skuLoader
1423
- }
1424
- } = ctx;
1425
- const channel = session == null ? void 0 : session.channel;
1426
- const locale = session == null ? void 0 : session.locale;
1427
- if (channel) {
1428
- mutateChannelContext(ctx, channel);
1429
- }
1430
- if (locale) {
1431
- mutateLocaleContext(ctx, locale);
1432
- }
1433
- // Step1: Get OrderForm from VTEX Commerce
1434
- const orderForm = await getOrderForm(orderNumber, ctx);
1435
- // Clear messages so it doesn't keep populating toasts on a loop
1436
- // In the next validateCart mutation it will only have messages if a new message is created on orderForm
1437
- if (orderForm.messages.length !== 0) {
1438
- await clearOrderFormMessages(orderNumber, ctx);
1439
- }
1440
- // Step1.5: Check if another system changed the orderForm with this orderNumber
1441
- // If so, this means the user interacted with this cart elsewhere and expects
1442
- // to see this new cart state instead of what's stored on the user's browser.
1443
- const isStale = isOrderFormStale(orderForm);
1444
- if (isStale && orderNumber) {
1445
- const newOrderForm = await setOrderFormEtag(orderForm, commerce).then(joinItems);
1446
- return orderFormToCart(newOrderForm, skuLoader);
1447
- }
1448
- // Step2: Process items from both browser and checkout so they have the same shape
1449
- const browserItemsById = groupById(acceptedOffer);
1450
- const originItemsById = groupById(orderForm.items.map(orderFormItemToOffer));
1451
- const originItems = Array.from(originItemsById.entries()); // items on the VTEX platform backend
1452
- const browserItems = Array.from(browserItemsById.entries()); // items on the user's browser
1453
- // Step3: Compute delta changes
1454
- const {
1455
- itemsToAdd,
1456
- itemsToUpdate
1457
- } = browserItems.reduce((acc, [id, items]) => {
1458
- const maybeOriginItem = originItemsById.get(id);
1459
- // Adding new items to cart
1460
- if (!maybeOriginItem) {
1461
- items.forEach(item => acc.itemsToAdd.push(item));
1462
- return acc;
1463
- }
1464
- // Update existing items
1465
- const [head, ...tail] = maybeOriginItem;
1466
- const totalQuantity = items.reduce((acc, curr) => acc + curr.quantity, 0);
1467
- // set total quantity to first item
1468
- acc.itemsToUpdate.push({
1469
- ...head,
1470
- quantity: totalQuantity
1471
- });
1472
- // Remove all the rest
1473
- tail.forEach(item => acc.itemsToUpdate.push({
1474
- ...item,
1475
- quantity: 0
1476
- }));
1477
- return acc;
1478
- }, {
1479
- itemsToAdd: [],
1480
- itemsToUpdate: []
1481
- });
1482
- const itemsToDelete = originItems.filter(([id]) => !browserItemsById.has(id)).flatMap(([, items]) => items.map(item => ({
1483
- ...item,
1484
- quantity: 0
1485
- })));
1486
- const changes = [...itemsToAdd, ...itemsToUpdate, ...itemsToDelete].map(offerToOrderItemInput);
1487
- if (changes.length === 0) {
1488
- return null;
1489
- }
1490
- // Step4: Apply delta changes to order form
1491
- const updatedOrderForm = await commerce.checkout
1492
- // update orderForm items
1493
- .updateOrderFormItems({
1494
- id: orderForm.orderFormId,
1495
- orderItems: changes,
1496
- shouldSplitItem
1497
- })
1498
- // update orderForm shippingData
1499
- .then(form => updateOrderFormShippingData(form, session, ctx))
1500
- // update orderForm etag so we know last time we touched this orderForm
1501
- .then(form => setOrderFormEtag(form, commerce)).then(joinItems);
1502
- const equalMessages = deepEquals(orderForm.messages, updatedOrderForm.messages);
1503
- // Step5: If no changes detected before/after updating orderForm, the order is validated
1504
- if (equals(order, updatedOrderForm) && equalMessages) {
1505
- return null;
1506
- }
1507
- // Step6: There were changes, convert orderForm to StoreCart
1508
- return orderFormToCart(updatedOrderForm, skuLoader);
1509
- };
1510
-
1511
- const validateSession = async (_, {
1512
- session: oldSession,
1513
- search
1514
- }, {
1515
- clients
1516
- }) => {
1517
- var _oldSession$channel, _oldSession$postalCod, _oldSession$geoCoordi, _oldSession$country, _params$get, _sessionData$namespac, _sessionData$namespac2, _store$currencyCode$v, _store$currencySymbol, _store$countryCode$va, _store$channel$value, _store$channel, _region$id, _profile$id$value, _profile$id, _profile$email$value, _profile$email, _profile$firstName$va, _profile$firstName, _profile$lastName$val, _profile$lastName;
1518
- const channel = ChannelMarshal.parse((_oldSession$channel = oldSession.channel) != null ? _oldSession$channel : '');
1519
- const postalCode = String((_oldSession$postalCod = oldSession.postalCode) != null ? _oldSession$postalCod : '').replace(/\D/g, '');
1520
- const geoCoordinates = (_oldSession$geoCoordi = oldSession.geoCoordinates) != null ? _oldSession$geoCoordi : null;
1521
- const country = (_oldSession$country = oldSession.country) != null ? _oldSession$country : '';
1522
- const params = new URLSearchParams(search);
1523
- const salesChannel = (_params$get = params.get('sc')) != null ? _params$get : channel.salesChannel;
1524
- params.set('sc', salesChannel);
1525
- const [regionData, sessionData] = await Promise.all([postalCode || geoCoordinates ? clients.commerce.checkout.region({
1526
- postalCode,
1527
- geoCoordinates,
1528
- country,
1529
- salesChannel
1530
- }) : Promise.resolve(null), clients.commerce.session(params.toString()).catch(() => null)]);
1531
- const profile = (_sessionData$namespac = sessionData == null ? void 0 : sessionData.namespaces.profile) != null ? _sessionData$namespac : null;
1532
- const store = (_sessionData$namespac2 = sessionData == null ? void 0 : sessionData.namespaces.store) != null ? _sessionData$namespac2 : null;
1533
- const region = regionData == null ? void 0 : regionData[0];
1534
- // Set seller only if it's inside a region
1535
- const seller = region == null ? void 0 : region.sellers.find(seller => channel.seller === seller.id);
1536
- const newSession = {
1537
- ...oldSession,
1538
- currency: {
1539
- code: (_store$currencyCode$v = store == null ? void 0 : store.currencyCode.value) != null ? _store$currencyCode$v : oldSession.currency.code,
1540
- symbol: (_store$currencySymbol = store == null ? void 0 : store.currencySymbol.value) != null ? _store$currencySymbol : oldSession.currency.symbol
1541
- },
1542
- country: (_store$countryCode$va = store == null ? void 0 : store.countryCode.value) != null ? _store$countryCode$va : oldSession.country,
1543
- channel: ChannelMarshal.stringify({
1544
- salesChannel: (_store$channel$value = store == null ? void 0 : (_store$channel = store.channel) == null ? void 0 : _store$channel.value) != null ? _store$channel$value : channel.salesChannel,
1545
- regionId: (_region$id = region == null ? void 0 : region.id) != null ? _region$id : channel.regionId,
1546
- seller: seller == null ? void 0 : seller.id
1547
- }),
1548
- person: profile != null && profile.id ? {
1549
- id: (_profile$id$value = (_profile$id = profile.id) == null ? void 0 : _profile$id.value) != null ? _profile$id$value : '',
1550
- email: (_profile$email$value = (_profile$email = profile.email) == null ? void 0 : _profile$email.value) != null ? _profile$email$value : '',
1551
- givenName: (_profile$firstName$va = (_profile$firstName = profile.firstName) == null ? void 0 : _profile$firstName.value) != null ? _profile$firstName$va : '',
1552
- familyName: (_profile$lastName$val = (_profile$lastName = profile.lastName) == null ? void 0 : _profile$lastName.value) != null ? _profile$lastName$val : ''
1553
- } : null
1554
- };
1555
- if (deepEquals(oldSession, newSession)) {
1556
- return null;
1557
- }
1558
- return newSession;
1559
- };
1560
-
1561
- const Mutation = {
1562
- validateCart,
1563
- validateSession,
1564
- subscribeToNewsletter
1565
- };
1566
-
1567
- const ObjectOrString = /*#__PURE__*/new graphql.GraphQLScalarType({
1568
- name: 'ObjectOrString',
1569
- description: 'A string or the string representation of an object (a stringified object).',
1570
- parseValue: toObjectOrString,
1571
- serialize: stringify,
1572
- parseLiteral(ast) {
1573
- if (ast.kind === language.Kind.STRING) {
1574
- return getValueAsObjectOrString(ast.value);
1575
- }
1576
- return null;
1577
- }
1578
- });
1579
- function toObjectOrString(value) {
1580
- if (typeof value === 'string') {
1581
- return getValueAsObjectOrString(value);
1582
- }
1583
- return null;
1584
- }
1585
- function getValueAsObjectOrString(value) {
1586
- try {
1587
- return JSON.parse(value);
1588
- } catch (e) {
1589
- return value;
1590
- }
1591
- }
1592
- function stringify(value) {
1593
- if (typeof value === 'object') {
1594
- return JSON.stringify(value);
1595
- }
1596
- if (typeof value === 'string') {
1597
- return value;
1598
- }
1599
- return null;
1600
- }
1601
-
1602
- const isSearchItem = item => 'Price' in item && 'seller' in item && 'product' in item;
1603
- const isOrderFormItem = item => 'skuName' in item;
1604
- const StoreOffer = {
1605
- priceCurrency: async (_, __, ctx) => {
1606
- var _sc$CurrencyCode;
1607
- const {
1608
- loaders: {
1609
- salesChannelLoader
1610
- },
1611
- storage: {
1612
- channel
1613
- }
1614
- } = ctx;
1615
- const sc = await salesChannelLoader.load(channel.salesChannel);
1616
- return (_sc$CurrencyCode = sc.CurrencyCode) != null ? _sc$CurrencyCode : '';
1617
- },
1618
- priceValidUntil: root => {
1619
- if (isSearchItem(root)) {
1620
- var _root$PriceValidUntil;
1621
- return (_root$PriceValidUntil = root.PriceValidUntil) != null ? _root$PriceValidUntil : '';
1622
- }
1623
- if (isOrderFormItem(root)) {
1624
- var _root$priceValidUntil;
1625
- return (_root$priceValidUntil = root.priceValidUntil) != null ? _root$priceValidUntil : '';
1626
- }
1627
- return null;
1628
- },
1629
- itemCondition: () => 'https://schema.org/NewCondition',
1630
- availability: async root => {
1631
- if (isSearchItem(root)) {
1632
- return availability(inStock(root));
1633
- }
1634
- if (isOrderFormItem(root)) {
1635
- return availability(inStockOrderFormItem(root.availability));
1636
- }
1637
- return null;
1638
- },
1639
- seller: (root, _, ctx) => {
1640
- if (isSearchItem(root)) {
1641
- var _ctx$storage$channel;
1642
- return {
1643
- identifier: ((_ctx$storage$channel = ctx.storage.channel) == null ? void 0 : _ctx$storage$channel.seller) || root.seller.sellerId || ''
1644
- };
1645
- }
1646
- if (isOrderFormItem(root)) {
1647
- return {
1648
- identifier: root.seller
1649
- };
1650
- }
1651
- return null;
1652
- },
1653
- price: root => {
1654
- if (isSearchItem(root)) {
1655
- return price(root);
1656
- }
1657
- if (isOrderFormItem(root)) {
1658
- return root.sellingPrice / 1e2;
1659
- }
1660
- return null;
1661
- },
1662
- sellingPrice: root => {
1663
- if (isSearchItem(root)) {
1664
- return sellingPrice(root);
1665
- }
1666
- if (isOrderFormItem(root)) {
1667
- return root.sellingPrice / 1e2;
1668
- }
1669
- return null;
1670
- },
1671
- listPrice: root => {
1672
- if (isSearchItem(root)) {
1673
- var _root$ListPrice;
1674
- return (_root$ListPrice = root.ListPrice) != null ? _root$ListPrice : 0;
1675
- }
1676
- if (isOrderFormItem(root)) {
1677
- return root.listPrice / 1e2;
1678
- }
1679
- return null;
1680
- },
1681
- itemOffered: root => {
1682
- if (isSearchItem(root)) {
1683
- return root.product;
1684
- }
1685
- if (isOrderFormItem(root)) {
1686
- return {
1687
- ...root.product,
1688
- attachmentsValues: root.attachments
1689
- };
1690
- }
1691
- return null;
1692
- },
1693
- quantity: root => {
1694
- if (isSearchItem(root)) {
1695
- var _root$AvailableQuanti;
1696
- return (_root$AvailableQuanti = root.AvailableQuantity) != null ? _root$AvailableQuanti : 0;
1697
- }
1698
- if (isOrderFormItem(root)) {
1699
- return root.quantity;
1700
- }
1701
- return null;
1702
- }
1703
- };
1704
-
1705
- const canonicalFromProduct = ({
1706
- linkText
1707
- }) => `/${linkText}/p`;
1708
-
1709
- const enhanceCommercialOffer = ({
1710
- offer,
1711
- seller,
1712
- product
1713
- }) => ({
1714
- ...offer,
1715
- product,
1716
- seller
1717
- });
1718
-
1719
- const DEFAULT_IMAGE = {
1720
- imageText: 'image',
1721
- imageUrl: 'https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg'
1722
- };
1723
- const getSlug = (link, id) => `${link}-${id}`;
1724
- const getPath = (link, id) => `/${getSlug(link, id)}/p`;
1725
- const nonEmptyArray = array => Array.isArray(array) && array.length > 0 ? array : null;
1726
- const StoreProduct = {
1727
- productID: ({
1728
- itemId
1729
- }) => itemId,
1730
- name: ({
1731
- isVariantOf,
1732
- name
1733
- }) => name != null ? name : isVariantOf.productName,
1734
- slug: ({
1735
- isVariantOf: {
1736
- linkText
1737
- },
1738
- itemId
1739
- }) => getSlug(linkText, itemId),
1740
- description: ({
1741
- isVariantOf: {
1742
- description
1743
- }
1744
- }) => description,
1745
- seo: ({
1746
- isVariantOf
1747
- }) => ({
1748
- title: isVariantOf.productName,
1749
- description: isVariantOf.description,
1750
- canonical: canonicalFromProduct(isVariantOf)
1751
- }),
1752
- brand: ({
1753
- isVariantOf: {
1754
- brand
1755
- }
1756
- }) => ({
1757
- name: brand
1758
- }),
1759
- breadcrumbList: ({
1760
- isVariantOf: {
1761
- categories,
1762
- productName,
1763
- linkText
1764
- },
1765
- itemId
1766
- }) => {
1767
- return {
1768
- itemListElement: [...categories.reverse().map((categoryPath, index) => {
1769
- const splitted = categoryPath.split('/');
1770
- const name = splitted[splitted.length - 2];
1771
- const item = splitted.map(slugify).join('/');
1772
- return {
1773
- name,
1774
- item,
1775
- position: index + 1
1776
- };
1777
- }), {
1778
- name: productName,
1779
- item: getPath(linkText, itemId),
1780
- position: categories.length + 1
1781
- }],
1782
- numberOfItems: categories.length
1783
- };
1784
- },
1785
- image: ({
1786
- images
1787
- }) => {
1788
- var _nonEmptyArray;
1789
- return ((_nonEmptyArray = nonEmptyArray(images)) != null ? _nonEmptyArray : [DEFAULT_IMAGE]).map(({
1790
- imageUrl,
1791
- imageText
1792
- }) => ({
1793
- alternateName: imageText != null ? imageText : '',
1794
- url: imageUrl.replace('vteximg.com.br', 'vtexassets.com')
1795
- }));
1796
- },
1797
- sku: ({
1798
- itemId
1799
- }) => itemId,
1800
- gtin: ({
1801
- referenceId
1802
- }) => {
1803
- var _referenceId$0$Value, _referenceId$;
1804
- return (_referenceId$0$Value = (_referenceId$ = referenceId[0]) == null ? void 0 : _referenceId$.Value) != null ? _referenceId$0$Value : '';
1805
- },
1806
- review: () => [],
1807
- aggregateRating: () => ({}),
1808
- offers: root => root.sellers.map(seller => enhanceCommercialOffer({
1809
- offer: seller.commertialOffer,
1810
- seller,
1811
- product: root
1812
- })).sort(bestOfferFirst),
1813
- isVariantOf: root => root,
1814
- additionalProperty: ({
1815
- // Search uses the name variations for specifications
1816
- variations: specifications = [],
1817
- attachmentsValues = []
1818
- }) => {
1819
- const propertyValueSpecifications = specifications.flatMap(({
1820
- name,
1821
- values
1822
- }) => values.map(value => ({
1823
- name,
1824
- value,
1825
- valueReference: VALUE_REFERENCES.specification
1826
- })));
1827
- const propertyValueAttachments = attachmentsValues.map(attachmentToPropertyValue);
1828
- return [...propertyValueSpecifications, ...propertyValueAttachments];
1829
- },
1830
- releaseDate: ({
1831
- isVariantOf: {
1832
- releaseDate
1833
- }
1834
- }) => releaseDate != null ? releaseDate : ''
1835
- };
1836
-
1837
- const BLOCKED_SPECIFICATIONS = /*#__PURE__*/new Set(['allSpecifications']);
1838
- const StoreProductGroup = {
1839
- hasVariant: root => root.isVariantOf.items.map(item => enhanceSku(item, root.isVariantOf)),
1840
- productGroupID: ({
1841
- isVariantOf
1842
- }) => isVariantOf.productId,
1843
- name: root => root.isVariantOf.productName,
1844
- skuVariants: root => root,
1845
- additionalProperty: ({
1846
- isVariantOf: {
1847
- specificationGroups
1848
- }
1849
- }) => specificationGroups
1850
- // Filter sku specifications so we don't mix them with product specs.
1851
- .filter(specificationGroup => !BLOCKED_SPECIFICATIONS.has(specificationGroup.name))
1852
- // Transform specs back into product specs.
1853
- .flatMap(({
1854
- specifications
1855
- }) => specifications.flatMap(({
1856
- name,
1857
- values
1858
- }) => values.map(value => ({
1859
- name,
1860
- value,
1861
- valueReference: VALUE_REFERENCES.specification
1862
- }))))
1863
- };
1864
-
1865
- const StorePropertyValue = {
1866
- propertyID: root => getPropertyId(root),
1867
- name: ({
1868
- name
1869
- }) => name,
1870
- value: ({
1871
- value
1872
- }) => value,
1873
- valueReference: ({
1874
- valueReference
1875
- }) => valueReference
1876
- };
1877
-
1878
- const SORT_MAP = {
1879
- price_desc: 'price:desc',
1880
- price_asc: 'price:asc',
1881
- orders_desc: 'orders:desc',
1882
- name_desc: 'name:desc',
1883
- name_asc: 'name:asc',
1884
- release_desc: 'release:desc',
1885
- discount_desc: 'discount:desc',
1886
- score_desc: ''
1887
- };
1888
-
1889
- /**
1890
- * This function implements Portal heuristics for returning the best sku for a product.
1891
- *
1892
- * The best sku is the one with the best (cheapest available) offer
1893
- * */
1894
- const pickBestSku = skus => {
1895
- const offersBySku = skus.flatMap(sku => sku.sellers.map(seller => ({
1896
- offer: seller.commertialOffer,
1897
- sku
1898
- })));
1899
- const best = min(offersBySku, ({
1900
- offer: o1
1901
- }, {
1902
- offer: o2
1903
- }) => bestOfferFirst(o1, o2));
1904
- return best ? best.sku : skus[0];
1905
- };
1906
- const isValidSkuId = skuId => skuId !== '' && !Number.isNaN(Number(skuId));
1907
-
1908
- const Query = {
1909
- product: async (_, {
1910
- locator
1911
- }, ctx) => {
1912
- // Insert channel in context for later usage
1913
- const channel = findChannel(locator);
1914
- const locale = findLocale(locator);
1915
- const id = findSkuId(locator);
1916
- const slug = findSlug(locator);
1917
- if (channel) {
1918
- mutateChannelContext(ctx, channel);
1919
- }
1920
- if (locale) {
1921
- mutateLocaleContext(ctx, locale);
1922
- }
1923
- const {
1924
- loaders: {
1925
- skuLoader
1926
- },
1927
- clients: {
1928
- commerce,
1929
- search
1930
- }
1931
- } = ctx;
1932
- try {
1933
- var _ref;
1934
- const skuId = (_ref = id != null ? id : slug == null ? void 0 : slug.split('-').pop()) != null ? _ref : '';
1935
- if (!isValidSkuId(skuId)) {
1936
- throw new Error('Invalid SkuId');
1937
- }
1938
- const sku = await skuLoader.load(skuId);
1939
- /**
1940
- * Here be dragons 🦄🦄🦄
1941
- *
1942
- * In some cases, the slug has a valid skuId for a different
1943
- * product. This condition makes sure that the fetched sku
1944
- * is the one we actually asked for
1945
- * */
1946
- if (slug && sku.isVariantOf.linkText && !slug.startsWith(sku.isVariantOf.linkText)) {
1947
- throw new Error(`Slug was set but the fetched sku does not satisfy the slug condition. slug: ${slug}, linkText: ${sku.isVariantOf.linkText}`);
1948
- }
1949
- return sku;
1950
- } catch (err) {
1951
- if (slug == null) {
1952
- throw new BadRequestError('Missing slug or id');
1953
- }
1954
- const route = await commerce.catalog.portal.pagetype(`${slug}/p`);
1955
- if (route.pageType !== 'Product' || !route.id) {
1956
- throw new NotFoundError(`No product found for slug ${slug}`);
1957
- }
1958
- const {
1959
- products: [product]
1960
- } = await search.products({
1961
- page: 0,
1962
- count: 1,
1963
- query: `product:${route.id}`
1964
- });
1965
- if (!product) {
1966
- throw new NotFoundError(`No product found for id ${route.id}`);
1967
- }
1968
- const sku = pickBestSku(product.items);
1969
- return enhanceSku(sku, product);
1970
- }
1971
- },
1972
- collection: (_, {
1973
- slug
1974
- }, ctx) => {
1975
- const {
1976
- loaders: {
1977
- collectionLoader
1978
- }
1979
- } = ctx;
1980
- return collectionLoader.load(slug);
1981
- },
1982
- search: async (_, {
1983
- first,
1984
- after: maybeAfter,
1985
- sort,
1986
- term,
1987
- selectedFacets
1988
- }, ctx) => {
1989
- var _query, _selectedFacets$flatM;
1990
- // Insert channel in context for later usage
1991
- const channel = findChannel(selectedFacets);
1992
- const locale = findLocale(selectedFacets);
1993
- const crossSelling = findCrossSelling(selectedFacets);
1994
- if (channel) {
1995
- mutateChannelContext(ctx, channel);
1996
- }
1997
- if (locale) {
1998
- mutateLocaleContext(ctx, locale);
1999
- }
2000
- let query = term;
2001
- /**
2002
- * In case we are using crossSelling, we need to modify the search
2003
- * we will be performing on our search engine. The idea in here
2004
- * is to use the cross selling API for fetching the productIds our
2005
- * search will return for us.
2006
- * Doing this two request workflow makes it possible to have cross
2007
- * selling with Search features, like pagination, internationalization
2008
- * etc
2009
- */
2010
- if (crossSelling) {
2011
- const products = await ctx.clients.commerce.catalog.products.crossselling({
2012
- type: FACET_CROSS_SELLING_MAP[crossSelling.key],
2013
- productId: crossSelling.value
2014
- });
2015
- query = `product:${products.map(x => x.productId).slice(0, first).join(';')}`;
2016
- }
2017
- const after = maybeAfter ? Number(maybeAfter) : 0;
2018
- const searchArgs = {
2019
- page: Math.ceil(after / first),
2020
- count: first,
2021
- query: (_query = query) != null ? _query : undefined,
2022
- sort: SORT_MAP[sort != null ? sort : 'score_desc'],
2023
- selectedFacets: (_selectedFacets$flatM = selectedFacets == null ? void 0 : selectedFacets.flatMap(transformSelectedFacet)) != null ? _selectedFacets$flatM : []
2024
- };
2025
- const productSearchPromise = ctx.clients.search.products(searchArgs);
2026
- return {
2027
- searchArgs,
2028
- productSearchPromise
2029
- };
2030
- },
2031
- allProducts: async (_, {
2032
- first,
2033
- after: maybeAfter
2034
- }, ctx) => {
2035
- const {
2036
- clients: {
2037
- search
2038
- }
2039
- } = ctx;
2040
- const after = maybeAfter ? Number(maybeAfter) : 0;
2041
- const products = await search.products({
2042
- page: Math.ceil(after / first),
2043
- count: first
2044
- });
2045
- const skus = products.products.map(product => product.items.map(sku => enhanceSku(sku, product))).flat().filter(sku => sku.sellers.length > 0);
2046
- return {
2047
- pageInfo: {
2048
- hasNextPage: products.pagination.after.length > 0,
2049
- hasPreviousPage: products.pagination.before.length > 0,
2050
- startCursor: '0',
2051
- endCursor: products.recordsFiltered.toString(),
2052
- totalCount: products.recordsFiltered
2053
- },
2054
- // after + index is bigger than after+first itself because of the array flat() above
2055
- edges: skus.map((sku, index) => ({
2056
- node: sku,
2057
- cursor: (after + index).toString()
2058
- }))
2059
- };
2060
- },
2061
- allCollections: async (_, {
2062
- first,
2063
- after: maybeAfter
2064
- }, ctx) => {
2065
- const {
2066
- clients: {
2067
- commerce
2068
- }
2069
- } = ctx;
2070
- const after = maybeAfter ? Number(maybeAfter) : 0;
2071
- const [brands, tree] = await Promise.all([commerce.catalog.brand.list(), commerce.catalog.category.tree()]);
2072
- const categories = [];
2073
- const dfs = (node, level) => {
2074
- categories.push({
2075
- ...node,
2076
- level
2077
- });
2078
- for (const child of node.children) {
2079
- dfs(child, level + 1);
2080
- }
2081
- };
2082
- for (const node of tree) {
2083
- dfs(node, 0);
2084
- }
2085
- const collections = [...brands.filter(brand => brand.isActive).map(x => ({
2086
- ...x,
2087
- type: 'brand'
2088
- })), ...categories];
2089
- const validCollections = collections
2090
- // Nullable slugs may cause one route to override the other
2091
- .filter(node => Boolean(StoreCollection.slug(node, null, ctx, null)));
2092
- return {
2093
- pageInfo: {
2094
- hasNextPage: validCollections.length - after > first,
2095
- hasPreviousPage: after > 0,
2096
- startCursor: '0',
2097
- endCursor: (Math.min(first, validCollections.length - after) - 1).toString(),
2098
- totalCount: validCollections.length
2099
- },
2100
- edges: validCollections.slice(after, after + first).map((node, index) => ({
2101
- node,
2102
- cursor: (after + index).toString()
2103
- }))
2104
- };
2105
- },
2106
- shipping: async (_, {
2107
- country,
2108
- items,
2109
- postalCode
2110
- }, ctx) => {
2111
- const {
2112
- loaders: {
2113
- simulationLoader
2114
- },
2115
- clients: {
2116
- commerce
2117
- }
2118
- } = ctx;
2119
- const [simulation, address] = await Promise.all([simulationLoader.load({
2120
- country,
2121
- items,
2122
- postalCode
2123
- }), commerce.checkout.address({
2124
- postalCode,
2125
- country
2126
- })]);
2127
- return {
2128
- ...simulation,
2129
- address
2130
- };
2131
- },
2132
- redirect: async (_, {
2133
- term,
2134
- selectedFacets
2135
- }, ctx) => {
2136
- var _selectedFacets$flatM2;
2137
- // Currently the search redirection can be done through a search term or filter (facet) so we limit the redirect query to always have one of these values otherwise we do not execute it.
2138
- // https://help.vtex.com/en/tracks/vtex-intelligent-search--19wrbB7nEQcmwzDPl1l4Cb/4Gd2wLQFbCwTsh8RUDwSoL?&utm_source=autocomplete
2139
- if (!term && (!selectedFacets || !selectedFacets.length)) {
2140
- return null;
2141
- }
2142
- const {
2143
- redirect
2144
- } = await ctx.clients.search.products({
2145
- page: 1,
2146
- count: 1,
2147
- query: term != null ? term : undefined,
2148
- selectedFacets: (_selectedFacets$flatM2 = selectedFacets == null ? void 0 : selectedFacets.flatMap(transformSelectedFacet)) != null ? _selectedFacets$flatM2 : []
2149
- });
2150
- return {
2151
- url: redirect
2152
- };
2153
- },
2154
- sellers: async (_, {
2155
- postalCode,
2156
- geoCoordinates,
2157
- country,
2158
- salesChannel
2159
- }, ctx) => {
2160
- const {
2161
- clients: {
2162
- commerce
2163
- }
2164
- } = ctx;
2165
- const regionData = await commerce.checkout.region({
2166
- postalCode,
2167
- geoCoordinates,
2168
- country,
2169
- salesChannel
2170
- });
2171
- const region = regionData == null ? void 0 : regionData[0];
2172
- const {
2173
- id,
2174
- sellers
2175
- } = region;
2176
- return {
2177
- id,
2178
- sellers
2179
- };
2180
- }
2181
- };
2182
-
2183
- const StoreReview = {
2184
- reviewRating: () => ({
2185
- ratingValue: 5,
2186
- bestRating: 5
2187
- }),
2188
- author: () => ({
2189
- name: ''
2190
- })
2191
- };
2192
-
2193
- const isRootFacet = (facet, isDepartment, isBrand) => isDepartment ? facet.key === 'category-1' : isBrand ? facet.key === 'brand' : false;
2194
- const StoreSearchResult = {
2195
- suggestions: async (root, _, ctx) => {
2196
- const {
2197
- clients: {
2198
- search
2199
- }
2200
- } = ctx;
2201
- const {
2202
- searchArgs
2203
- } = root;
2204
- // If there's no search query, suggest the most popular searches.
2205
- if (!searchArgs.query) {
2206
- const topSearches = await search.topSearches();
2207
- return {
2208
- terms: topSearches.searches.map(item => ({
2209
- value: item.term,
2210
- count: item.count
2211
- })),
2212
- products: []
2213
- };
2214
- }
2215
- const {
2216
- productSearchPromise
2217
- } = root;
2218
- const [terms, productSearchResult] = await Promise.all([search.suggestedTerms(searchArgs), productSearchPromise]);
2219
- const skus = productSearchResult.products.map(product => {
2220
- // What determines the presentation of the SKU is the price order
2221
- // https://help.vtex.com/pt/tutorial/ordenando-imagens-na-vitrine-e-na-pagina-de-produto--tutorials_278
2222
- const maybeSku = pickBestSku(product.items);
2223
- return maybeSku && enhanceSku(maybeSku, product);
2224
- }).filter(sku => !!sku);
2225
- const {
2226
- searches
2227
- } = terms;
2228
- return {
2229
- terms: searches.map(item => ({
2230
- value: item.term,
2231
- count: item.count
2232
- })),
2233
- products: skus
2234
- };
2235
- },
2236
- products: async ({
2237
- productSearchPromise
2238
- }) => {
2239
- const productSearchResult = await productSearchPromise;
2240
- const skus = productSearchResult.products.map(product => {
2241
- // What determines the presentation of the SKU is the price order
2242
- // https://help.vtex.com/pt/tutorial/ordenando-imagens-na-vitrine-e-na-pagina-de-produto--tutorials_278
2243
- const maybeSku = pickBestSku(product.items);
2244
- return maybeSku && enhanceSku(maybeSku, product);
2245
- }).filter(sku => !!sku);
2246
- return {
2247
- pageInfo: {
2248
- hasNextPage: productSearchResult.pagination.after.length > 0,
2249
- hasPreviousPage: productSearchResult.pagination.before.length > 0,
2250
- startCursor: '0',
2251
- endCursor: productSearchResult.recordsFiltered.toString(),
2252
- totalCount: productSearchResult.recordsFiltered
2253
- },
2254
- edges: skus.map((sku, index) => ({
2255
- node: sku,
2256
- cursor: index.toString()
2257
- }))
2258
- };
2259
- },
2260
- facets: async ({
2261
- searchArgs
2262
- }, _, ctx) => {
2263
- var _searchArgs$selectedF, _searchArgs$selectedF2;
2264
- const {
2265
- clients: {
2266
- search: is
2267
- }
2268
- } = ctx;
2269
- ctx.storage.searchArgs = searchArgs;
2270
- const {
2271
- facets = []
2272
- } = await is.facets(searchArgs);
2273
- const isCollectionPage = !searchArgs.query;
2274
- const isDepartment = (_searchArgs$selectedF = searchArgs.selectedFacets) != null && _searchArgs$selectedF.length ? searchArgs.selectedFacets[0].key === 'category-1' : false;
2275
- const isBrand = (_searchArgs$selectedF2 = searchArgs.selectedFacets) != null && _searchArgs$selectedF2.length ? searchArgs.selectedFacets[0].key === 'brand' : false;
2276
- const filteredFacets = facets
2277
- // Remove root facet on category and brand pages
2278
- // TODO: Hide category filters for category pages. E.g. /office/desks
2279
- .filter(facet => !isCollectionPage || !isRootFacet(facet, isDepartment, isBrand));
2280
- return filteredFacets;
2281
- },
2282
- metadata: async ({
2283
- searchArgs,
2284
- productSearchPromise
2285
- }) => {
2286
- var _productSearchResult$, _productSearchResult$2;
2287
- if (!searchArgs.query) {
2288
- return null;
2289
- }
2290
- const productSearchResult = await productSearchPromise;
2291
- return {
2292
- isTermMisspelled: (_productSearchResult$ = (_productSearchResult$2 = productSearchResult.correction) == null ? void 0 : _productSearchResult$2.misspelled) != null ? _productSearchResult$ : false,
2293
- logicalOperator: productSearchResult.operator
2294
- };
2295
- }
2296
- };
2297
-
2298
- const StoreSeo = {
2299
- title: ({
2300
- title
2301
- }) => title != null ? title : '',
2302
- description: ({
2303
- description
2304
- }) => description != null ? description : '',
2305
- canonical: ({
2306
- canonical
2307
- }) => canonical != null ? canonical : '',
2308
- titleTemplate: () => ''
2309
- };
2310
-
2311
- const units = ['bd', 'd', 'h', 'm'];
2312
- const isUnit = x => units.includes(x);
2313
- const localizedEstimates = {
2314
- bd: {
2315
- 0: 'Today',
2316
- 1: 'In 1 business day',
2317
- other: `Up to # business days`
2318
- },
2319
- d: {
2320
- 0: 'Today',
2321
- 1: 'In 1 day',
2322
- other: 'Up to # days'
2323
- },
2324
- h: {
2325
- 0: 'Now',
2326
- 1: 'In 1 hour',
2327
- other: 'Up to # hours'
2328
- },
2329
- m: {
2330
- 0: 'Now',
2331
- 1: 'In 1 minute',
2332
- other: 'Up to # minutes'
2333
- }
2334
- };
2335
- /**
2336
- * Transforms estimate (e.g 3bd) into friendly format (e.g Up to 3 business days)
2337
- * based on https://github.com/vtex-apps/shipping-estimate-translator/blob/13e17055d6353dd3f3f4c31bae77ab049002809b/messages/en.json
2338
- */
2339
- const getLocalizedEstimates = estimate => {
2340
- var _localizedEstimates$u;
2341
- const [amount, unit] = [estimate.split(/\D+/)[0], estimate.split(/[0-9]+/)[1]];
2342
- const isAmountNumber = amount !== '' && !Number.isNaN(Number(amount));
2343
- const isUnitValid = isUnit(unit);
2344
- if (!isAmountNumber || !isUnitValid) {
2345
- return '';
2346
- }
2347
- const amountKey = Number(amount) < 2 ? Number(amount) : 'other';
2348
- return (_localizedEstimates$u = localizedEstimates[unit][amountKey].replace('#', amount)) != null ? _localizedEstimates$u : '';
2349
- };
2350
- const ShippingSLA = {
2351
- carrier: root => {
2352
- var _ref, _root$friendlyName;
2353
- return (_ref = (_root$friendlyName = root == null ? void 0 : root.friendlyName) != null ? _root$friendlyName : root == null ? void 0 : root.name) != null ? _ref : '';
2354
- },
2355
- price: root => root != null && root.price ? root.price / 100 : root == null ? void 0 : root.price,
2356
- localizedEstimates: root => root != null && root.shippingEstimate ? getLocalizedEstimates(root.shippingEstimate) : ''
2357
- };
2358
-
2359
- function findSkuVariantImage(availableImages) {
2360
- var _availableImages$find;
2361
- return (_availableImages$find = availableImages.find(imageProperties => imageProperties.imageLabel === 'skuvariation')) != null ? _availableImages$find : availableImages[0];
2362
- }
2363
- function createSlugsMap(variants, dominantVariantName, baseSlug) {
2364
- /**
2365
- * Maps property value combinations to their respective SKU's slug. Enables
2366
- * us to retrieve the slug for the SKU that matches the currently selected
2367
- * variations in O(1) time.
2368
- *
2369
- * Example: `'Color-Red-Size-40': 'classic-shoes-37'`
2370
- */
2371
- const slugsMap = {};
2372
- variants.forEach(variant => {
2373
- var _skuSpecificationProp, _skuSpecificationProp2;
2374
- const skuSpecificationProperties = variant.variations;
2375
- if (skuSpecificationProperties.length === 0) {
2376
- return;
2377
- }
2378
- // Make sure that the 'name-value' pair for the dominant variation
2379
- // is always the first one.
2380
- const dominantNameValue = `${dominantVariantName}-${(_skuSpecificationProp = (_skuSpecificationProp2 = skuSpecificationProperties.find(variationDetails => variationDetails.name === dominantVariantName)) == null ? void 0 : _skuSpecificationProp2.values[0]) != null ? _skuSpecificationProp : ''}`;
2381
- const skuVariantKey = skuSpecificationProperties.reduce((acc, property) => {
2382
- const shouldIgnore = property.name === dominantVariantName;
2383
- if (shouldIgnore) {
2384
- return acc;
2385
- }
2386
- return acc + `-${property.name}-${property.values[0]}`;
2387
- }, dominantNameValue);
2388
- slugsMap[skuVariantKey] = `${baseSlug}-${variant.itemId}`;
2389
- });
2390
- return slugsMap;
2391
- }
2392
- function getActiveSkuVariations(variations) {
2393
- const activeVariations = {};
2394
- variations.forEach(variation => {
2395
- activeVariations[variation.name] = variation.values[0];
2396
- });
2397
- return activeVariations;
2398
- }
2399
- function getVariantsByName(skuSpecifications) {
2400
- const variants = {};
2401
- skuSpecifications == null ? void 0 : skuSpecifications.forEach(specification => {
2402
- var _specification$field$;
2403
- variants[(_specification$field$ = specification.field.originalName) != null ? _specification$field$ : specification.field.name] = specification.values.map(value => {
2404
- var _value$originalName;
2405
- return (_value$originalName = value.originalName) != null ? _value$originalName : value.name;
2406
- });
2407
- });
2408
- return variants;
2409
- }
2410
- function compare(a, b) {
2411
- // Values are always represented as Strings, so we need to handle numbers
2412
- // in this special case.
2413
- if (!Number.isNaN(Number(a) - Number(b))) {
2414
- return Number(a) - Number(b);
2415
- }
2416
- if (a < b) {
2417
- return -1;
2418
- }
2419
- if (a > b) {
2420
- return 1;
2421
- }
2422
- return 0;
2423
- }
2424
- function sortVariants(variantsByName) {
2425
- const sortedVariants = variantsByName;
2426
- for (const variantProperty in variantsByName) {
2427
- variantsByName[variantProperty].sort((a, b) => compare(a.value, b.value));
2428
- }
2429
- return sortedVariants;
2430
- }
2431
- function getFormattedVariations(variants, dominantVariantName, dominantVariantValue) {
2432
- /**
2433
- * SKU options already formatted and indexed by their property name.
2434
- *
2435
- * Ex: {
2436
- * `Size`: [
2437
- * { label: '42', value: '42' },
2438
- * { label: '41', value: '41' },
2439
- * { label: '39', value: '39' },
2440
- * ]
2441
- * }
2442
- */
2443
- const variantsByName = {};
2444
- const previouslySeenPropertyValues = new Set();
2445
- variants.forEach(variant => {
2446
- if (variant.variations.length === 0) {
2447
- return;
2448
- }
2449
- const variantImageToUse = findSkuVariantImage(variant.images);
2450
- const dominantVariantEntry = variant.variations.find(variation => variation.name === dominantVariantName);
2451
- const matchesDominantVariant = (dominantVariantEntry == null ? void 0 : dominantVariantEntry.values[0]) === dominantVariantValue;
2452
- if (!matchesDominantVariant) {
2453
- var _variantImageToUse$im;
2454
- const nameValueIdentifier = `${dominantVariantName}-${dominantVariantEntry == null ? void 0 : dominantVariantEntry.values[0]}`;
2455
- if (!dominantVariantEntry || previouslySeenPropertyValues.has(nameValueIdentifier)) {
2456
- return;
2457
- }
2458
- previouslySeenPropertyValues.add(nameValueIdentifier);
2459
- const formattedVariant = {
2460
- src: variantImageToUse.imageUrl,
2461
- alt: (_variantImageToUse$im = variantImageToUse.imageLabel) != null ? _variantImageToUse$im : '',
2462
- label: `${dominantVariantName}: ${dominantVariantEntry.values[0]}`,
2463
- value: dominantVariantEntry.values[0]
2464
- };
2465
- if (variantsByName[dominantVariantEntry.name]) {
2466
- variantsByName[dominantVariantEntry.name].push(formattedVariant);
2467
- } else {
2468
- variantsByName[dominantVariantEntry.name] = [formattedVariant];
2469
- }
2470
- return;
2471
- }
2472
- variant.variations.forEach(variationProperty => {
2473
- var _variantImageToUse$im2;
2474
- const nameValueIdentifier = `${variationProperty.name}-${variationProperty.values[0]}`;
2475
- if (previouslySeenPropertyValues.has(nameValueIdentifier)) {
2476
- return;
2477
- }
2478
- previouslySeenPropertyValues.add(nameValueIdentifier);
2479
- const formattedVariant = {
2480
- src: variantImageToUse.imageUrl,
2481
- alt: (_variantImageToUse$im2 = variantImageToUse.imageLabel) != null ? _variantImageToUse$im2 : '',
2482
- label: `${variationProperty.name}: ${variationProperty.values[0]}`,
2483
- value: variationProperty.values[0]
2484
- };
2485
- if (variantsByName[variationProperty.name]) {
2486
- variantsByName[variationProperty.name].push(formattedVariant);
2487
- } else {
2488
- variantsByName[variationProperty.name] = [formattedVariant];
2489
- }
2490
- });
2491
- });
2492
- return sortVariants(variantsByName);
2493
- }
2494
-
2495
- const SkuVariants = {
2496
- activeVariations: root => getActiveSkuVariations(root.variations),
2497
- allVariantsByName: root => getVariantsByName(root.isVariantOf.skuSpecifications),
2498
- slugsMap: (root, args) => {
2499
- var _args$dominantVariant, _root$variations$;
2500
- return createSlugsMap(root.isVariantOf.items, (_args$dominantVariant = args.dominantVariantName) != null ? _args$dominantVariant : (_root$variations$ = root.variations[0]) == null ? void 0 : _root$variations$.name, root.isVariantOf.linkText);
2501
- },
2502
- availableVariations: (root, args) => {
2503
- var _args$dominantVariant2, _root$variations$2;
2504
- const dominantVariantName = (_args$dominantVariant2 = args.dominantVariantName) != null ? _args$dominantVariant2 : (_root$variations$2 = root.variations[0]) == null ? void 0 : _root$variations$2.name;
2505
- const activeVariations = getActiveSkuVariations(root.variations);
2506
- const activeDominantVariationValue = activeVariations[dominantVariantName];
2507
- const filteredFormattedVariations = getFormattedVariations(root.isVariantOf.items, dominantVariantName, activeDominantVariationValue);
2508
- return filteredFormattedVariations;
2509
- }
2510
- };
2511
-
2512
- const Resolvers = {
2513
- StoreCollection,
2514
- StoreAggregateOffer,
2515
- StoreProduct,
2516
- StoreSeo,
2517
- StoreFacet,
2518
- StoreFacetBoolean,
2519
- StoreFacetRange,
2520
- StoreFacetValueBoolean,
2521
- StoreOffer,
2522
- StoreAggregateRating,
2523
- StoreReview,
2524
- StoreProductGroup,
2525
- StoreSearchResult,
2526
- StorePropertyValue,
2527
- SkuVariants,
2528
- ShippingSLA,
2529
- ObjectOrString,
2530
- Query,
2531
- Mutation
2532
- };
2533
- const getContextFactory = options => ctx => {
2534
- var _options$flags;
2535
- ctx.storage = {
2536
- channel: ChannelMarshal.parse(options.channel),
2537
- flags: (_options$flags = options.flags) != null ? _options$flags : {},
2538
- locale: options.locale
2539
- };
2540
- ctx.clients = getClients(options, ctx);
2541
- ctx.loaders = getLoaders(options, ctx);
2542
- return ctx;
2543
- };
2544
- const getResolvers = _ => Resolvers;
2545
-
2546
- var doc = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Address information.","block":true},"name":{"kind":"Name","value":"Address"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Address postal code","block":true},"name":{"kind":"Name","value":"postalCode"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Address city","block":true},"name":{"kind":"Name","value":"city"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Address state","block":true},"name":{"kind":"Name","value":"state"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Address country","block":true},"name":{"kind":"Name","value":"country"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Address street","block":true},"name":{"kind":"Name","value":"street"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Address number","block":true},"name":{"kind":"Name","value":"number"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Address neighborhood","block":true},"name":{"kind":"Name","value":"neighborhood"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Address complement","block":true},"name":{"kind":"Name","value":"complement"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Address reference","block":true},"name":{"kind":"Name","value":"reference"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Address geoCoordinates","block":true},"name":{"kind":"Name","value":"geoCoordinates"},"arguments":[],"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]}]}],"loc":{"start":0,"end":554}};
2547
- doc.loc.source = {"body":"\"\"\"\nAddress information.\n\"\"\"\ntype Address {\n \"\"\"\n Address postal code\n \"\"\"\n postalCode: String\n \"\"\"\n Address city\n \"\"\"\n city: String\n \"\"\"\n Address state\n \"\"\"\n state: String\n \"\"\"\n Address country\n \"\"\"\n country: String\n \"\"\"\n Address street\n \"\"\"\n street: String\n \"\"\"\n Address number\n \"\"\"\n number: String\n \"\"\"\n Address neighborhood\n \"\"\"\n neighborhood: String\n \"\"\"\n Address complement\n \"\"\"\n complement: String\n \"\"\"\n Address reference\n \"\"\"\n reference: String\n \"\"\"\n Address geoCoordinates\n \"\"\"\n geoCoordinates: [Float]\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2548
-
2549
- var doc$1 = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Aggregate offer information, for a given SKU that is available to be fulfilled by multiple sellers.","block":true},"name":{"kind":"Name","value":"StoreAggregateOffer"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Highest price among all sellers.","block":true},"name":{"kind":"Name","value":"highPrice"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Lowest price among all sellers.","block":true},"name":{"kind":"Name","value":"lowPrice"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Number of sellers selling this SKU.","block":true},"name":{"kind":"Name","value":"offerCount"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ISO code of the currency used for the offer prices.","block":true},"name":{"kind":"Name","value":"priceCurrency"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array with information on each available offer.","block":true},"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":516}};
2550
- doc$1.loc.source = {"body":"\"\"\"\nAggregate offer information, for a given SKU that is available to be fulfilled by multiple sellers.\n\"\"\"\ntype StoreAggregateOffer {\n \"\"\"\n Highest price among all sellers.\n \"\"\"\n highPrice: Float!\n \"\"\"\n Lowest price among all sellers.\n \"\"\"\n lowPrice: Float!\n \"\"\"\n Number of sellers selling this SKU.\n \"\"\"\n offerCount: Int!\n \"\"\"\n ISO code of the currency used for the offer prices.\n \"\"\"\n priceCurrency: String!\n \"\"\"\n Array with information on each available offer.\n \"\"\"\n offers: [StoreOffer!]!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2551
-
2552
- var doc$2 = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Average rating, based on multiple ratings or reviews.","block":true},"name":{"kind":"Name","value":"StoreAggregateRating"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Value of the aggregate rating.","block":true},"name":{"kind":"Name","value":"ratingValue"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Total number of ratings.","block":true},"name":{"kind":"Name","value":"reviewCount"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]}]}],"loc":{"start":0,"end":218}};
2553
- doc$2.loc.source = {"body":"\"\"\"\nAverage rating, based on multiple ratings or reviews.\n\"\"\"\ntype StoreAggregateRating {\n \"\"\"\n Value of the aggregate rating.\n \"\"\"\n ratingValue: Float!\n \"\"\"\n Total number of ratings.\n \"\"\"\n reviewCount: Int!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2554
-
2555
- var doc$3 = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"information about the author of a product review or rating.","block":true},"name":{"kind":"Name","value":"StoreAuthor"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Author name.","block":true},"name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]}],"loc":{"start":0,"end":132}};
2556
- doc$3.loc.source = {"body":"\"\"\"\ninformation about the author of a product review or rating.\n\"\"\"\ntype StoreAuthor {\n \"\"\"\n Author name.\n \"\"\"\n name: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2557
-
2558
- var doc$4 = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Brand of a given product.","block":true},"name":{"kind":"Name","value":"StoreBrand"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Brand name.","block":true},"name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]}],"loc":{"start":0,"end":96}};
2559
- doc$4.loc.source = {"body":"\"\"\"\nBrand of a given product.\n\"\"\"\ntype StoreBrand {\n \"\"\"\n Brand name.\n \"\"\"\n name: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2560
-
2561
- var doc$5 = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Item of a list.","block":true},"name":{"kind":"Name","value":"StoreListItem"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"List item value.","block":true},"name":{"kind":"Name","value":"item"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Name of the list item.","block":true},"name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Position of the item in the list.","block":true},"name":{"kind":"Name","value":"position"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"List of items consisting of chain linked web pages, ending with the current page.","block":true},"name":{"kind":"Name","value":"StoreBreadcrumbList"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array with breadcrumb elements.","block":true},"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","description":{"kind":"StringValue","value":"Number of breadcrumbs in the list.","block":true},"name":{"kind":"Name","value":"numberOfItems"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]}]}],"loc":{"start":0,"end":486}};
2562
- doc$5.loc.source = {"body":"\"\"\"\nItem of a list.\n\"\"\"\ntype StoreListItem {\n \"\"\"\n List item value.\n \"\"\"\n item: String!\n \"\"\"\n Name of the list item.\n \"\"\"\n name: String!\n \"\"\"\n Position of the item in the list.\n \"\"\"\n position: Int!\n}\n\n\"\"\"\nList of items consisting of chain linked web pages, ending with the current page.\n\"\"\"\ntype StoreBreadcrumbList {\n \"\"\"\n Array with breadcrumb elements.\n \"\"\"\n itemListElement: [StoreListItem!]!\n \"\"\"\n Number of breadcrumbs in the list.\n \"\"\"\n numberOfItems: Int!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2563
-
2564
- var doc$6 = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Shopping cart message.","block":true},"name":{"kind":"Name","value":"StoreCartMessage"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Shopping cart message text.","block":true},"name":{"kind":"Name","value":"text"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Shopping cart message status, which can be `INFO`, `WARNING` or `ERROR`.","block":true},"name":{"kind":"Name","value":"status"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreStatus"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Shopping cart information.","block":true},"name":{"kind":"Name","value":"StoreCart"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Order information, including `orderNumber` and `acceptedOffer`.","block":true},"name":{"kind":"Name","value":"order"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreOrder"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"List of shopping cart messages.","block":true},"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","description":{"kind":"StringValue","value":"Shopping cart input.","block":true},"name":{"kind":"Name","value":"IStoreCart"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Order information, including `orderNumber`, `acceptedOffer` and `shouldSplitItem`.","block":true},"name":{"kind":"Name","value":"order"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreOrder"}}},"directives":[]}]}],"loc":{"start":0,"end":628}};
2565
- doc$6.loc.source = {"body":"\"\"\"\nShopping cart message.\n\"\"\"\ntype StoreCartMessage {\n \"\"\"\n Shopping cart message text.\n \"\"\"\n text: String!\n \"\"\"\n Shopping cart message status, which can be `INFO`, `WARNING` or `ERROR`.\n \"\"\"\n status: StoreStatus!\n}\n\n\"\"\"\nShopping cart information.\n\"\"\"\ntype StoreCart {\n \"\"\"\n Order information, including `orderNumber` and `acceptedOffer`.\n \"\"\"\n order: StoreOrder!\n \"\"\"\n List of shopping cart messages.\n \"\"\"\n messages: [StoreCartMessage!]!\n}\n\n\"\"\"\nShopping cart input.\n\"\"\"\ninput IStoreCart {\n \"\"\"\n Order information, including `orderNumber`, `acceptedOffer` and `shouldSplitItem`.\n \"\"\"\n order: IStoreOrder!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2566
-
2567
- var doc$7 = {"kind":"Document","definitions":[{"kind":"EnumTypeDefinition","description":{"kind":"StringValue","value":"Product collection type. Possible values are `Department`, `Category`, `Brand`, `Cluster`, `SubCategory` or `Collection`.","block":true},"name":{"kind":"Name","value":"StoreCollectionType"},"directives":[],"values":[{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"First level of product categorization.","block":true},"name":{"kind":"Name","value":"Department"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Second level of product categorization.","block":true},"name":{"kind":"Name","value":"Category"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Third level of product categorization.","block":true},"name":{"kind":"Name","value":"SubCategory"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Product brand.","block":true},"name":{"kind":"Name","value":"Brand"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Product cluster.","block":true},"name":{"kind":"Name","value":"Cluster"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Product collection.","block":true},"name":{"kind":"Name","value":"Collection"},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Product collection facet, used for search.","block":true},"name":{"kind":"Name","value":"StoreCollectionFacet"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Facet key.","block":true},"name":{"kind":"Name","value":"key"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Facet value.","block":true},"name":{"kind":"Name","value":"value"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Collection meta information. Used for search.","block":true},"name":{"kind":"Name","value":"StoreCollectionMeta"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"List of selected collection facets.","block":true},"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","description":{"kind":"StringValue","value":"Product collection information.","block":true},"name":{"kind":"Name","value":"StoreCollection"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Meta tag data.","block":true},"name":{"kind":"Name","value":"seo"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreSeo"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"List of items consisting of chain linked web pages, ending with the current page.","block":true},"name":{"kind":"Name","value":"breadcrumbList"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreBreadcrumbList"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Collection meta information. Used for search.","block":true},"name":{"kind":"Name","value":"meta"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreCollectionMeta"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Collection ID.","block":true},"name":{"kind":"Name","value":"id"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Corresponding collection URL slug, with which to retrieve this entity.","block":true},"name":{"kind":"Name","value":"slug"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Collection type.","block":true},"name":{"kind":"Name","value":"type"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreCollectionType"}}},"directives":[]}]}],"loc":{"start":0,"end":1361}};
2568
- doc$7.loc.source = {"body":"\"\"\"\nProduct collection type. Possible values are `Department`, `Category`, `Brand`, `Cluster`, `SubCategory` or `Collection`.\n\"\"\"\nenum StoreCollectionType {\n \"\"\"\n First level of product categorization.\n \"\"\"\n Department\n \"\"\"\n Second level of product categorization.\n \"\"\"\n Category\n \"\"\"\n Third level of product categorization.\n \"\"\"\n SubCategory\n \"\"\"\n Product brand.\n \"\"\"\n Brand\n \"\"\"\n Product cluster.\n \"\"\"\n Cluster\n \"\"\"\n Product collection.\n \"\"\"\n Collection\n}\n\n\"\"\"\nProduct collection facet, used for search.\n\"\"\"\ntype StoreCollectionFacet {\n \"\"\"\n Facet key.\n \"\"\"\n key: String!\n \"\"\"\n Facet value.\n \"\"\"\n value: String!\n}\n\n\"\"\"\nCollection meta information. Used for search.\n\"\"\"\ntype StoreCollectionMeta {\n \"\"\"\n List of selected collection facets.\n \"\"\"\n selectedFacets: [StoreCollectionFacet!]!\n}\n\n\"\"\"\nProduct collection information.\n\"\"\"\ntype StoreCollection {\n \"\"\"\n Meta tag data.\n \"\"\"\n seo: StoreSeo!\n \"\"\"\n List of items consisting of chain linked web pages, ending with the current page.\n \"\"\"\n breadcrumbList: StoreBreadcrumbList!\n \"\"\"\n Collection meta information. Used for search.\n \"\"\"\n meta: StoreCollectionMeta!\n \"\"\"\n Collection ID.\n \"\"\"\n id: ID!\n \"\"\"\n Corresponding collection URL slug, with which to retrieve this entity.\n \"\"\"\n slug: String!\n \"\"\"\n Collection type.\n \"\"\"\n type: StoreCollectionType!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2569
-
2570
- var doc$8 = {"kind":"Document","definitions":[{"kind":"UnionTypeDefinition","name":{"kind":"Name","value":"StoreFacet"},"directives":[],"types":[{"kind":"NamedType","name":{"kind":"Name","value":"StoreFacetRange"}},{"kind":"NamedType","name":{"kind":"Name","value":"StoreFacetBoolean"}}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Search facet range information.","block":true},"name":{"kind":"Name","value":"StoreFacetRange"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Facet key.","block":true},"name":{"kind":"Name","value":"key"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Facet label.","block":true},"name":{"kind":"Name","value":"label"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Minimum facet range value.","block":true},"name":{"kind":"Name","value":"min"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreFacetValueRange"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Maximum facet range value.","block":true},"name":{"kind":"Name","value":"max"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreFacetValueRange"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Search facet boolean information.","block":true},"name":{"kind":"Name","value":"StoreFacetBoolean"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Facet key.","block":true},"name":{"kind":"Name","value":"key"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Facet label.","block":true},"name":{"kind":"Name","value":"label"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array with information on each facet value.","block":true},"name":{"kind":"Name","value":"values"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreFacetValueBoolean"}}}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Search facet range value information. Used for minimum and maximum range values.","block":true},"name":{"kind":"Name","value":"StoreFacetValueRange"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Search facet range absolute value.","block":true},"name":{"kind":"Name","value":"absolute"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Search facet range selected value.","block":true},"name":{"kind":"Name","value":"selected"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Information of a specific facet value.","block":true},"name":{"kind":"Name","value":"StoreFacetValueBoolean"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Facet value.","block":true},"name":{"kind":"Name","value":"value"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Facet value label.","block":true},"name":{"kind":"Name","value":"label"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Indicates whether facet is selected.","block":true},"name":{"kind":"Name","value":"selected"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Number of items with this facet.","block":true},"name":{"kind":"Name","value":"quantity"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]}]}],"loc":{"start":0,"end":1160}};
2571
- doc$8.loc.source = {"body":"union StoreFacet = StoreFacetRange | StoreFacetBoolean\n\n\"\"\"\nSearch facet range information.\n\"\"\"\ntype StoreFacetRange {\n \"\"\"\n Facet key.\n \"\"\"\n key: String!\n \"\"\"\n Facet label.\n \"\"\"\n label: String!\n \"\"\"\n Minimum facet range value.\n \"\"\"\n min: StoreFacetValueRange!\n \"\"\"\n Maximum facet range value.\n \"\"\"\n max: StoreFacetValueRange!\n}\n\n\"\"\"\nSearch facet boolean information.\n\"\"\"\ntype StoreFacetBoolean {\n \"\"\"\n Facet key.\n \"\"\"\n key: String!\n \"\"\"\n Facet label.\n \"\"\"\n label: String!\n \"\"\"\n Array with information on each facet value.\n \"\"\"\n values: [StoreFacetValueBoolean!]!\n}\n\n\"\"\"\nSearch facet range value information. Used for minimum and maximum range values.\n\"\"\"\ntype StoreFacetValueRange {\n \"\"\"\n Search facet range absolute value.\n \"\"\"\n absolute: Float!\n \"\"\"\n Search facet range selected value.\n \"\"\"\n selected: Float!\n}\n\n\"\"\"\nInformation of a specific facet value.\n\"\"\"\ntype StoreFacetValueBoolean {\n \"\"\"\n Facet value.\n \"\"\"\n value: String!\n \"\"\"\n Facet value label.\n \"\"\"\n label: String!\n \"\"\"\n Indicates whether facet is selected.\n \"\"\"\n selected: Boolean!\n \"\"\"\n Number of items with this facet.\n \"\"\"\n quantity: Int!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2572
-
2573
- var doc$9 = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Image.","block":true},"name":{"kind":"Name","value":"StoreImage"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Image URL.","block":true},"name":{"kind":"Name","value":"url"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Alias for the image.","block":true},"name":{"kind":"Name","value":"alternateName"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","description":{"kind":"StringValue","value":"Image input.","block":true},"name":{"kind":"Name","value":"IStoreImage"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Image input URL.","block":true},"name":{"kind":"Name","value":"url"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Alias for the input image.","block":true},"name":{"kind":"Name","value":"alternateName"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]}],"loc":{"start":0,"end":291}};
2574
- doc$9.loc.source = {"body":"\"\"\"\nImage.\n\"\"\"\ntype StoreImage {\n \"\"\"\n Image URL.\n \"\"\"\n url: String!\n \"\"\"\n Alias for the image.\n \"\"\"\n alternateName: String!\n}\n\n\"\"\"\nImage input.\n\"\"\"\ninput IStoreImage {\n \"\"\"\n Image input URL.\n \"\"\"\n url: String!\n \"\"\"\n Alias for the input image.\n \"\"\"\n alternateName: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2575
-
2576
- var doc$a = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"Mutation"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Checks for changes between the cart presented in the UI and the cart stored in the ecommerce platform. If changes are detected, it returns the cart stored on the platform. Otherwise, it returns `null`.","block":true},"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":[]},{"kind":"InputValueDefinition","name":{"kind":"Name","value":"session"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreSession"}},"directives":[]}],"type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreCart"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Updates a web session with the specified values.","block":true},"name":{"kind":"Name","value":"validateSession"},"arguments":[{"kind":"InputValueDefinition","name":{"kind":"Name","value":"session"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreSession"}}},"directives":[]},{"kind":"InputValueDefinition","name":{"kind":"Name","value":"search"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}],"type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreSession"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Subscribes a new person to the newsletter list.","block":true},"name":{"kind":"Name","value":"subscribeToNewsletter"},"arguments":[{"kind":"InputValueDefinition","name":{"kind":"Name","value":"data"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IPersonNewsletter"}}},"directives":[]}],"type":{"kind":"NamedType","name":{"kind":"Name","value":"PersonNewsletter"}},"directives":[]}]}],"loc":{"start":0,"end":570}};
2577
- doc$a.loc.source = {"body":"type Mutation {\n \"\"\"\n Checks for changes between the cart presented in the UI and the cart stored in the ecommerce platform. If changes are detected, it returns the cart stored on the platform. Otherwise, it returns `null`.\n \"\"\"\n validateCart(cart: IStoreCart!, session: IStoreSession): StoreCart\n \"\"\"\n Updates a web session with the specified values.\n \"\"\"\n validateSession(session: IStoreSession!, search: String!): StoreSession\n \"\"\"\n Subscribes a new person to the newsletter list.\n \"\"\"\n subscribeToNewsletter(data: IPersonNewsletter!): PersonNewsletter\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2578
-
2579
- var doc$b = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Newsletter information.","block":true},"name":{"kind":"Name","value":"PersonNewsletter"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Person's ID in the newsletter list.","block":true},"name":{"kind":"Name","value":"id"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","description":{"kind":"StringValue","value":"Person data input to the newsletter.","block":true},"name":{"kind":"Name","value":"IPersonNewsletter"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Person's name.","block":true},"name":{"kind":"Name","value":"name"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Person's email.","block":true},"name":{"kind":"Name","value":"email"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]}],"loc":{"start":0,"end":289}};
2580
- doc$b.loc.source = {"body":"\"\"\"\nNewsletter information.\n\"\"\"\n\ntype PersonNewsletter {\n \"\"\"\n Person's ID in the newsletter list.\n \"\"\"\n id: String!\n}\n\n\"\"\"\nPerson data input to the newsletter.\n\"\"\"\ninput IPersonNewsletter {\n \"\"\"\n Person's name.\n \"\"\"\n name: String!\n \"\"\"\n Person's email.\n \"\"\"\n email: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2581
-
2582
- var doc$c = {"kind":"Document","definitions":[{"kind":"ScalarTypeDefinition","name":{"kind":"Name","value":"ObjectOrString"},"directives":[]}],"loc":{"start":0,"end":21}};
2583
- doc$c.loc.source = {"body":"scalar ObjectOrString","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2584
-
2585
- var doc$d = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Offer information.","block":true},"name":{"kind":"Name","value":"StoreOffer"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"This is displayed as the \"from\" price in the context of promotions' price comparison. This may change before it reaches the shelf.","block":true},"name":{"kind":"Name","value":"listPrice"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Computed price before applying coupons, taxes or benefits. This may change before it reaches the shelf.","block":true},"name":{"kind":"Name","value":"sellingPrice"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ISO code of the currency used for the offer prices.","block":true},"name":{"kind":"Name","value":"priceCurrency"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Also known as spot price.","block":true},"name":{"kind":"Name","value":"price"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Next date in which price is scheduled to change. If there is no scheduled change, this will be set a year in the future from current time.","block":true},"name":{"kind":"Name","value":"priceValidUntil"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Offer item condition.","block":true},"name":{"kind":"Name","value":"itemCondition"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Offer item availability.","block":true},"name":{"kind":"Name","value":"availability"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Seller responsible for the offer.","block":true},"name":{"kind":"Name","value":"seller"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreOrganization"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Information on the item being offered.","block":true},"name":{"kind":"Name","value":"itemOffered"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProduct"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Number of items offered.","block":true},"name":{"kind":"Name","value":"quantity"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","description":{"kind":"StringValue","value":"Offer input.","block":true},"name":{"kind":"Name","value":"IStoreOffer"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Also known as spot price.","block":true},"name":{"kind":"Name","value":"price"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"This is displayed as the \"from\" price in the context of promotions' price comparison. This may change before it reaches the shelf.","block":true},"name":{"kind":"Name","value":"listPrice"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Seller responsible for the offer.","block":true},"name":{"kind":"Name","value":"seller"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreOrganization"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Information on the item being offered.","block":true},"name":{"kind":"Name","value":"itemOffered"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreProduct"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Number of items offered.","block":true},"name":{"kind":"Name","value":"quantity"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]}]}],"loc":{"start":0,"end":1501}};
2586
- doc$d.loc.source = {"body":"\"\"\"\nOffer information.\n\"\"\"\ntype StoreOffer {\n \"\"\"\n This is displayed as the \"from\" price in the context of promotions' price comparison. This may change before it reaches the shelf.\n \"\"\"\n listPrice: Float!\n \"\"\"\n Computed price before applying coupons, taxes or benefits. This may change before it reaches the shelf.\n \"\"\"\n sellingPrice: Float!\n \"\"\"\n ISO code of the currency used for the offer prices.\n \"\"\"\n priceCurrency: String!\n \"\"\"\n Also known as spot price.\n \"\"\"\n price: Float!\n \"\"\"\n Next date in which price is scheduled to change. If there is no scheduled change, this will be set a year in the future from current time.\n \"\"\"\n priceValidUntil: String!\n \"\"\"\n Offer item condition.\n \"\"\"\n itemCondition: String!\n \"\"\"\n Offer item availability.\n \"\"\"\n availability: String!\n \"\"\"\n Seller responsible for the offer.\n \"\"\"\n seller: StoreOrganization!\n \"\"\"\n Information on the item being offered.\n \"\"\"\n itemOffered: StoreProduct!\n \"\"\"\n Number of items offered.\n \"\"\"\n quantity: Int!\n}\n\n\"\"\"\nOffer input.\n\"\"\"\ninput IStoreOffer {\n \"\"\"\n Also known as spot price.\n \"\"\"\n price: Float!\n \"\"\"\n This is displayed as the \"from\" price in the context of promotions' price comparison. This may change before it reaches the shelf.\n \"\"\"\n listPrice: Float!\n \"\"\"\n Seller responsible for the offer.\n \"\"\"\n seller: IStoreOrganization!\n \"\"\"\n Information on the item being offered.\n \"\"\"\n itemOffered: IStoreProduct!\n \"\"\"\n Number of items offered.\n \"\"\"\n quantity: Int!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2587
-
2588
- var doc$e = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Information of a specific order.","block":true},"name":{"kind":"Name","value":"StoreOrder"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#).","block":true},"name":{"kind":"Name","value":"orderNumber"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array with information on each accepted offer.","block":true},"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","description":{"kind":"StringValue","value":"Order input.","block":true},"name":{"kind":"Name","value":"IStoreOrder"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#).","block":true},"name":{"kind":"Name","value":"orderNumber"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Array with information on each accepted offer.","block":true},"name":{"kind":"Name","value":"acceptedOffer"},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreOffer"}}}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Indicates whether or not items with attachments should be split.","block":true},"name":{"kind":"Name","value":"shouldSplitItem"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}},"directives":[]}]}],"loc":{"start":0,"end":740}};
2589
- doc$e.loc.source = {"body":"\"\"\"\nInformation of a specific order.\n\"\"\"\ntype StoreOrder {\n \"\"\"\n ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#).\n \"\"\"\n orderNumber: String!\n \"\"\"\n Array with information on each accepted offer.\n \"\"\"\n acceptedOffer: [StoreOffer!]!\n}\n\n\"\"\"\nOrder input.\n\"\"\"\ninput IStoreOrder {\n \"\"\"\n ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#).\n \"\"\"\n orderNumber: String!\n \"\"\"\n Array with information on each accepted offer.\n \"\"\"\n acceptedOffer: [IStoreOffer!]!\n \"\"\"\n Indicates whether or not items with attachments should be split.\n \"\"\"\n shouldSplitItem: Boolean\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2590
-
2591
- var doc$f = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Organization.","block":true},"name":{"kind":"Name","value":"StoreOrganization"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Organization ID.","block":true},"name":{"kind":"Name","value":"identifier"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","description":{"kind":"StringValue","value":"Organization input.","block":true},"name":{"kind":"Name","value":"IStoreOrganization"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Organization ID.","block":true},"name":{"kind":"Name","value":"identifier"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]}],"loc":{"start":0,"end":213}};
2592
- doc$f.loc.source = {"body":"\"\"\"\nOrganization.\n\"\"\"\ntype StoreOrganization {\n \"\"\"\n Organization ID.\n \"\"\"\n identifier: String!\n}\n\n\"\"\"\nOrganization input.\n\"\"\"\ninput IStoreOrganization {\n \"\"\"\n Organization ID.\n \"\"\"\n identifier: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2593
-
2594
- var doc$g = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Whenever you make a query that allows for pagination, such as `allProducts` or `allCollections`, you can check `StorePageInfo` to learn more about the complete set of items and use it to paginate your queries.","block":true},"name":{"kind":"Name","value":"StorePageInfo"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Indicates whether there is at least one more page with items after the ones returned in the current query.","block":true},"name":{"kind":"Name","value":"hasNextPage"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Indicates whether there is at least one more page with items before the ones returned in the current query.","block":true},"name":{"kind":"Name","value":"hasPreviousPage"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Cursor corresponding to the first possible item.","block":true},"name":{"kind":"Name","value":"startCursor"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Cursor corresponding to the last possible item.","block":true},"name":{"kind":"Name","value":"endCursor"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Total number of items (products or collections), not pages.","block":true},"name":{"kind":"Name","value":"totalCount"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]}]}],"loc":{"start":0,"end":798}};
2595
- doc$g.loc.source = {"body":"\"\"\"\nWhenever you make a query that allows for pagination, such as `allProducts` or `allCollections`, you can check `StorePageInfo` to learn more about the complete set of items and use it to paginate your queries.\n\"\"\"\ntype StorePageInfo {\n \"\"\"\n Indicates whether there is at least one more page with items after the ones returned in the current query.\n \"\"\"\n hasNextPage: Boolean!\n \"\"\"\n Indicates whether there is at least one more page with items before the ones returned in the current query.\n \"\"\"\n hasPreviousPage: Boolean!\n \"\"\"\n Cursor corresponding to the first possible item.\n \"\"\"\n startCursor: String!\n \"\"\"\n Cursor corresponding to the last possible item.\n \"\"\"\n endCursor: String!\n \"\"\"\n Total number of items (products or collections), not pages.\n \"\"\"\n totalCount: Int!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2596
-
2597
- var doc$h = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Client profile data.","block":true},"name":{"kind":"Name","value":"StorePerson"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Client ID.","block":true},"name":{"kind":"Name","value":"id"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Client email.","block":true},"name":{"kind":"Name","value":"email"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Client first name.","block":true},"name":{"kind":"Name","value":"givenName"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Client last name.","block":true},"name":{"kind":"Name","value":"familyName"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","description":{"kind":"StringValue","value":"Client profile data.","block":true},"name":{"kind":"Name","value":"IStorePerson"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Client ID.","block":true},"name":{"kind":"Name","value":"id"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Client email.","block":true},"name":{"kind":"Name","value":"email"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Client first name.","block":true},"name":{"kind":"Name","value":"givenName"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Client last name.","block":true},"name":{"kind":"Name","value":"familyName"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]}],"loc":{"start":0,"end":487}};
2598
- doc$h.loc.source = {"body":"\"\"\"\nClient profile data.\n\"\"\"\ntype StorePerson {\n \"\"\"\n Client ID.\n \"\"\"\n id: String!\n \"\"\"\n Client email.\n \"\"\"\n email: String!\n \"\"\"\n Client first name.\n \"\"\"\n givenName: String!\n \"\"\"\n Client last name.\n \"\"\"\n familyName: String!\n}\n\n\"\"\"\nClient profile data.\n\"\"\"\ninput IStorePerson {\n \"\"\"\n Client ID.\n \"\"\"\n id: String!\n \"\"\"\n Client email.\n \"\"\"\n email: String!\n \"\"\"\n Client first name.\n \"\"\"\n givenName: String!\n \"\"\"\n Client last name.\n \"\"\"\n familyName: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2599
-
2600
- var doc$i = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Product information. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.","block":true},"name":{"kind":"Name","value":"StoreProduct"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Meta tag data.","block":true},"name":{"kind":"Name","value":"seo"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreSeo"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"List of items consisting of chain linked web pages, ending with the current page.","block":true},"name":{"kind":"Name","value":"breadcrumbList"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreBreadcrumbList"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Corresponding collection URL slug, with which to retrieve this entity.","block":true},"name":{"kind":"Name","value":"slug"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product name.","block":true},"name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product ID, such as [ISBN](https://www.isbn-international.org/content/what-isbn) or similar global IDs.","block":true},"name":{"kind":"Name","value":"productID"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product brand.","block":true},"name":{"kind":"Name","value":"brand"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreBrand"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product description.","block":true},"name":{"kind":"Name","value":"description"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array of images.","block":true},"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","description":{"kind":"StringValue","value":"Aggregate offer information.","block":true},"name":{"kind":"Name","value":"offers"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreAggregateOffer"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Stock Keeping Unit. Merchant-specific ID for the product.","block":true},"name":{"kind":"Name","value":"sku"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Global Trade Item Number.","block":true},"name":{"kind":"Name","value":"gtin"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array with review information.","block":true},"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","description":{"kind":"StringValue","value":"Aggregate ratings data.","block":true},"name":{"kind":"Name","value":"aggregateRating"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreAggregateRating"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Indicates product group related to this product.","block":true},"name":{"kind":"Name","value":"isVariantOf"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProductGroup"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array of additional properties.","block":true},"name":{"kind":"Name","value":"additionalProperty"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StorePropertyValue"}}}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"The product's release date. Formatted using https://en.wikipedia.org/wiki/ISO_8601","block":true},"name":{"kind":"Name","value":"releaseDate"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","description":{"kind":"StringValue","value":"Product input. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.","block":true},"name":{"kind":"Name","value":"IStoreProduct"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Stock Keeping Unit. Merchant-specific ID for the product.","block":true},"name":{"kind":"Name","value":"sku"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Product name.","block":true},"name":{"kind":"Name","value":"name"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Array of product images.","block":true},"name":{"kind":"Name","value":"image"},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreImage"}}}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Custom Product Additional Properties.","block":true},"name":{"kind":"Name","value":"additionalProperty"},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStorePropertyValue"}}}},"directives":[]}]}],"loc":{"start":0,"end":2274}};
2601
- doc$i.loc.source = {"body":"\"\"\"\nProduct information. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.\n\"\"\"\ntype StoreProduct {\n \"\"\"\n Meta tag data.\n \"\"\"\n seo: StoreSeo!\n \"\"\"\n List of items consisting of chain linked web pages, ending with the current page.\n \"\"\"\n breadcrumbList: StoreBreadcrumbList!\n \"\"\"\n Corresponding collection URL slug, with which to retrieve this entity.\n \"\"\"\n slug: String!\n \"\"\"\n Product name.\n \"\"\"\n name: String!\n \"\"\"\n Product ID, such as [ISBN](https://www.isbn-international.org/content/what-isbn) or similar global IDs.\n \"\"\"\n productID: String!\n \"\"\"\n Product brand.\n \"\"\"\n brand: StoreBrand!\n \"\"\"\n Product description.\n \"\"\"\n description: String!\n \"\"\"\n Array of images.\n \"\"\"\n image: [StoreImage!]!\n \"\"\"\n Aggregate offer information.\n \"\"\"\n offers: StoreAggregateOffer!\n \"\"\"\n Stock Keeping Unit. Merchant-specific ID for the product.\n \"\"\"\n sku: String!\n \"\"\"\n Global Trade Item Number.\n \"\"\"\n gtin: String!\n \"\"\"\n Array with review information.\n \"\"\"\n review: [StoreReview!]!\n \"\"\"\n Aggregate ratings data.\n \"\"\"\n aggregateRating: StoreAggregateRating!\n \"\"\"\n Indicates product group related to this product.\n \"\"\"\n isVariantOf: StoreProductGroup!\n \"\"\"\n Array of additional properties.\n \"\"\"\n additionalProperty: [StorePropertyValue!]!\n \"\"\"\n The product's release date. Formatted using https://en.wikipedia.org/wiki/ISO_8601\n \"\"\"\n releaseDate: String!\n}\n\n\"\"\"\nProduct input. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.\n\"\"\"\ninput IStoreProduct {\n \"\"\"\n Stock Keeping Unit. Merchant-specific ID for the product.\n \"\"\"\n sku: String!\n \"\"\"\n Product name.\n \"\"\"\n name: String!\n \"\"\"\n Array of product images.\n \"\"\"\n image: [IStoreImage!]!\n \"\"\"\n Custom Product Additional Properties.\n \"\"\"\n additionalProperty: [IStorePropertyValue!]\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2602
-
2603
- var doc$j = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Product group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.","block":true},"name":{"kind":"Name","value":"StoreProductGroup"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array of variants related to product group. Variants are equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#).","block":true},"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","description":{"kind":"StringValue","value":"Product group ID.","block":true},"name":{"kind":"Name","value":"productGroupID"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product group name.","block":true},"name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array of additional properties.","block":true},"name":{"kind":"Name","value":"additionalProperty"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StorePropertyValue"}}}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Object containing data structures to facilitate handling different SKU\nvariant properties. Specially useful for implementing SKU selection \ncomponents.","block":true},"name":{"kind":"Name","value":"skuVariants"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"SkuVariants"}},"directives":[]}]}],"loc":{"start":0,"end":1113}};
2604
- doc$j.loc.source = {"body":"\"\"\"\nProduct group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.\n\"\"\"\ntype StoreProductGroup {\n \"\"\"\n Array of variants related to product group. Variants are equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#).\n \"\"\"\n hasVariant: [StoreProduct!]!\n \"\"\"\n Product group ID.\n \"\"\"\n productGroupID: String!\n \"\"\"\n Product group name.\n \"\"\"\n name: String!\n \"\"\"\n Array of additional properties.\n \"\"\"\n additionalProperty: [StorePropertyValue!]!\n \"\"\"\n Object containing data structures to facilitate handling different SKU\n variant properties. Specially useful for implementing SKU selection \n components.\n \"\"\"\n skuVariants: SkuVariants\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2605
-
2606
- var doc$k = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Properties that can be associated with products and products groups.","block":true},"name":{"kind":"Name","value":"StorePropertyValue"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Property id. This propert changes according to the content of the object.","block":true},"name":{"kind":"Name","value":"propertyID"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Property value. May hold a string or the string representation of an object.","block":true},"name":{"kind":"Name","value":"value"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectOrString"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Property name.","block":true},"name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Specifies the nature of the value","block":true},"name":{"kind":"Name","value":"valueReference"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","name":{"kind":"Name","value":"IStorePropertyValue"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Property id. This propert changes according to the content of the object.","block":true},"name":{"kind":"Name","value":"propertyID"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Property value. May hold a string or the string representation of an object.","block":true},"name":{"kind":"Name","value":"value"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectOrString"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Property name.","block":true},"name":{"kind":"Name","value":"name"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Specifies the nature of the value","block":true},"name":{"kind":"Name","value":"valueReference"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]}],"loc":{"start":0,"end":825}};
2607
- doc$k.loc.source = {"body":"\"\"\"\nProperties that can be associated with products and products groups.\n\"\"\"\ntype StorePropertyValue {\n \"\"\"\n Property id. This propert changes according to the content of the object.\n \"\"\"\n propertyID: String!\n \"\"\"\n Property value. May hold a string or the string representation of an object.\n \"\"\"\n value: ObjectOrString!\n \"\"\"\n Property name.\n \"\"\"\n name: String!\n \"\"\"\n Specifies the nature of the value\n \"\"\"\n valueReference: String!\n}\n\ninput IStorePropertyValue {\n \"\"\"\n Property id. This propert changes according to the content of the object.\n \"\"\"\n propertyID: String\n \"\"\"\n Property value. May hold a string or the string representation of an object.\n \"\"\"\n value: ObjectOrString!\n \"\"\"\n Property name.\n \"\"\"\n name: String!\n \"\"\"\n Specifies the nature of the value\n \"\"\"\n valueReference: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2608
-
2609
- var doc$l = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Each product edge contains a `node`, with product information, and a `cursor`, that can be used as a reference for pagination.","block":true},"name":{"kind":"Name","value":"StoreProductEdge"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Each product node contains the information of a product returned by the query.","block":true},"name":{"kind":"Name","value":"node"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProduct"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product cursor. Used as pagination reference.","block":true},"name":{"kind":"Name","value":"cursor"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Product connections, including pagination information and products returned by the query.","block":true},"name":{"kind":"Name","value":"StoreProductConnection"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Product pagination information.","block":true},"name":{"kind":"Name","value":"pageInfo"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StorePageInfo"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array with product connection edges, each containing a product and a corresponding cursor.","block":true},"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","description":{"kind":"StringValue","value":"Each collection edge contains a `node`, with product collection information, and a `cursor`, that can be used as a reference for pagination.","block":true},"name":{"kind":"Name","value":"StoreCollectionEdge"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Each collection node contains the information of a product collection returned by the query.","block":true},"name":{"kind":"Name","value":"node"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreCollection"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Collection cursor. Used as pagination reference.","block":true},"name":{"kind":"Name","value":"cursor"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Collection connections, including pagination information and collections returned by the query.","block":true},"name":{"kind":"Name","value":"StoreCollectionConnection"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Collection pagination information.","block":true},"name":{"kind":"Name","value":"pageInfo"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StorePageInfo"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array with collection connection page edges, each containing a collection and a corresponding cursor..","block":true},"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","description":{"kind":"StringValue","value":"Product search results sorting options.","block":true},"name":{"kind":"Name","value":"StoreSort"},"directives":[],"values":[{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by price, from highest to lowest.","block":true},"name":{"kind":"Name","value":"price_desc"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by price, from lowest to highest.","block":true},"name":{"kind":"Name","value":"price_asc"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by orders, from highest to lowest.","block":true},"name":{"kind":"Name","value":"orders_desc"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by name, in reverse alphabetical order.","block":true},"name":{"kind":"Name","value":"name_desc"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by name, in alphabetical order.","block":true},"name":{"kind":"Name","value":"name_asc"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by release date, from highest to lowest.","block":true},"name":{"kind":"Name","value":"release_desc"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by discount value, from highest to lowest.","block":true},"name":{"kind":"Name","value":"discount_desc"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Sort by product score, from highest to lowest.","block":true},"name":{"kind":"Name","value":"score_desc"},"directives":[]}]},{"kind":"InputObjectTypeDefinition","description":{"kind":"StringValue","value":"Selected search facet input.","block":true},"name":{"kind":"Name","value":"IStoreSelectedFacet"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Selected search facet key.","block":true},"name":{"kind":"Name","value":"key"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Selected search facet value.","block":true},"name":{"kind":"Name","value":"value"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"EnumTypeDefinition","description":{"kind":"StringValue","value":"Search facet type.","block":true},"name":{"kind":"Name","value":"StoreFacetType"},"directives":[],"values":[{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Indicates boolean search facet.","block":true},"name":{"kind":"Name","value":"BOOLEAN"},"directives":[]},{"kind":"EnumValueDefinition","description":{"kind":"StringValue","value":"Indicates range type search facet.","block":true},"name":{"kind":"Name","value":"RANGE"},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Suggestion term.","block":true},"name":{"kind":"Name","value":"StoreSuggestionTerm"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"The term.","block":true},"name":{"kind":"Name","value":"value"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Its occurrences count.","block":true},"name":{"kind":"Name","value":"count"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Suggestions information.","block":true},"name":{"kind":"Name","value":"StoreSuggestions"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array with suggestion terms.","block":true},"name":{"kind":"Name","value":"terms"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreSuggestionTerm"}}}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array with suggestion products' information.","block":true},"name":{"kind":"Name","value":"products"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProduct"}}}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Search result.","block":true},"name":{"kind":"Name","value":"SearchMetadata"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Indicates if the search term was misspelled.","block":true},"name":{"kind":"Name","value":"isTermMisspelled"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Logical operator used to run the search.","block":true},"name":{"kind":"Name","value":"logicalOperator"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Search result.","block":true},"name":{"kind":"Name","value":"StoreSearchResult"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Search result products.","block":true},"name":{"kind":"Name","value":"products"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreProductConnection"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Array of search result facets.","block":true},"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":"FieldDefinition","description":{"kind":"StringValue","value":"Search result suggestions.","block":true},"name":{"kind":"Name","value":"suggestions"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreSuggestions"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Search result metadata. Additional data can be used to send analytics events.","block":true},"name":{"kind":"Name","value":"metadata"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"SearchMetadata"}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","name":{"kind":"Name","value":"IGeoCoordinates"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"The latitude of the geographic coordinates.","block":true},"name":{"kind":"Name","value":"latitude"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"The longitude of the geographic coordinates.","block":true},"name":{"kind":"Name","value":"longitude"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"Query"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Returns the details of a product based on the specified locator.","block":true},"name":{"kind":"Name","value":"product"},"arguments":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"An array of selected search facets.","block":true},"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":"Directive","name":{"kind":"Name","value":"cacheControl"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"scope"},"value":{"kind":"StringValue","value":"public","block":false}},{"kind":"Argument","name":{"kind":"Name","value":"sMaxAge"},"value":{"kind":"IntValue","value":"120"}},{"kind":"Argument","name":{"kind":"Name","value":"staleWhileRevalidate"},"value":{"kind":"IntValue","value":"3600"}}]}]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Returns the details of a collection based on the collection slug.","block":true},"name":{"kind":"Name","value":"collection"},"arguments":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Collection slug.","block":true},"name":{"kind":"Name","value":"slug"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreCollection"}}},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheControl"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"scope"},"value":{"kind":"StringValue","value":"public","block":false}},{"kind":"Argument","name":{"kind":"Name","value":"sMaxAge"},"value":{"kind":"IntValue","value":"120"}},{"kind":"Argument","name":{"kind":"Name","value":"staleWhileRevalidate"},"value":{"kind":"IntValue","value":"3600"}}]}]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Returns the result of a product, facet, or suggestion search.","block":true},"name":{"kind":"Name","value":"search"},"arguments":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Search pagination argument, indicating how many results should be returned from the complete result list.","block":true},"name":{"kind":"Name","value":"first"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Search pagination argument, indicating the cursor corresponding with the item after which the results should be fetched.","block":true},"name":{"kind":"Name","value":"after"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Search results sorting mode.","block":true},"name":{"kind":"Name","value":"sort"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreSort"}},"defaultValue":{"kind":"EnumValue","value":"score_desc"},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Search term.","block":true},"name":{"kind":"Name","value":"term"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"defaultValue":{"kind":"StringValue","value":"","block":false},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Array of selected search facets.","block":true},"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":"Directive","name":{"kind":"Name","value":"cacheControl"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"scope"},"value":{"kind":"StringValue","value":"public","block":false}},{"kind":"Argument","name":{"kind":"Name","value":"sMaxAge"},"value":{"kind":"IntValue","value":"120"}},{"kind":"Argument","name":{"kind":"Name","value":"staleWhileRevalidate"},"value":{"kind":"IntValue","value":"3600"}}]}]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Returns information about all products.","block":true},"name":{"kind":"Name","value":"allProducts"},"arguments":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Product pagination argument, indicating how many items should be returned from the complete result list.","block":true},"name":{"kind":"Name","value":"first"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Product pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.","block":true},"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":"Directive","name":{"kind":"Name","value":"cacheControl"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"scope"},"value":{"kind":"StringValue","value":"public","block":false}},{"kind":"Argument","name":{"kind":"Name","value":"sMaxAge"},"value":{"kind":"IntValue","value":"120"}},{"kind":"Argument","name":{"kind":"Name","value":"staleWhileRevalidate"},"value":{"kind":"IntValue","value":"3600"}}]}]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Returns information about all collections.","block":true},"name":{"kind":"Name","value":"allCollections"},"arguments":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Collection pagination argument, indicating how many items should be returned from the complete result list.","block":true},"name":{"kind":"Name","value":"first"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Collection pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.","block":true},"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":[{"kind":"Directive","name":{"kind":"Name","value":"cacheControl"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"scope"},"value":{"kind":"StringValue","value":"public","block":false}},{"kind":"Argument","name":{"kind":"Name","value":"sMaxAge"},"value":{"kind":"IntValue","value":"120"}},{"kind":"Argument","name":{"kind":"Name","value":"staleWhileRevalidate"},"value":{"kind":"IntValue","value":"3600"}}]}]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Returns information about shipping simulation.","block":true},"name":{"kind":"Name","value":"shipping"},"arguments":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"List of SKU products","block":true},"name":{"kind":"Name","value":"items"},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IShippingItem"}}}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Postal code to freight calculator","block":true},"name":{"kind":"Name","value":"postalCode"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Country of postal code","block":true},"name":{"kind":"Name","value":"country"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}],"type":{"kind":"NamedType","name":{"kind":"Name","value":"ShippingData"}},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheControl"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"scope"},"value":{"kind":"StringValue","value":"public","block":false}},{"kind":"Argument","name":{"kind":"Name","value":"sMaxAge"},"value":{"kind":"IntValue","value":"120"}},{"kind":"Argument","name":{"kind":"Name","value":"staleWhileRevalidate"},"value":{"kind":"IntValue","value":"3600"}}]}]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Returns if there's a redirect for a search.","block":true},"name":{"kind":"Name","value":"redirect"},"arguments":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Search term.","block":true},"name":{"kind":"Name","value":"term"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Array of selected search facets.","block":true},"name":{"kind":"Name","value":"selectedFacets"},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreSelectedFacet"}}}},"directives":[]}],"type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreRedirect"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Returns a list of sellers available for a specific localization.","block":true},"name":{"kind":"Name","value":"sellers"},"arguments":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Postal code input to calculate sellers","block":true},"name":{"kind":"Name","value":"postalCode"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Geocoordinates input to calculate sellers","block":true},"name":{"kind":"Name","value":"geoCoordinates"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"IGeoCoordinates"}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Country of localization","block":true},"name":{"kind":"Name","value":"country"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Sales channel of the navigation","block":true},"name":{"kind":"Name","value":"salesChannel"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]}],"type":{"kind":"NamedType","name":{"kind":"Name","value":"SellersData"}},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheControl"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"scope"},"value":{"kind":"StringValue","value":"public","block":false}},{"kind":"Argument","name":{"kind":"Name","value":"sMaxAge"},"value":{"kind":"IntValue","value":"120"}},{"kind":"Argument","name":{"kind":"Name","value":"staleWhileRevalidate"},"value":{"kind":"IntValue","value":"3600"}}]}]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Redirect informations, including url returned by the query.\nhttps://schema.org/Thing","block":true},"name":{"kind":"Name","value":"StoreRedirect"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"URL to redirect","block":true},"name":{"kind":"Name","value":"url"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Regionalization with sellers information.","block":true},"name":{"kind":"Name","value":"SellersData"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Identification of region.","block":true},"name":{"kind":"Name","value":"id"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"List of sellers.","block":true},"name":{"kind":"Name","value":"sellers"},"arguments":[],"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SellerInfo"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Information of sellers.","block":true},"name":{"kind":"Name","value":"SellerInfo"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Identification of the seller","block":true},"name":{"kind":"Name","value":"id"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Name of the seller","block":true},"name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Logo of the seller","block":true},"name":{"kind":"Name","value":"logo"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]}]}],"loc":{"start":0,"end":7490}};
2610
- doc$l.loc.source = {"body":"\"\"\"\nEach product edge contains a `node`, with product information, and a `cursor`, that can be used as a reference for pagination.\n\"\"\"\ntype StoreProductEdge {\n \"\"\"\n Each product node contains the information of a product returned by the query.\n \"\"\"\n node: StoreProduct!\n \"\"\"\n Product cursor. Used as pagination reference.\n \"\"\"\n cursor: String!\n}\n\n\"\"\"\nProduct connections, including pagination information and products returned by the query.\n\"\"\"\ntype StoreProductConnection {\n \"\"\"\n Product pagination information.\n \"\"\"\n pageInfo: StorePageInfo!\n \"\"\"\n Array with product connection edges, each containing a product and a corresponding cursor.\n \"\"\"\n edges: [StoreProductEdge!]!\n}\n\n\"\"\"\nEach collection edge contains a `node`, with product collection information, and a `cursor`, that can be used as a reference for pagination.\n\"\"\"\ntype StoreCollectionEdge {\n \"\"\"\n Each collection node contains the information of a product collection returned by the query.\n \"\"\"\n node: StoreCollection!\n \"\"\"\n Collection cursor. Used as pagination reference.\n \"\"\"\n cursor: String!\n}\n\n\"\"\"\nCollection connections, including pagination information and collections returned by the query.\n\"\"\"\ntype StoreCollectionConnection {\n \"\"\"\n Collection pagination information.\n \"\"\"\n pageInfo: StorePageInfo!\n \"\"\"\n Array with collection connection page edges, each containing a collection and a corresponding cursor..\n \"\"\"\n edges: [StoreCollectionEdge!]!\n}\n\n\"\"\"\nProduct search results sorting options.\n\"\"\"\nenum StoreSort {\n \"\"\"\n Sort by price, from highest to lowest.\n \"\"\"\n price_desc\n \"\"\"\n Sort by price, from lowest to highest.\n \"\"\"\n price_asc\n \"\"\"\n Sort by orders, from highest to lowest.\n \"\"\"\n orders_desc\n \"\"\"\n Sort by name, in reverse alphabetical order.\n \"\"\"\n name_desc\n \"\"\"\n Sort by name, in alphabetical order.\n \"\"\"\n name_asc\n \"\"\"\n Sort by release date, from highest to lowest.\n \"\"\"\n release_desc\n \"\"\"\n Sort by discount value, from highest to lowest.\n \"\"\"\n discount_desc\n \"\"\"\n Sort by product score, from highest to lowest.\n \"\"\"\n score_desc\n}\n\n\"\"\"\nSelected search facet input.\n\"\"\"\ninput IStoreSelectedFacet {\n \"\"\"\n Selected search facet key.\n \"\"\"\n key: String!\n \"\"\"\n Selected search facet value.\n \"\"\"\n value: String!\n}\n\n\"\"\"\nSearch facet type.\n\"\"\"\nenum StoreFacetType {\n \"\"\"\n Indicates boolean search facet.\n \"\"\"\n BOOLEAN\n \"\"\"\n Indicates range type search facet.\n \"\"\"\n RANGE\n}\n\n\"\"\"\nSuggestion term.\n\"\"\"\ntype StoreSuggestionTerm {\n \"\"\"\n The term.\n \"\"\"\n value: String!\n \"\"\"\n Its occurrences count.\n \"\"\"\n count: Int!\n}\n\n\"\"\"\nSuggestions information.\n\"\"\"\ntype StoreSuggestions {\n \"\"\"\n Array with suggestion terms.\n \"\"\"\n terms: [StoreSuggestionTerm!]!\n \"\"\"\n Array with suggestion products' information.\n \"\"\"\n products: [StoreProduct!]!\n}\n\n\"\"\"\nSearch result.\n\"\"\"\ntype SearchMetadata {\n \"\"\"\n Indicates if the search term was misspelled.\n \"\"\"\n isTermMisspelled: Boolean!\n \"\"\"\n Logical operator used to run the search.\n \"\"\"\n logicalOperator: String!\n}\n\n\"\"\"\nSearch result.\n\"\"\"\ntype StoreSearchResult {\n \"\"\"\n Search result products.\n \"\"\"\n products: StoreProductConnection!\n \"\"\"\n Array of search result facets.\n \"\"\"\n facets: [StoreFacet!]!\n \"\"\"\n Search result suggestions.\n \"\"\"\n suggestions: StoreSuggestions!\n \"\"\"\n Search result metadata. Additional data can be used to send analytics events.\n \"\"\"\n metadata: SearchMetadata\n}\n\ninput IGeoCoordinates {\n \"\"\"\n The latitude of the geographic coordinates.\n \"\"\"\n latitude: Float!\n \"\"\"\n The longitude of the geographic coordinates.\n \"\"\"\n longitude: Float!\n}\n\ntype Query {\n \"\"\"\n Returns the details of a product based on the specified locator.\n \"\"\"\n product(\n \"\"\"\n An array of selected search facets.\n \"\"\"\n locator: [IStoreSelectedFacet!]!\n ): StoreProduct!\n @cacheControl(scope: \"public\", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n \"\"\"\n Returns the details of a collection based on the collection slug.\n \"\"\"\n collection(\n \"\"\"\n Collection slug.\n \"\"\"\n slug: String!\n ): StoreCollection!\n @cacheControl(scope: \"public\", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n \"\"\"\n Returns the result of a product, facet, or suggestion search.\n \"\"\"\n search(\n \"\"\"\n Search pagination argument, indicating how many results should be returned from the complete result list.\n \"\"\"\n first: Int!\n \"\"\"\n Search pagination argument, indicating the cursor corresponding with the item after which the results should be fetched.\n \"\"\"\n after: String\n \"\"\"\n Search results sorting mode.\n \"\"\"\n sort: StoreSort = score_desc\n \"\"\"\n Search term.\n \"\"\"\n term: String = \"\"\n \"\"\"\n Array of selected search facets.\n \"\"\"\n selectedFacets: [IStoreSelectedFacet!]\n ): StoreSearchResult!\n @cacheControl(scope: \"public\", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n \"\"\"\n Returns information about all products.\n \"\"\"\n allProducts(\n \"\"\"\n Product pagination argument, indicating how many items should be returned from the complete result list.\n \"\"\"\n first: Int!\n \"\"\"\n Product pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.\n \"\"\"\n after: String\n ): StoreProductConnection!\n @cacheControl(scope: \"public\", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n \"\"\"\n Returns information about all collections.\n \"\"\"\n allCollections(\n \"\"\"\n Collection pagination argument, indicating how many items should be returned from the complete result list.\n \"\"\"\n first: Int!\n \"\"\"\n Collection pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.\n \"\"\"\n after: String\n ): StoreCollectionConnection!\n @cacheControl(scope: \"public\", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n \"\"\"\n Returns information about shipping simulation.\n \"\"\"\n shipping(\n \"\"\"\n List of SKU products\n \"\"\"\n items: [IShippingItem!]!\n \"\"\"\n Postal code to freight calculator\n \"\"\"\n postalCode: String!\n \"\"\"\n Country of postal code\n \"\"\"\n country: String!\n ): ShippingData\n @cacheControl(scope: \"public\", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n \"\"\"\n Returns if there's a redirect for a search.\n \"\"\"\n redirect(\n \"\"\"\n Search term.\n \"\"\"\n term: String\n \"\"\"\n Array of selected search facets.\n \"\"\"\n selectedFacets: [IStoreSelectedFacet!]\n ): StoreRedirect\n\n\n \"\"\"\n Returns a list of sellers available for a specific localization.\n \"\"\"\n sellers(\n \"\"\"\n Postal code input to calculate sellers\n \"\"\"\n postalCode: String\n \"\"\"\n Geocoordinates input to calculate sellers\n \"\"\"\n geoCoordinates: IGeoCoordinates\n \"\"\"\n Country of localization\n \"\"\"\n country: String!\n \"\"\"\n Sales channel of the navigation\n \"\"\"\n salesChannel: String\n ): SellersData\n @cacheControl(scope: \"public\", sMaxAge: 120, staleWhileRevalidate: 3600)\n}\n\n\"\"\"\nRedirect informations, including url returned by the query.\nhttps://schema.org/Thing\n\"\"\"\ntype StoreRedirect {\n \"\"\"\n URL to redirect\n \"\"\"\n url: String\n}\n\n\"\"\"\nRegionalization with sellers information.\n\"\"\"\ntype SellersData {\n \"\"\"\n Identification of region.\n \"\"\"\n id: String\n \"\"\"\n List of sellers.\n \"\"\"\n sellers: [SellerInfo]\n}\n\n\"\"\"\nInformation of sellers.\n\"\"\"\ntype SellerInfo {\n \"\"\"\n Identification of the seller\n \"\"\"\n id: String\n \"\"\"\n Name of the seller\n \"\"\"\n name: String\n \"\"\"\n Logo of the seller\n \"\"\"\n logo: String\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2611
-
2612
- var doc$m = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Information of a given review rating.","block":true},"name":{"kind":"Name","value":"StoreReviewRating"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Rating value.","block":true},"name":{"kind":"Name","value":"ratingValue"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Best rating value.","block":true},"name":{"kind":"Name","value":"bestRating"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Information of a given review.","block":true},"name":{"kind":"Name","value":"StoreReview"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Review rating information.","block":true},"name":{"kind":"Name","value":"reviewRating"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreReviewRating"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Review author.","block":true},"name":{"kind":"Name","value":"author"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreAuthor"}}},"directives":[]}]}],"loc":{"start":0,"end":366}};
2613
- doc$m.loc.source = {"body":"\"\"\"\nInformation of a given review rating.\n\"\"\"\ntype StoreReviewRating {\n \"\"\"\n Rating value.\n \"\"\"\n ratingValue: Float!\n \"\"\"\n Best rating value.\n \"\"\"\n bestRating: Float!\n}\n\n\"\"\"\nInformation of a given review.\n\"\"\"\ntype StoreReview {\n \"\"\"\n Review rating information.\n \"\"\"\n reviewRating: StoreReviewRating!\n \"\"\"\n Review author.\n \"\"\"\n author: StoreAuthor!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2614
-
2615
- var doc$n = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Search Engine Optimization (SEO) tags data.","block":true},"name":{"kind":"Name","value":"StoreSeo"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Title tag.","block":true},"name":{"kind":"Name","value":"title"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Title template tag.","block":true},"name":{"kind":"Name","value":"titleTemplate"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Description tag.","block":true},"name":{"kind":"Name","value":"description"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Canonical tag.","block":true},"name":{"kind":"Name","value":"canonical"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]}],"loc":{"start":0,"end":275}};
2616
- doc$n.loc.source = {"body":"\"\"\"\nSearch Engine Optimization (SEO) tags data.\n\"\"\"\ntype StoreSeo {\n \"\"\"\n Title tag.\n \"\"\"\n title: String!\n \"\"\"\n Title template tag.\n \"\"\"\n titleTemplate: String!\n \"\"\"\n Description tag.\n \"\"\"\n description: String!\n \"\"\"\n Canonical tag.\n \"\"\"\n canonical: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2617
-
2618
- var doc$o = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Currency information.","block":true},"name":{"kind":"Name","value":"StoreCurrency"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Currency code (e.g: USD).","block":true},"name":{"kind":"Name","value":"code"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Currency symbol (e.g: $).","block":true},"name":{"kind":"Name","value":"symbol"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","name":{"kind":"Name","value":"IStoreCurrency"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Currency code (e.g: USD).","block":true},"name":{"kind":"Name","value":"code"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Currency symbol (e.g: $).","block":true},"name":{"kind":"Name","value":"symbol"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Geographic coordinates information.","block":true},"name":{"kind":"Name","value":"StoreGeoCoordinates"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"The latitude of the geographic coordinates.","block":true},"name":{"kind":"Name","value":"latitude"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"The longitude of the geographic coordinates.","block":true},"name":{"kind":"Name","value":"longitude"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","name":{"kind":"Name","value":"IStoreGeoCoordinates"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"The latitude of the geographic coordinates.","block":true},"name":{"kind":"Name","value":"latitude"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"The longitude of the geographic coordinates.","block":true},"name":{"kind":"Name","value":"longitude"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Delivery window information.","block":true},"name":{"kind":"Name","value":"StoreDeliveryWindow"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"The delivery window start date information.","block":true},"name":{"kind":"Name","value":"startDate"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"The delivery window end date information.","block":true},"name":{"kind":"Name","value":"endDate"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","description":{"kind":"StringValue","value":"Delivery window information.","block":true},"name":{"kind":"Name","value":"IStoreDeliveryWindow"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"The delivery window start date information.","block":true},"name":{"kind":"Name","value":"startDate"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"The delivery window end date information.","block":true},"name":{"kind":"Name","value":"endDate"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Delivery mode information.","block":true},"name":{"kind":"Name","value":"StoreDeliveryMode"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"The delivery channel information of the session.","block":true},"name":{"kind":"Name","value":"deliveryChannel"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"The delivery method information of the session.","block":true},"name":{"kind":"Name","value":"deliveryMethod"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"The delivery window information of the session.","block":true},"name":{"kind":"Name","value":"deliveryWindow"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreDeliveryWindow"}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","name":{"kind":"Name","value":"IStoreDeliveryMode"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"The delivery channel information of the session.","block":true},"name":{"kind":"Name","value":"deliveryChannel"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"The delivery method information of the session.","block":true},"name":{"kind":"Name","value":"deliveryMethod"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"The delivery window information of the session.","block":true},"name":{"kind":"Name","value":"deliveryWindow"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreDeliveryWindow"}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Session information.","block":true},"name":{"kind":"Name","value":"StoreSession"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Session locale.","block":true},"name":{"kind":"Name","value":"locale"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Session currency.","block":true},"name":{"kind":"Name","value":"currency"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreCurrency"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Session country.","block":true},"name":{"kind":"Name","value":"country"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Session channel.","block":true},"name":{"kind":"Name","value":"channel"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Session delivery mode.","block":true},"name":{"kind":"Name","value":"deliveryMode"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreDeliveryMode"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Session address type.","block":true},"name":{"kind":"Name","value":"addressType"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Session postal code.","block":true},"name":{"kind":"Name","value":"postalCode"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Session input geoCoordinates.","block":true},"name":{"kind":"Name","value":"geoCoordinates"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"StoreGeoCoordinates"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Session input person.","block":true},"name":{"kind":"Name","value":"person"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"StorePerson"}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","description":{"kind":"StringValue","value":"Session input.","block":true},"name":{"kind":"Name","value":"IStoreSession"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Session input locale.","block":true},"name":{"kind":"Name","value":"locale"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Session input currency.","block":true},"name":{"kind":"Name","value":"currency"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreCurrency"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Session input country.","block":true},"name":{"kind":"Name","value":"country"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Session input channel.","block":true},"name":{"kind":"Name","value":"channel"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Session input delivery mode.","block":true},"name":{"kind":"Name","value":"deliveryMode"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreDeliveryMode"}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Session input address type.","block":true},"name":{"kind":"Name","value":"addressType"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Session input postal code.","block":true},"name":{"kind":"Name","value":"postalCode"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Session input geoCoordinates.","block":true},"name":{"kind":"Name","value":"geoCoordinates"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"IStoreGeoCoordinates"}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Session input person.","block":true},"name":{"kind":"Name","value":"person"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"IStorePerson"}},"directives":[]}]}],"loc":{"start":0,"end":3027}};
2619
- doc$o.loc.source = {"body":"\"\"\"\nCurrency information.\n\"\"\"\ntype StoreCurrency {\n \"\"\"\n Currency code (e.g: USD).\n \"\"\"\n code: String!\n \"\"\"\n Currency symbol (e.g: $).\n \"\"\"\n symbol: String!\n}\n\ninput IStoreCurrency {\n \"\"\"\n Currency code (e.g: USD).\n \"\"\"\n code: String!\n \"\"\"\n Currency symbol (e.g: $).\n \"\"\"\n symbol: String!\n}\n\n\"\"\"\nGeographic coordinates information.\n\"\"\"\ntype StoreGeoCoordinates {\n \"\"\"\n The latitude of the geographic coordinates.\n \"\"\"\n latitude: Float!\n \"\"\"\n The longitude of the geographic coordinates.\n \"\"\"\n longitude: Float!\n}\n\ninput IStoreGeoCoordinates {\n \"\"\"\n The latitude of the geographic coordinates.\n \"\"\"\n latitude: Float!\n \"\"\"\n The longitude of the geographic coordinates.\n \"\"\"\n longitude: Float!\n}\n\n\"\"\"\nDelivery window information.\n\"\"\"\ntype StoreDeliveryWindow {\n \"\"\"\n The delivery window start date information.\n \"\"\"\n startDate: String!\n \"\"\"\n The delivery window end date information.\n \"\"\"\n endDate: String!\n}\n\n\"\"\"\nDelivery window information.\n\"\"\"\ninput IStoreDeliveryWindow {\n \"\"\"\n The delivery window start date information.\n \"\"\"\n startDate: String!\n \"\"\"\n The delivery window end date information.\n \"\"\"\n endDate: String!\n}\n\n\"\"\"\nDelivery mode information.\n\"\"\"\ntype StoreDeliveryMode {\n \"\"\"\n The delivery channel information of the session.\n \"\"\"\n deliveryChannel: String!\n \"\"\"\n The delivery method information of the session.\n \"\"\"\n deliveryMethod: String!\n \"\"\"\n The delivery window information of the session.\n \"\"\"\n deliveryWindow: StoreDeliveryWindow\n}\n\ninput IStoreDeliveryMode {\n \"\"\"\n The delivery channel information of the session.\n \"\"\"\n deliveryChannel: String!\n \"\"\"\n The delivery method information of the session.\n \"\"\"\n deliveryMethod: String!\n \"\"\"\n The delivery window information of the session.\n \"\"\"\n deliveryWindow: IStoreDeliveryWindow\n}\n\n\"\"\"\nSession information.\n\"\"\"\ntype StoreSession {\n \"\"\"\n Session locale.\n \"\"\"\n locale: String!\n \"\"\"\n Session currency.\n \"\"\"\n currency: StoreCurrency!\n \"\"\"\n Session country.\n \"\"\"\n country: String!\n \"\"\"\n Session channel.\n \"\"\"\n channel: String\n \"\"\"\n Session delivery mode.\n \"\"\"\n deliveryMode: StoreDeliveryMode\n \"\"\"\n Session address type.\n \"\"\"\n addressType: String\n \"\"\"\n Session postal code.\n \"\"\"\n postalCode: String\n \"\"\"\n Session input geoCoordinates.\n \"\"\"\n geoCoordinates: StoreGeoCoordinates\n \"\"\"\n Session input person.\n \"\"\"\n person: StorePerson\n}\n\n\"\"\"\nSession input.\n\"\"\"\ninput IStoreSession {\n \"\"\"\n Session input locale.\n \"\"\"\n locale: String!\n \"\"\"\n Session input currency.\n \"\"\"\n currency: IStoreCurrency!\n \"\"\"\n Session input country.\n \"\"\"\n country: String!\n \"\"\"\n Session input channel.\n \"\"\"\n channel: String\n \"\"\"\n Session input delivery mode.\n \"\"\"\n deliveryMode: IStoreDeliveryMode\n \"\"\"\n Session input address type.\n \"\"\"\n addressType: String\n \"\"\"\n Session input postal code.\n \"\"\"\n postalCode: String\n \"\"\"\n Session input geoCoordinates.\n \"\"\"\n geoCoordinates: IStoreGeoCoordinates\n \"\"\"\n Session input person.\n \"\"\"\n person: IStorePerson\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2620
-
2621
- var doc$p = {"kind":"Document","definitions":[{"kind":"InputObjectTypeDefinition","description":{"kind":"StringValue","value":"Shipping Simulation item input.","block":true},"name":{"kind":"Name","value":"IShippingItem"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"ShippingItem ID / Sku.","block":true},"name":{"kind":"Name","value":"id"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Number of items.","block":true},"name":{"kind":"Name","value":"quantity"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Seller responsible for the ShippingItem.","block":true},"name":{"kind":"Name","value":"seller"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Shipping Simulation information.","block":true},"name":{"kind":"Name","value":"ShippingData"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"List of LogisticsItem.","block":true},"name":{"kind":"Name","value":"items"},"arguments":[],"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"LogisticsItem"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"List of LogisticsInfo.","block":true},"name":{"kind":"Name","value":"logisticsInfo"},"arguments":[],"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"LogisticsInfo"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"List of MessageInfo.","block":true},"name":{"kind":"Name","value":"messages"},"arguments":[],"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"MessageInfo"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Address information.","block":true},"name":{"kind":"Name","value":"address"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Address"}},"directives":[]}]},{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Shipping Simulation Logistic Item.","block":true},"name":{"kind":"Name","value":"LogisticsItem"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"LogisticsItem ID / Sku.","block":true},"name":{"kind":"Name","value":"id"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","name":{"kind":"Name","value":"requestIndex"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Number of items.","block":true},"name":{"kind":"Name","value":"quantity"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Seller responsible for the ShippingItem.","block":true},"name":{"kind":"Name","value":"seller"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"List of Sellers.","block":true},"name":{"kind":"Name","value":"sellerChain"},"arguments":[],"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"LogisticsItem tax.","block":true},"name":{"kind":"Name","value":"tax"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Next date in which price is scheduled to change. If there is no scheduled change, this will be set a year in the future from current time.","block":true},"name":{"kind":"Name","value":"priceValidUntil"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"LogisticsItem price.","block":true},"name":{"kind":"Name","value":"price"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"LogisticsItem listPrice.","block":true},"name":{"kind":"Name","value":"listPrice"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"LogisticsItem rewardValue.","block":true},"name":{"kind":"Name","value":"rewardValue"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"LogisticsItem sellingPrice.","block":true},"name":{"kind":"Name","value":"sellingPrice"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"LogisticsItem measurementUnit.","block":true},"name":{"kind":"Name","value":"measurementUnit"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"LogisticsItem unitMultiplier.","block":true},"name":{"kind":"Name","value":"unitMultiplier"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"LogisticsItem availability.","block":true},"name":{"kind":"Name","value":"availability"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]}]},{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"LogisticsInfo"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"LogisticsInfo itemIndex.","block":true},"name":{"kind":"Name","value":"itemIndex"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"LogisticsInfo selectedSla.","block":true},"name":{"kind":"Name","value":"selectedSla"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"List of LogisticsInfo ShippingSLA.","block":true},"name":{"kind":"Name","value":"slas"},"arguments":[],"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ShippingSLA"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"ShippingSLA"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ShippingSLA id.","block":true},"name":{"kind":"Name","value":"id"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ShippingSLA name.","block":true},"name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ShippingSLA price.","block":true},"name":{"kind":"Name","value":"price"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ShippingSLA shipping estimate.","block":true},"name":{"kind":"Name","value":"shippingEstimate"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ShippingSLA localized shipping estimate.\nNote: this will always return a localized string for locale `en-US`.","block":true},"name":{"kind":"Name","value":"localizedEstimates"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ShippingSLA available delivery windows.","block":true},"name":{"kind":"Name","value":"availableDeliveryWindows"},"arguments":[],"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AvailableDeliveryWindows"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ShippingSLA shipping estimate date.","block":true},"name":{"kind":"Name","value":"shippingEstimateDate"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"List of ShippingSLA delivery ids.","block":true},"name":{"kind":"Name","value":"deliveryIds"},"arguments":[],"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"DeliveryIds"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ShippingSLA delivery channel.","block":true},"name":{"kind":"Name","value":"deliveryChannel"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ShippingSLA friendly name.","block":true},"name":{"kind":"Name","value":"friendlyName"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ShippingSLA carrier.","block":true},"name":{"kind":"Name","value":"carrier"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ShippingSLA pickup point id.","block":true},"name":{"kind":"Name","value":"pickupPointId"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ShippingSLA pickup store info.","block":true},"name":{"kind":"Name","value":"pickupStoreInfo"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"PickupStoreInfo"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"ShippingSLA pickup distance.","block":true},"name":{"kind":"Name","value":"pickupDistance"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}},"directives":[]}]},{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"AvailableDeliveryWindows"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Available delivery window start date in UTC","block":true},"name":{"kind":"Name","value":"startDateUtc"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Available delivery window end date in UTC","block":true},"name":{"kind":"Name","value":"endDateUtc"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Available delivery window price","block":true},"name":{"kind":"Name","value":"price"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Available delivery window list price","block":true},"name":{"kind":"Name","value":"listPrice"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Available delivery window tax","block":true},"name":{"kind":"Name","value":"tax"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"directives":[]}]},{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"DeliveryIds"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"DeliveryIds courier id","block":true},"name":{"kind":"Name","value":"courierId"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"DeliveryIds warehouse id","block":true},"name":{"kind":"Name","value":"warehouseId"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"DeliveryIds dock id","block":true},"name":{"kind":"Name","value":"dockId"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"DeliveryIds courier name","block":true},"name":{"kind":"Name","value":"courierName"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"DeliveryIds quantity","block":true},"name":{"kind":"Name","value":"quantity"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"directives":[]}]},{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"PickupStoreInfo"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupStoreInfo friendly name.","block":true},"name":{"kind":"Name","value":"friendlyName"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupStoreInfo address.","block":true},"name":{"kind":"Name","value":"address"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"PickupAddress"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupStoreInfo additional information.","block":true},"name":{"kind":"Name","value":"additionalInfo"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupStoreInfo dock id.","block":true},"name":{"kind":"Name","value":"dockId"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Information if the store has pickup enable.","block":true},"name":{"kind":"Name","value":"isPickupStore"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}},"directives":[]}]},{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"PickupAddress"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupAddress address type.","block":true},"name":{"kind":"Name","value":"addressType"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupAddress receiver name.","block":true},"name":{"kind":"Name","value":"receiverName"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupAddress address id.","block":true},"name":{"kind":"Name","value":"addressId"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupAddress postal code.","block":true},"name":{"kind":"Name","value":"postalCode"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupAddress city.","block":true},"name":{"kind":"Name","value":"city"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupAddress state.","block":true},"name":{"kind":"Name","value":"state"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupAddress country.","block":true},"name":{"kind":"Name","value":"country"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupAddress street.","block":true},"name":{"kind":"Name","value":"street"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupAddress number.","block":true},"name":{"kind":"Name","value":"number"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupAddress neighborhood.","block":true},"name":{"kind":"Name","value":"neighborhood"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupAddress complement.","block":true},"name":{"kind":"Name","value":"complement"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupAddress reference.","block":true},"name":{"kind":"Name","value":"reference"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"PickupAddress geo coordinates.","block":true},"name":{"kind":"Name","value":"geoCoordinates"},"arguments":[],"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},"directives":[]}]},{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"MessageInfo"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"MessageInfo code.","block":true},"name":{"kind":"Name","value":"code"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"MessageInfo text.","block":true},"name":{"kind":"Name","value":"text"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"MessageInfo status.","block":true},"name":{"kind":"Name","value":"status"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"MessageInfo fields.","block":true},"name":{"kind":"Name","value":"fields"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"MessageFields"}},"directives":[]}]},{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"MessageFields"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"MessageFields item index.","block":true},"name":{"kind":"Name","value":"itemIndex"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"MessageFields ean.","block":true},"name":{"kind":"Name","value":"ean"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"MessageFields sku name.","block":true},"name":{"kind":"Name","value":"skuName"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]}]}],"loc":{"start":0,"end":5041}};
2622
- doc$p.loc.source = {"body":"\"\"\"\nShipping Simulation item input.\n\"\"\"\ninput IShippingItem {\n \"\"\"\n ShippingItem ID / Sku.\n \"\"\"\n id: String!\n \"\"\"\n Number of items.\n \"\"\"\n quantity: Int!\n \"\"\"\n Seller responsible for the ShippingItem.\n \"\"\"\n seller: String!\n}\n\n\"\"\"\nShipping Simulation information.\n\"\"\"\ntype ShippingData {\n \"\"\"\n List of LogisticsItem.\n \"\"\"\n items: [LogisticsItem]\n \"\"\"\n List of LogisticsInfo.\n \"\"\"\n logisticsInfo: [LogisticsInfo]\n \"\"\"\n List of MessageInfo.\n \"\"\"\n messages: [MessageInfo]\n \"\"\"\n Address information.\n \"\"\"\n address: Address\n}\n\n\"\"\"\nShipping Simulation Logistic Item.\n\"\"\"\ntype LogisticsItem {\n \"\"\"\n LogisticsItem ID / Sku.\n \"\"\"\n id: String\n requestIndex: Int\n \"\"\"\n Number of items.\n \"\"\"\n quantity: Int\n \"\"\"\n Seller responsible for the ShippingItem.\n \"\"\"\n seller: String\n \"\"\"\n List of Sellers.\n \"\"\"\n sellerChain: [String]\n \"\"\"\n LogisticsItem tax.\n \"\"\"\n tax: Int\n \"\"\"\n Next date in which price is scheduled to change. If there is no scheduled change, this will be set a year in the future from current time.\n \"\"\"\n priceValidUntil: String\n \"\"\"\n LogisticsItem price.\n \"\"\"\n price: Int\n \"\"\"\n LogisticsItem listPrice.\n \"\"\"\n listPrice: Int\n \"\"\"\n LogisticsItem rewardValue.\n \"\"\"\n rewardValue: Int\n \"\"\"\n LogisticsItem sellingPrice.\n \"\"\"\n sellingPrice: Int\n \"\"\"\n LogisticsItem measurementUnit.\n \"\"\"\n measurementUnit: String\n \"\"\"\n LogisticsItem unitMultiplier.\n \"\"\"\n unitMultiplier: Int\n \"\"\"\n LogisticsItem availability.\n \"\"\"\n availability: String\n}\n\ntype LogisticsInfo {\n \"\"\"\n LogisticsInfo itemIndex.\n \"\"\"\n itemIndex: String\n \"\"\"\n LogisticsInfo selectedSla.\n \"\"\"\n selectedSla: String\n \"\"\"\n List of LogisticsInfo ShippingSLA.\n \"\"\"\n slas: [ShippingSLA]\n}\n\ntype ShippingSLA {\n \"\"\"\n ShippingSLA id.\n \"\"\"\n id: String\n \"\"\"\n ShippingSLA name.\n \"\"\"\n name: String\n \"\"\"\n ShippingSLA price.\n \"\"\"\n price: Float\n \"\"\"\n ShippingSLA shipping estimate.\n \"\"\"\n shippingEstimate: String\n \"\"\"\n ShippingSLA localized shipping estimate.\n Note: this will always return a localized string for locale `en-US`.\n \"\"\"\n localizedEstimates: String\n \"\"\"\n ShippingSLA available delivery windows.\n \"\"\"\n availableDeliveryWindows: [AvailableDeliveryWindows]\n \"\"\"\n ShippingSLA shipping estimate date.\n \"\"\"\n shippingEstimateDate: String\n \"\"\"\n List of ShippingSLA delivery ids.\n \"\"\"\n deliveryIds: [DeliveryIds]\n \"\"\"\n ShippingSLA delivery channel.\n \"\"\"\n deliveryChannel: String\n \"\"\"\n ShippingSLA friendly name.\n \"\"\"\n friendlyName: String\n \"\"\"\n ShippingSLA carrier.\n \"\"\"\n carrier: String\n \"\"\"\n ShippingSLA pickup point id.\n \"\"\"\n pickupPointId: String\n \"\"\"\n ShippingSLA pickup store info.\n \"\"\"\n pickupStoreInfo: PickupStoreInfo\n \"\"\"\n ShippingSLA pickup distance.\n \"\"\"\n pickupDistance: Float\n}\n\ntype AvailableDeliveryWindows {\n \"\"\"\n Available delivery window start date in UTC\n \"\"\"\n startDateUtc: String\n \"\"\"\n Available delivery window end date in UTC\n \"\"\"\n endDateUtc: String\n \"\"\"\n Available delivery window price\n \"\"\"\n price: Int\n \"\"\"\n Available delivery window list price\n \"\"\"\n listPrice: Int\n \"\"\"\n Available delivery window tax\n \"\"\"\n tax: Int\n}\n\ntype DeliveryIds {\n \"\"\"\n DeliveryIds courier id\n \"\"\"\n courierId: String\n \"\"\"\n DeliveryIds warehouse id\n \"\"\"\n warehouseId: String\n \"\"\"\n DeliveryIds dock id\n \"\"\"\n dockId: String\n \"\"\"\n DeliveryIds courier name\n \"\"\"\n courierName: String\n \"\"\"\n DeliveryIds quantity\n \"\"\"\n quantity: Int\n}\n\ntype PickupStoreInfo {\n \"\"\"\n PickupStoreInfo friendly name.\n \"\"\"\n friendlyName: String\n \"\"\"\n PickupStoreInfo address.\n \"\"\"\n address: PickupAddress\n \"\"\"\n PickupStoreInfo additional information.\n \"\"\"\n additionalInfo: String\n \"\"\"\n PickupStoreInfo dock id.\n \"\"\"\n dockId: String\n \"\"\"\n Information if the store has pickup enable.\n \"\"\"\n isPickupStore: Boolean\n}\n\ntype PickupAddress {\n \"\"\"\n PickupAddress address type.\n \"\"\"\n addressType: String\n \"\"\"\n PickupAddress receiver name.\n \"\"\"\n receiverName: String\n \"\"\"\n PickupAddress address id.\n \"\"\"\n addressId: String\n \"\"\"\n PickupAddress postal code.\n \"\"\"\n postalCode: String\n \"\"\"\n PickupAddress city.\n \"\"\"\n city: String\n \"\"\"\n PickupAddress state.\n \"\"\"\n state: String\n \"\"\"\n PickupAddress country.\n \"\"\"\n country: String\n \"\"\"\n PickupAddress street.\n \"\"\"\n street: String\n \"\"\"\n PickupAddress number.\n \"\"\"\n number: String\n \"\"\"\n PickupAddress neighborhood.\n \"\"\"\n neighborhood: String\n \"\"\"\n PickupAddress complement.\n \"\"\"\n complement: String\n \"\"\"\n PickupAddress reference.\n \"\"\"\n reference: String\n \"\"\"\n PickupAddress geo coordinates.\n \"\"\"\n geoCoordinates: [Float]\n}\n\ntype MessageInfo {\n \"\"\"\n MessageInfo code.\n \"\"\"\n code: String\n \"\"\"\n MessageInfo text.\n \"\"\"\n text: String\n \"\"\"\n MessageInfo status.\n \"\"\"\n status: String\n \"\"\"\n MessageInfo fields.\n \"\"\"\n fields: MessageFields\n}\n\ntype MessageFields {\n \"\"\"\n MessageFields item index.\n \"\"\"\n itemIndex: String\n \"\"\"\n MessageFields ean.\n \"\"\"\n ean: String\n \"\"\"\n MessageFields sku name.\n \"\"\"\n skuName: String\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2623
-
2624
- var doc$q = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","name":{"kind":"Name","value":"SkuVariants"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"SKU property values for the current SKU.","block":true},"name":{"kind":"Name","value":"activeVariations"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"ActiveVariations"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"All available options for each SKU variant property, indexed by their name.","block":true},"name":{"kind":"Name","value":"allVariantsByName"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"VariantsByName"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Maps property value combinations to their respective SKU's slug. Enables\nus to retrieve the slug for the SKU that matches the currently selected\nvariations in O(1) time.\nIf `dominantVariantName` is not present, the first variant will be \nconsidered the dominant one.","block":true},"name":{"kind":"Name","value":"slugsMap"},"arguments":[{"kind":"InputValueDefinition","name":{"kind":"Name","value":"dominantVariantName"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]}],"type":{"kind":"NamedType","name":{"kind":"Name","value":"SlugsMap"}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Available options for each varying SKU property, taking into account the\n`dominantVariantName` property. Returns all available options for the\ndominant property, and only options that can be combined with its current\nvalue for other properties.\nIf `dominantVariantName` is not present, the first variant will be \nconsidered the dominant one.","block":true},"name":{"kind":"Name","value":"availableVariations"},"arguments":[{"kind":"InputValueDefinition","name":{"kind":"Name","value":"dominantVariantName"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]}],"type":{"kind":"NamedType","name":{"kind":"Name","value":"FormattedVariants"}},"directives":[]}]},{"kind":"ScalarTypeDefinition","description":{"kind":"StringValue","value":"Example:\n\n```json\n{\n 'Color-Red-Size-40': 'classic-shoes-37'\n}\n```","block":true},"name":{"kind":"Name","value":"SlugsMap"},"directives":[]},{"kind":"ScalarTypeDefinition","description":{"kind":"StringValue","value":"Example:\n\n```json\n{\n Color: 'Red', Size: '42'\n}\n```","block":true},"name":{"kind":"Name","value":"ActiveVariations"},"directives":[]},{"kind":"ScalarTypeDefinition","description":{"kind":"StringValue","value":"Example:\n\n```json\n{\n Color: [ \"Red\", \"Blue\", \"Green\" ],\n Size: [ \"40\", \"41\" ]\n}\n```","block":true},"name":{"kind":"Name","value":"VariantsByName"},"directives":[]},{"kind":"ScalarTypeDefinition","description":{"kind":"StringValue","value":"Example:\n\n```json\n{\n Color: [\n {\n src: \"https://storecomponents.vtexassets.com/...\",\n alt: \"...\",\n label: \"...\",\n value: \"...\"\n },\n {\n src: \"https://storecomponents.vtexassets.com/...\",\n alt: \"...\",\n label: \"...\",\n value: \"...\"\n }\n ],\n Size: [\n {\n src: \"https://storecomponents.vtexassets.com/...\",\n alt: \"...\",\n label: \"...\",\n value: \"...\"\n }\n ]\n}\n```","block":true},"name":{"kind":"Name","value":"FormattedVariants"},"directives":[]}],"loc":{"start":0,"end":1776}};
2625
- doc$q.loc.source = {"body":"type SkuVariants {\n \"\"\"\n SKU property values for the current SKU.\n \"\"\"\n activeVariations: ActiveVariations\n \"\"\"\n All available options for each SKU variant property, indexed by their name.\n \"\"\"\n allVariantsByName: VariantsByName\n \"\"\"\n Maps property value combinations to their respective SKU's slug. Enables\n us to retrieve the slug for the SKU that matches the currently selected\n variations in O(1) time.\n If `dominantVariantName` is not present, the first variant will be \n considered the dominant one.\n \"\"\"\n slugsMap(dominantVariantName: String): SlugsMap\n \"\"\"\n Available options for each varying SKU property, taking into account the\n `dominantVariantName` property. Returns all available options for the\n dominant property, and only options that can be combined with its current\n value for other properties.\n If `dominantVariantName` is not present, the first variant will be \n considered the dominant one.\n \"\"\"\n availableVariations(dominantVariantName: String): FormattedVariants\n}\n\n\"\"\"\nExample:\n\n```json\n{\n 'Color-Red-Size-40': 'classic-shoes-37'\n}\n```\n\"\"\"\nscalar SlugsMap\n\"\"\"\nExample:\n\n```json\n{\n Color: 'Red', Size: '42'\n}\n```\n\"\"\"\nscalar ActiveVariations\n\"\"\"\nExample:\n\n```json\n{\n Color: [ \"Red\", \"Blue\", \"Green\" ],\n Size: [ \"40\", \"41\" ]\n}\n```\n\"\"\"\nscalar VariantsByName\n\"\"\"\nExample:\n\n```json\n{\n Color: [\n {\n src: \"https://storecomponents.vtexassets.com/...\",\n alt: \"...\",\n label: \"...\",\n value: \"...\"\n },\n {\n src: \"https://storecomponents.vtexassets.com/...\",\n alt: \"...\",\n label: \"...\",\n value: \"...\"\n }\n ],\n Size: [\n {\n src: \"https://storecomponents.vtexassets.com/...\",\n alt: \"...\",\n label: \"...\",\n value: \"...\"\n }\n ]\n}\n```\n\"\"\"\nscalar FormattedVariants\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2626
-
2627
- var doc$r = {"kind":"Document","definitions":[{"kind":"EnumTypeDefinition","description":{"kind":"StringValue","value":"Status used to indicate a message type. For instance, a shopping cart informative or error message.","block":true},"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":154}};
2628
- doc$r.loc.source = {"body":"\"\"\"\nStatus used to indicate a message type. For instance, a shopping cart informative or error message.\n\"\"\"\nenum StoreStatus {\n INFO\n WARNING\n ERROR\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2629
-
2630
- const typeDefs = /*#__PURE__*/[doc$l, doc$a, doc, doc$4, doc$5, doc$7, doc$8, doc$9, doc$g, doc$i, doc$n, doc$d, doc$2, doc$m, doc$3, doc$j, doc$f, doc$1, doc$e, doc$6, doc$r, doc$k, doc$h, doc$c, doc$o, doc$b, doc$q, doc$p].map(graphql.print).join('\n');
2631
-
2632
- const NAME = "cacheControl";
2633
- const stringify$1 = ({
2634
- scope = "private",
2635
- sMaxAge = 0,
2636
- staleWhileRevalidate = 0
2637
- }) => `${scope}, s-maxage=${sMaxAge}, stale-while-revalidate=${staleWhileRevalidate}`;
2638
- const min$1 = (a, b) => {
2639
- if (typeof a === "number" && typeof b === "number") {
2640
- return a > b ? b : a;
2641
- }
2642
- if (typeof a === "number") {
2643
- return a;
2644
- }
2645
- return b;
2646
- };
2647
- const minScope = (a, b) => {
2648
- if (typeof a === "string" && typeof b === "string") {
2649
- return a === "public" && b === "public" ? "public" : "private";
2650
- }
2651
- return a || b;
2652
- };
2653
- const directive = {
2654
- typeDefs: `directive @cacheControl(sMaxAge: Int, staleWhileRevalidate: Int, scope: String) on FIELD_DEFINITION`,
2655
- transformer: schema => utils.mapSchema(schema, {
2656
- [utils.MapperKind.OBJECT_FIELD]: fieldConfig => {
2657
- var _getDirective;
2658
- const cacheControl = (_getDirective = utils.getDirective(schema, fieldConfig, NAME)) == null ? void 0 : _getDirective[0];
2659
- if (cacheControl) {
2660
- const {
2661
- sMaxAge,
2662
- staleWhileRevalidate,
2663
- scope
2664
- } = cacheControl;
2665
- const resolver = fieldConfig.resolve;
2666
- fieldConfig.resolve = (obj, args, ctx, info) => {
2667
- var _ctx$cacheControl, _ctx$cacheControl2, _ctx$cacheControl3;
2668
- ctx.cacheControl = {
2669
- sMaxAge: min$1((_ctx$cacheControl = ctx.cacheControl) == null ? void 0 : _ctx$cacheControl.sMaxAge, sMaxAge),
2670
- staleWhileRevalidate: min$1((_ctx$cacheControl2 = ctx.cacheControl) == null ? void 0 : _ctx$cacheControl2.staleWhileRevalidate, staleWhileRevalidate),
2671
- scope: minScope((_ctx$cacheControl3 = ctx.cacheControl) == null ? void 0 : _ctx$cacheControl3.scope, scope)
2672
- };
2673
- return resolver == null ? void 0 : resolver(obj, args, ctx, info);
2674
- };
2675
- }
2676
- return fieldConfig;
2677
- }
2678
- })
2679
- };
2680
-
2681
- var AttributeName;
2682
- (function (AttributeName) {
2683
- AttributeName["EXECUTION_ERROR"] = "graphql.error";
2684
- AttributeName["EXECUTION_RESULT"] = "graphql.result";
2685
- AttributeName["RESOLVER_EXECUTION_ERROR"] = "graphql.resolver.error";
2686
- AttributeName["RESOLVER_EXCEPTION"] = "graphql.resolver.exception";
2687
- AttributeName["RESOLVER_FIELD_NAME"] = "graphql.resolver.fieldName";
2688
- AttributeName["RESOLVER_TYPE_NAME"] = "graphql.resolver.typeName";
2689
- AttributeName["RESOLVER_RESULT_TYPE"] = "graphql.resolver.resultType";
2690
- AttributeName["RESOLVER_ARGS"] = "graphql.resolver.args";
2691
- AttributeName["EXECUTION_OPERATION_NAME"] = "graphql.operation.name";
2692
- AttributeName["EXECUTION_OPERATION_TYPE"] = "graphql.operation.type";
2693
- AttributeName["EXECUTION_OPERATION_DOCUMENT"] = "graphql.document";
2694
- AttributeName["EXECUTION_VARIABLES"] = "graphql.variables";
2695
- })(AttributeName || (AttributeName = {}));
2696
- const tracingSpanSymbol = /*#__PURE__*/Symbol('OPEN_TELEMETRY_GRAPHQL');
2697
- function getResolverSpanKey(path) {
2698
- const nodes = [];
2699
- // If the first node (after reversed, it will be the last one) is an integer, that is, identifies a list,
2700
- // we don't want to include it in the key. Note that this will only happen when analysing .prev paths in
2701
- // a list of elements. We just want to remove the initial node that is a integer, not all of them.
2702
- //
2703
- // Nodes with keys 6bc73341b2a183fc::product::image::0::url would not be able to find
2704
- // parents with key 6bc73341b2a183fc::product::image because of the "0" list index -
2705
- // it would search for 6bc73341b2a183fc::product::image::0
2706
- let currentPath = nodes.length === 0 && Number.isInteger(path.key) ? path.prev : path;
2707
- while (currentPath) {
2708
- nodes.push(currentPath.key);
2709
- currentPath = currentPath.prev;
2710
- }
2711
- return [...nodes].reverse().join('.');
2712
- }
2713
- const getFaststoreTelemetryPlugin = (tracingProvider, loggerProvider, serviceName, experimentalSendLogs) => {
2714
- return function useFaststoreTelemetry() {
2715
- const tracer = tracingProvider.getTracer(serviceName);
2716
- const logger = loggerProvider.getLogger(serviceName);
2717
- const resolverContextsByRootSpans = {};
2718
- return {
2719
- onPluginInit({
2720
- addPlugin
2721
- }) {
2722
- addPlugin(
2723
- // eslint-disable-next-line
2724
- onResolve.useOnResolve(({
2725
- info,
2726
- context
2727
- }) => {
2728
- if (context && typeof context === 'object' && context[tracingSpanSymbol]) {
2729
- var _path$prev, _path$prev2;
2730
- tracer.getActiveSpanProcessor();
2731
- const rootContextSpanId = context[tracingSpanSymbol].spanContext().spanId;
2732
- const {
2733
- fieldName,
2734
- returnType,
2735
- parentType,
2736
- path
2737
- } = info;
2738
- const previousResolverSpanKey = path.prev && getResolverSpanKey(path.prev);
2739
- let ctx = null;
2740
- if (previousResolverSpanKey && resolverContextsByRootSpans[rootContextSpanId][previousResolverSpanKey]) {
2741
- ctx = resolverContextsByRootSpans[rootContextSpanId][previousResolverSpanKey];
2742
- } else {
2743
- var _resolverContextsByRo;
2744
- ctx = api.trace.setSpan(api.context.active(), context[tracingSpanSymbol]);
2745
- resolverContextsByRootSpans[rootContextSpanId] = (_resolverContextsByRo = resolverContextsByRootSpans[rootContextSpanId]) != null ? _resolverContextsByRo : {};
2746
- }
2747
- const resolverIndexInList = Number.isInteger((_path$prev = path.prev) == null ? void 0 : _path$prev.key) ? `[${(_path$prev2 = path.prev) == null ? void 0 : _path$prev2.key}]` : '';
2748
- const resolverSpan = tracer.startSpan(`${parentType.toString()}.${fieldName}${resolverIndexInList}`, {
2749
- attributes: {
2750
- [AttributeName.RESOLVER_FIELD_NAME]: fieldName,
2751
- [AttributeName.RESOLVER_TYPE_NAME]: parentType.toString(),
2752
- [AttributeName.RESOLVER_RESULT_TYPE]: returnType.toString(),
2753
- 'meta.span.path': getResolverSpanKey(path)
2754
- }
2755
- }, ctx);
2756
- const resolverCtx = api.trace.setSpan(ctx, resolverSpan);
2757
- resolverContextsByRootSpans[rootContextSpanId][getResolverSpanKey(path)] = resolverCtx;
2758
- return ({
2759
- result
2760
- }) => {
2761
- if (result instanceof Error) {
2762
- resolverSpan.setAttributes({
2763
- error: true,
2764
- 'exception.category': AttributeName.RESOLVER_EXECUTION_ERROR,
2765
- 'exception.message': result.message,
2766
- 'exception.type': result.name
2767
- });
2768
- resolverSpan.recordException(result);
2769
- }
2770
- resolverSpan.end();
2771
- };
2772
- }
2773
- return () => {};
2774
- }));
2775
- },
2776
- onExecute({
2777
- args,
2778
- extendContext
2779
- }) {
2780
- var _args$document$defini, _args$operationName;
2781
- const operationType = (_args$document$defini = args.document.definitions.filter(def => def.kind === graphql.Kind.OPERATION_DEFINITION).map(def => def.operation)) == null ? void 0 : _args$document$defini[0];
2782
- // Span name according to Semantic Conventions
2783
- // https://github.com/open-telemetry/semantic-conventions
2784
- let spanName = 'GraphQL Operation';
2785
- if (operationType && args.operationName) {
2786
- spanName = `${operationType} ${args.operationName}`;
2787
- } else if (operationType && !args.operationName) {
2788
- spanName = operationType;
2789
- }
2790
- const executionSpan = tracer.startSpan(spanName, {
2791
- kind: api.SpanKind.SERVER,
2792
- attributes: {
2793
- [AttributeName.EXECUTION_OPERATION_NAME]: (_args$operationName = args.operationName) != null ? _args$operationName : undefined,
2794
- [AttributeName.EXECUTION_OPERATION_TYPE]: operationType != null ? operationType : undefined,
2795
- [AttributeName.EXECUTION_OPERATION_DOCUMENT]: graphql.print(args.document)
2796
- }
2797
- });
2798
- const executeContext = api.context.active();
2799
- const resultCbs = {
2800
- onExecuteDone({
2801
- result
2802
- }) {
2803
- var _args$operationName2, _args$variableValues;
2804
- if (core.isAsyncIterable(result)) {
2805
- executionSpan.end();
2806
- // eslint-disable-next-line no-console
2807
- console.warn(`Plugin "newrelic" encountered a AsyncIterator which is not supported yet, so tracing data is not available for the operation.`);
2808
- return;
2809
- }
2810
- const logRecord = {
2811
- context: executeContext,
2812
- attributes: {
2813
- 'service.name': 'faststore-api',
2814
- 'service.version': '1.12.38',
2815
- 'service.name_and_version': 'faststore-api@1.12.38',
2816
- 'vtex.search_index': 'faststore_beta_api',
2817
- [AttributeName.EXECUTION_OPERATION_NAME]: (_args$operationName2 = args.operationName) != null ? _args$operationName2 : undefined,
2818
- [AttributeName.EXECUTION_OPERATION_DOCUMENT]: graphql.print(args.document),
2819
- [AttributeName.EXECUTION_VARIABLES]: JSON.stringify((_args$variableValues = args.variableValues) != null ? _args$variableValues : {})
2820
- }
2821
- };
2822
- if (typeof result.data !== 'undefined' && !(result.errors && result.errors.length > 0)) {
2823
- logRecord.severityNumber = apiLogs.SeverityNumber.INFO;
2824
- logRecord.severityText = 'Info';
2825
- logRecord.attributes[AttributeName.EXECUTION_RESULT] = JSON.stringify(result);
2826
- }
2827
- if (result.errors && result.errors.length > 0) {
2828
- logRecord.severityNumber = apiLogs.SeverityNumber.ERROR;
2829
- logRecord.severityText = 'Error';
2830
- logRecord.attributes[AttributeName.EXECUTION_ERROR] = JSON.stringify(result.errors);
2831
- executionSpan.setAttributes({
2832
- error: true,
2833
- 'exception.category': AttributeName.EXECUTION_ERROR,
2834
- 'exception.message': JSON.stringify(result.errors)
2835
- });
2836
- }
2837
- if (experimentalSendLogs) {
2838
- logger.emit(logRecord);
2839
- }
2840
- executionSpan.end();
2841
- }
2842
- };
2843
- extendContext({
2844
- [tracingSpanSymbol]: executionSpan
2845
- });
2846
- return resultCbs;
2847
- }
2848
- };
2849
- };
2850
- };
2851
-
2852
- const FASTSTORE_API_VERSION = packageJson.version;
2853
- // TODO: These urls are hardcoded for now, but they should be configurable via ENV variables
2854
- // They are only acessible from within the VTEX network, so they are not a security risk
2855
- const TRACE_COLLECTOR_URL = 'opentelemetry-collector.vtex.systems';
2856
- const TRACE_COLLECTOR_URL_DEV = 'opentelemetry-collector-beta.vtex.systems';
2857
- const LOG_COLLECTOR_URL = 'opentelemetry-collector.vtex.systems';
2858
- function getTelemetry(APIOptions, telemetryOptions) {
2859
- var _telemetryOptions$exp;
2860
- const honeycombCollectorOptions = {
2861
- url: (telemetryOptions == null ? void 0 : telemetryOptions.mode) === 'dev' ? TRACE_COLLECTOR_URL_DEV : TRACE_COLLECTOR_URL
2862
- };
2863
- const openSearchCollectorOptions = {
2864
- url: LOG_COLLECTOR_URL
2865
- };
2866
- // Create a new tracer provider
2867
- const tracerProvider = new sdkTraceBase.BasicTracerProvider({
2868
- resource: new resources.Resource({
2869
- 'service.name': 'faststore-api',
2870
- 'service.version': FASTSTORE_API_VERSION,
2871
- 'service.name_and_version': `faststore-api@${FASTSTORE_API_VERSION}`,
2872
- platform: APIOptions.platform,
2873
- [`${APIOptions.platform}.account`]: APIOptions.account,
2874
- [`${APIOptions.platform}.environment`]: APIOptions.environment,
2875
- // TODO: include the following properties in the logs
2876
- // [`${APIOptions.platform}.options.hideUnavailableItems`]:
2877
- // APIOptions.hideUnavailableItems,
2878
- // [`${APIOptions.platform}.flags.enableOrderFormSync`]:
2879
- // APIOptions.flags?.enableOrderFormSync,
2880
- // channel: APIOptions.channel,
2881
- locale: APIOptions.locale
2882
- })
2883
- });
2884
- const loggerProvider = new sdkLogs.LoggerProvider();
2885
- // Create trace exporter
2886
- const honeycombExporter = new exporterTraceOtlpGrpc.OTLPTraceExporter(honeycombCollectorOptions);
2887
- // Create log exporter
2888
- const openSearchExporter = new exporterLogsOtlpGrpc.OTLPLogsExporter(openSearchCollectorOptions);
2889
- // Set up a span processor to export spans to Honeycomb
2890
- const honeyCombSpanProcessor = new sdkTraceBase.SimpleSpanProcessor(honeycombExporter);
2891
- // Set up a log record processor to export spans to OpenSearch
2892
- const openSearchLogProcessor = new sdkLogs.SimpleLogRecordProcessor(openSearchExporter);
2893
- // Register the span processor with the tracer provider
2894
- tracerProvider.addSpanProcessor(honeyCombSpanProcessor);
2895
- // Register the log record processor with the log provider
2896
- loggerProvider.addLogRecordProcessor(openSearchLogProcessor);
2897
- if ((telemetryOptions == null ? void 0 : telemetryOptions.mode) === 'verbose' || (telemetryOptions == null ? void 0 : telemetryOptions.mode) === 'dev') {
2898
- // Set up a console exporter for verbose mode
2899
- const consoleExporter = new sdkTraceBase.ConsoleSpanExporter();
2900
- const verboseTraceProcessor = new sdkTraceBase.SimpleSpanProcessor(consoleExporter);
2901
- // Set up processors for verbose mode
2902
- const consoleLogExporter = new sdkLogs.ConsoleLogRecordExporter();
2903
- const veboseLogRecordExporter = new sdkLogs.SimpleLogRecordProcessor(consoleLogExporter);
2904
- tracerProvider.addSpanProcessor(verboseTraceProcessor);
2905
- loggerProvider.addLogRecordProcessor(veboseLogRecordExporter);
2906
- }
2907
- const useFaststoreTelemetry = getFaststoreTelemetryPlugin(
2908
- // The @opentelemetry/sdk-trace-base was renamed from @opentelemetry/tracing but the
2909
- // envelop plugin doesn't support this change yet. This causes the class type to be incompatible,
2910
- // even if they are the same. https://github.com/n1ru4l/envelop/issues/1610
2911
- tracerProvider, loggerProvider, 'faststore-api', (_telemetryOptions$exp = telemetryOptions == null ? void 0 : telemetryOptions.experimentalSendLogs) != null ? _telemetryOptions$exp : false);
2912
- return {
2913
- useFaststoreTelemetry
2914
- };
2915
- }
2916
-
2917
- const platforms = {
2918
- vtex: {
2919
- getResolvers: getResolvers,
2920
- getContextFactory: getContextFactory
2921
- }
2922
- };
2923
- const directives = [directive];
2924
- const getTypeDefs = () => [typeDefs, ...directives.map(d => d.typeDefs)];
2925
- const getResolvers$1 = options => platforms[options.platform].getResolvers(options);
2926
- const getContextFactory$1 = options => platforms[options.platform].getContextFactory(options);
2927
- const getSchema = async options => {
2928
- const schema$1 = schema.makeExecutableSchema({
2929
- resolvers: getResolvers$1(options),
2930
- typeDefs: getTypeDefs()
2931
- });
2932
- return directives.reduce((s, d) => d.transformer(s), schema$1);
2933
- };
2934
-
2935
- exports.BadRequestError = BadRequestError;
2936
- exports.NotFoundError = NotFoundError;
2937
- exports.getContextFactory = getContextFactory$1;
2938
- exports.getResolvers = getResolvers$1;
2939
- exports.getSchema = getSchema;
2940
- exports.getTelemetry = getTelemetry;
2941
- exports.getTypeDefs = getTypeDefs;
2942
- exports.isBadRequestError = isBadRequestError;
2943
- exports.isFastStoreError = isFastStoreError;
2944
- exports.isNotFoundError = isNotFoundError;
2945
- exports.stringifyCacheControl = stringify$1;
2946
- //# sourceMappingURL=api.cjs.development.js.map