@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
package/dist/api.esm.js DELETED
@@ -1,2932 +0,0 @@
1
- import { makeExecutableSchema } from '@graphql-tools/schema';
2
- import fetch from 'isomorphic-unfetch';
3
- import DataLoader from 'dataloader';
4
- import pLimit from 'p-limit';
5
- import sanitizeHtmlLib from 'sanitize-html';
6
- import deepEquals from 'fast-deep-equal';
7
- import crypto from 'crypto';
8
- import { GraphQLScalarType, print, Kind as Kind$1 } from 'graphql';
9
- import { Kind } from 'graphql/language';
10
- import { mapSchema, MapperKind, getDirective } from '@graphql-tools/utils';
11
- import { BasicTracerProvider, SimpleSpanProcessor, ConsoleSpanExporter } from '@opentelemetry/sdk-trace-base';
12
- import { Resource } from '@opentelemetry/resources';
13
- import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';
14
- import { LoggerProvider, SimpleLogRecordProcessor, ConsoleLogRecordExporter } from '@opentelemetry/sdk-logs';
15
- import { OTLPLogsExporter } from '@opentelemetry/exporter-logs-otlp-grpc';
16
- import { isAsyncIterable } from '@envelop/core';
17
- import { useOnResolve } from '@envelop/on-resolve';
18
- import { trace, context, SpanKind } from '@opentelemetry/api';
19
- import { SeverityNumber } from '@opentelemetry/api-logs';
20
-
21
- var name = "@faststore/api";
22
- var version = "2.2.38";
23
- var license = "MIT";
24
- var main = "dist/index.js";
25
- var typings = "dist/index.d.ts";
26
- var module = "dist/api.esm.js";
27
- var repository = "vtex/faststore";
28
- var files = [
29
- "dist",
30
- "src"
31
- ];
32
- var browserslist = "node 12";
33
- var engines = {
34
- node: ">=12"
35
- };
36
- var scripts = {
37
- dev: "concurrently \"yarn generate -w\" \"tsdx watch\"",
38
- "dev:server": "tsdx watch --entry ./local/server.ts --target node --onSuccess \"node ./dist\"",
39
- build: "graphql-codegen --config codegen.yml && tsdx build",
40
- lint: "eslint src/**/*.ts",
41
- test: "tsdx test",
42
- generate: "graphql-codegen --config codegen.yml"
43
- };
44
- var dependencies = {
45
- "@envelop/on-resolve": "^2.0.6",
46
- "@graphql-tools/schema": "^9.0.0",
47
- "@opentelemetry/exporter-logs-otlp-grpc": "^0.39.1",
48
- "@opentelemetry/exporter-trace-otlp-grpc": "^0.39.1",
49
- "@opentelemetry/sdk-logs": "^0.39.1",
50
- "@opentelemetry/sdk-trace-base": "^1.13.0",
51
- "@rollup/plugin-graphql": "^1.0.0",
52
- dataloader: "^2.1.0",
53
- "fast-deep-equal": "^3.1.3",
54
- "isomorphic-unfetch": "^3.1.0",
55
- "p-limit": "^3.1.0",
56
- "sanitize-html": "^2.11.0"
57
- };
58
- var devDependencies = {
59
- "@envelop/core": "^2.6.0",
60
- "@faststore/eslint-config": "^2.2.38",
61
- "@faststore/shared": "^2.2.38",
62
- "@graphql-codegen/cli": "2.2.0",
63
- "@graphql-codegen/typescript": "2.2.2",
64
- "@types/express": "^4.17.16",
65
- "@types/sanitize-html": "^2.9.1",
66
- concurrently: "^6.2.1",
67
- eslint: "7.32.0",
68
- express: "^4.17.3",
69
- "express-graphql": "^0.12.0",
70
- graphql: "^15.6.0",
71
- "jest-transform-graphql": "^2.1.0",
72
- "ts-jest": "25.5.1",
73
- tsdx: "^0.14.1",
74
- tslib: "^2.3.1",
75
- typescript: "^4.4.2"
76
- };
77
- var peerDependencies = {
78
- "@envelop/core": "^1 || ^2",
79
- graphql: "^15.6.0"
80
- };
81
- var packageJson = {
82
- name: name,
83
- version: version,
84
- license: license,
85
- main: main,
86
- typings: typings,
87
- module: module,
88
- repository: repository,
89
- files: files,
90
- browserslist: browserslist,
91
- engines: engines,
92
- scripts: scripts,
93
- dependencies: dependencies,
94
- devDependencies: devDependencies,
95
- peerDependencies: peerDependencies
96
- };
97
-
98
- const USER_AGENT = `${packageJson.name}@${packageJson.version}`;
99
- const fetchAPI = async (info, init) => {
100
- const response = await fetch(info, {
101
- ...init,
102
- headers: {
103
- ...(init == null ? void 0 : init.headers),
104
- 'User-Agent': USER_AGENT
105
- }
106
- });
107
- if (response.ok) {
108
- return response.status !== 204 ? response.json() : undefined;
109
- }
110
- console.error(info, init, response);
111
- const text = await response.text();
112
- throw new Error(text);
113
- };
114
-
115
- const BASE_INIT = {
116
- method: 'POST',
117
- headers: {
118
- 'content-type': 'application/json'
119
- }
120
- };
121
- const VtexCommerce = ({
122
- account,
123
- environment,
124
- incrementAddress
125
- }, ctx) => {
126
- const base = `https://${account}.${environment}.com.br`;
127
- return {
128
- catalog: {
129
- salesChannel: sc => fetchAPI(`${base}/api/catalog_system/pub/saleschannel/${sc}`),
130
- brand: {
131
- list: () => fetchAPI(`${base}/api/catalog_system/pub/brand/list`)
132
- },
133
- category: {
134
- tree: (depth = 3) => fetchAPI(`${base}/api/catalog_system/pub/category/tree/${depth}`)
135
- },
136
- portal: {
137
- pagetype: slug => fetchAPI(`${base}/api/catalog_system/pub/portal/pagetype/${slug}`)
138
- },
139
- products: {
140
- crossselling: ({
141
- type,
142
- productId,
143
- groupByProduct = true
144
- }) => {
145
- const params = new URLSearchParams({
146
- sc: ctx.storage.channel.salesChannel,
147
- groupByProduct: groupByProduct.toString()
148
- });
149
- return fetchAPI(`${base}/api/catalog_system/pub/products/crossselling/${type}/${productId}?${params}`);
150
- }
151
- }
152
- },
153
- checkout: {
154
- simulation: (args, {
155
- salesChannel
156
- } = ctx.storage.channel) => {
157
- const params = new URLSearchParams({
158
- sc: salesChannel
159
- });
160
- return fetchAPI(`${base}/api/checkout/pub/orderForms/simulation?${params.toString()}`, {
161
- ...BASE_INIT,
162
- body: JSON.stringify(args)
163
- });
164
- },
165
- shippingData: ({
166
- id,
167
- index,
168
- deliveryMode,
169
- selectedAddresses
170
- }, setDeliveryWindow) => {
171
- var _deliveryMode$deliver, _deliveryMode$deliver2;
172
- const deliveryWindow = setDeliveryWindow ? {
173
- startDateUtc: deliveryMode == null ? void 0 : (_deliveryMode$deliver = deliveryMode.deliveryWindow) == null ? void 0 : _deliveryMode$deliver.startDate,
174
- endDateUtc: deliveryMode == null ? void 0 : (_deliveryMode$deliver2 = deliveryMode.deliveryWindow) == null ? void 0 : _deliveryMode$deliver2.endDate
175
- } : null;
176
- const mappedBody = {
177
- logisticsInfo: Array.from({
178
- length: index
179
- }, (_, itemIndex) => ({
180
- itemIndex,
181
- selectedDeliveryChannel: (deliveryMode == null ? void 0 : deliveryMode.deliveryChannel) || null,
182
- selectedSla: (deliveryMode == null ? void 0 : deliveryMode.deliveryMethod) || null,
183
- deliveryWindow: deliveryWindow
184
- })),
185
- selectedAddresses: selectedAddresses,
186
- clearAddressIfPostalCodeNotFound: incrementAddress
187
- };
188
- return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/attachments/shippingData`, {
189
- ...BASE_INIT,
190
- body: JSON.stringify(mappedBody),
191
- headers: {
192
- 'content-type': 'application/json',
193
- cookie: ctx.headers.cookie
194
- }
195
- });
196
- },
197
- orderForm: ({
198
- id,
199
- refreshOutdatedData = true,
200
- channel = ctx.storage.channel
201
- }) => {
202
- const {
203
- salesChannel
204
- } = channel;
205
- const params = new URLSearchParams({
206
- refreshOutdatedData: refreshOutdatedData.toString(),
207
- sc: salesChannel
208
- });
209
- const requestInit = ctx.headers ? {
210
- ...BASE_INIT,
211
- headers: {
212
- 'content-type': 'application/json',
213
- cookie: ctx.headers.cookie
214
- }
215
- } : BASE_INIT;
216
- return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}?${params.toString()}`, requestInit);
217
- },
218
- clearOrderFormMessages: ({
219
- id
220
- }) => {
221
- return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/messages/clear`, {
222
- ...BASE_INIT,
223
- body: '{}'
224
- });
225
- },
226
- updateOrderFormItems: ({
227
- id,
228
- orderItems,
229
- allowOutdatedData = 'paymentData',
230
- salesChannel = ctx.storage.channel.salesChannel,
231
- shouldSplitItem = true
232
- }) => {
233
- const params = new URLSearchParams({
234
- allowOutdatedData,
235
- sc: salesChannel
236
- });
237
- const items = JSON.stringify({
238
- orderItems,
239
- noSplitItem: !shouldSplitItem
240
- });
241
- const requestInit = ctx.headers ? {
242
- headers: {
243
- 'content-type': 'application/json',
244
- cookie: ctx.headers.cookie
245
- },
246
- body: items,
247
- method: 'PATCH'
248
- } : {
249
- headers: {
250
- 'content-type': 'application/json'
251
- },
252
- body: items,
253
- method: 'PATCH'
254
- };
255
- return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/items?${params}`, requestInit);
256
- },
257
- setCustomData: ({
258
- id,
259
- appId,
260
- key,
261
- value
262
- }) => {
263
- return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/customData/${appId}/${key}`, {
264
- ...BASE_INIT,
265
- body: JSON.stringify({
266
- value
267
- }),
268
- method: 'PUT'
269
- });
270
- },
271
- region: async ({
272
- postalCode,
273
- geoCoordinates,
274
- country,
275
- salesChannel
276
- }) => {
277
- const params = new URLSearchParams({
278
- country: country,
279
- sc: salesChannel != null ? salesChannel : ''
280
- });
281
- postalCode ? params.append('postalCode', postalCode) : params.append('geoCoordinates', `${geoCoordinates == null ? void 0 : geoCoordinates.longitude};${geoCoordinates == null ? void 0 : geoCoordinates.latitude}`);
282
- const url = `${base}/api/checkout/pub/regions/?${params.toString()}`;
283
- return fetchAPI(url);
284
- },
285
- address: async ({
286
- postalCode,
287
- country
288
- }) => {
289
- return fetchAPI(`${base}/api/checkout/pub/postal-code/${country}/${postalCode}`);
290
- }
291
- },
292
- session: search => {
293
- const params = new URLSearchParams(search);
294
- params.set('items', 'profile.id,profile.email,profile.firstName,profile.lastName,store.channel,store.countryCode,store.cultureInfo,store.currencyCode,store.currencySymbol');
295
- return fetchAPI(`${base}/api/sessions?${params.toString()}`, {
296
- method: 'POST',
297
- headers: {
298
- 'content-type': 'application/json',
299
- cookie: ctx.headers.cookie
300
- },
301
- body: '{}'
302
- });
303
- },
304
- subscribeToNewsletter: data => {
305
- return fetchAPI(`${base}/api/dataentities/NL/documents/`, {
306
- ...BASE_INIT,
307
- body: JSON.stringify({
308
- ...data,
309
- isNewsletterOptIn: true
310
- }),
311
- method: 'PATCH'
312
- });
313
- }
314
- };
315
- };
316
-
317
- const POLICY_KEY = 'trade-policy';
318
- const REGION_KEY = 'region-id';
319
- const CHANNEL_KEYS = /*#__PURE__*/new Set([POLICY_KEY, REGION_KEY]);
320
- const IntelligentSearch = ({
321
- account,
322
- environment,
323
- hideUnavailableItems
324
- }, ctx) => {
325
- const base = `https://${account}.${environment}.com.br/api/io`;
326
- const getPolicyFacet = () => {
327
- const {
328
- salesChannel
329
- } = ctx.storage.channel;
330
- if (!salesChannel) {
331
- return null;
332
- }
333
- return {
334
- key: POLICY_KEY,
335
- value: salesChannel
336
- };
337
- };
338
- const getRegionFacet = () => {
339
- const {
340
- regionId,
341
- seller
342
- } = ctx.storage.channel;
343
- const sellerRegionId = seller ? Buffer.from(`SW#${seller}`).toString('base64') : null;
344
- const facet = sellerRegionId != null ? sellerRegionId : regionId;
345
- if (!facet) {
346
- return null;
347
- }
348
- return {
349
- key: REGION_KEY,
350
- value: facet
351
- };
352
- };
353
- const addDefaultFacets = facets => {
354
- var _facets$find, _facets$find2;
355
- const withDefaultFacets = facets.filter(({
356
- key
357
- }) => !CHANNEL_KEYS.has(key));
358
- const policyFacet = (_facets$find = facets.find(({
359
- key
360
- }) => key === POLICY_KEY)) != null ? _facets$find : getPolicyFacet();
361
- const regionFacet = (_facets$find2 = facets.find(({
362
- key
363
- }) => key === REGION_KEY)) != null ? _facets$find2 : getRegionFacet();
364
- if (policyFacet !== null) {
365
- withDefaultFacets.push(policyFacet);
366
- }
367
- if (regionFacet !== null) {
368
- withDefaultFacets.push(regionFacet);
369
- }
370
- return withDefaultFacets;
371
- };
372
- const search = ({
373
- query = '',
374
- page,
375
- count,
376
- sort = '',
377
- selectedFacets = [],
378
- type,
379
- fuzzy = 'auto'
380
- }) => {
381
- const params = new URLSearchParams({
382
- page: (page + 1).toString(),
383
- count: count.toString(),
384
- query,
385
- sort,
386
- fuzzy,
387
- locale: ctx.storage.locale
388
- });
389
- if (hideUnavailableItems !== undefined) {
390
- params.append('hideUnavailableItems', hideUnavailableItems.toString());
391
- }
392
- const pathname = addDefaultFacets(selectedFacets).map(({
393
- key,
394
- value
395
- }) => `${key}/${value}`).join('/');
396
- return fetchAPI(`${base}/_v/api/intelligent-search/${type}/${pathname}?${params.toString()}`);
397
- };
398
- const products = args => search({
399
- ...args,
400
- type: 'product_search'
401
- });
402
- const suggestedTerms = args => {
403
- var _args$query$toString, _args$query;
404
- const params = new URLSearchParams({
405
- query: (_args$query$toString = (_args$query = args.query) == null ? void 0 : _args$query.toString()) != null ? _args$query$toString : '',
406
- locale: ctx.storage.locale
407
- });
408
- return fetchAPI(`${base}/_v/api/intelligent-search/search_suggestions?${params.toString()}`);
409
- };
410
- const topSearches = () => {
411
- const params = new URLSearchParams({
412
- locale: ctx.storage.locale
413
- });
414
- return fetchAPI(`${base}/_v/api/intelligent-search/top_searches?${params.toString()}`);
415
- };
416
- const facets = args => search({
417
- ...args,
418
- type: 'facets'
419
- });
420
- return {
421
- facets,
422
- products,
423
- suggestedTerms,
424
- topSearches
425
- };
426
- };
427
-
428
- /**
429
- * Client for SP, Intelligent search's analytics event API
430
- * More info at: https://www.notion.so/vtexhandbook/Event-API-Documentation-48eee26730cf4d7f80f8fd7262231f84
431
- */
432
- const THIRTY_MINUTES_S = 30 * 60;
433
- const ONE_YEAR_S = 365 * 24 * 3600;
434
- const randomUUID = () => (Math.random() * 1e6).toFixed(0);
435
- const timelapsed = past => (Date.now() - past) / 1e3;
436
- const createId = expiresSecond => {
437
- let payload = randomUUID();
438
- let createdAt = Date.now();
439
- return () => {
440
- if (timelapsed(createdAt) > expiresSecond) {
441
- payload = randomUUID();
442
- createdAt = Date.now();
443
- }
444
- return payload;
445
- };
446
- };
447
- const user = {
448
- anonymous: /*#__PURE__*/createId(ONE_YEAR_S),
449
- session: /*#__PURE__*/createId(THIRTY_MINUTES_S)
450
- };
451
- const SP = ({
452
- account
453
- }, _) => {
454
- const base = `https://sp.vtex.com/event-api/v1/${account}/event`;
455
- const sendEvent = options => {
456
- return fetchAPI(base, {
457
- method: 'POST',
458
- body: JSON.stringify({
459
- ...options,
460
- agent: '@faststore/api',
461
- anonymous: user.anonymous(),
462
- session: user.session()
463
- }),
464
- headers: {
465
- 'content-type': 'application/json'
466
- }
467
- });
468
- };
469
- return {
470
- sendEvent
471
- };
472
- };
473
-
474
- const getClients = (options, ctx) => {
475
- const search = IntelligentSearch(options, ctx);
476
- const commerce = VtexCommerce(options, ctx);
477
- const sp = SP(options);
478
- return {
479
- search,
480
- commerce,
481
- sp
482
- };
483
- };
484
-
485
- const getSalesChannelLoader = (_, clients) => {
486
- const loader = async channels => Promise.all(channels.map(sc => clients.commerce.catalog.salesChannel(sc)));
487
- return new DataLoader(loader);
488
- };
489
-
490
- // Limits concurrent requests to the API per request cycle
491
- const CONCURRENT_REQUESTS_MAX = 1;
492
- const getSimulationLoader = (_, clients) => {
493
- const limit = pLimit(CONCURRENT_REQUESTS_MAX);
494
- const loader = async simulationArgs => {
495
- const allItems = simulationArgs.reduce((acc, {
496
- items
497
- }) => {
498
- return [...acc, items];
499
- }, []);
500
- const items = [...allItems.flat()];
501
- const simulation = await clients.commerce.checkout.simulation({
502
- country: simulationArgs[0].country,
503
- postalCode: simulationArgs[0].postalCode,
504
- items
505
- });
506
- // Sort and filter simulation since Checkout API may return
507
- // items that we didn't ask for
508
- const simulated = simulation.items.reduce((acc, item) => {
509
- const index = item.requestIndex;
510
- if (typeof index === 'number' && index < acc.length) {
511
- acc[index] = item;
512
- }
513
- return acc;
514
- }, Array(items.length).fill(null));
515
- const itemsIndices = allItems.reduce((acc, curr) => [...acc, curr.length + acc[acc.length - 1]], [0]);
516
- return allItems.map((__, index) => ({
517
- ...simulation,
518
- items: simulated.slice(itemsIndices[index], itemsIndices[index + 1]).filter(item => Boolean(item))
519
- }));
520
- };
521
- const limited = async allItems => limit(loader, allItems);
522
- return new DataLoader(limited, {
523
- maxBatchSize: 50
524
- });
525
- };
526
-
527
- /**
528
- * For now, we're using sanitize-html's default set
529
- * of allowed tags and attributes, which don't even include img elements
530
- *
531
- * It is known many client depends on pontentially vulnerable tags, such as script tags
532
- * We chose to be restrictive at first, and document those restrictions later.
533
- *
534
- * When expanding the set of allowed tags and attributes, please consider performance, privacy and security.
535
- *
536
- * This possibily breaks compatibility with Portal and Store Framework,
537
- * which both allows an enormous amount of tags and attributes
538
- *
539
- * This was a thoughtful decision that can be reviewed in the future given
540
- * research was made to back up those changes.
541
- */
542
- const sanitizeHtml = (dirty, options) => sanitizeHtmlLib(dirty, options);
543
-
544
- function sanitizeProduct(product) {
545
- return {
546
- ...product,
547
- description: product.description ? sanitizeHtml(product.description) : product.description
548
- };
549
- }
550
- const enhanceSku = (item, product) => ({
551
- ...item,
552
- isVariantOf: sanitizeProduct(product)
553
- });
554
-
555
- class FastStoreError extends Error {
556
- constructor(extensions, message) {
557
- super(message);
558
- this.extensions = extensions;
559
- this.name = 'FastStoreError';
560
- }
561
- }
562
- class BadRequestError extends FastStoreError {
563
- constructor(message) {
564
- super({
565
- status: 400,
566
- type: 'BadRequestError'
567
- }, message);
568
- }
569
- }
570
- class NotFoundError extends FastStoreError {
571
- constructor(message) {
572
- super({
573
- status: 404,
574
- type: 'NotFoundError'
575
- }, message);
576
- }
577
- }
578
- const isFastStoreError = error => (error == null ? void 0 : error.name) === 'FastStoreError';
579
- const isNotFoundError = error => {
580
- var _error$extensions;
581
- return (error == null ? void 0 : (_error$extensions = error.extensions) == null ? void 0 : _error$extensions.type) === 'NotFoundError';
582
- };
583
- const isBadRequestError = error => {
584
- var _error$extensions2;
585
- return (error == null ? void 0 : (_error$extensions2 = error.extensions) == null ? void 0 : _error$extensions2.type) === 'BadRequestError';
586
- };
587
-
588
- const getSkuLoader = (_, clients) => {
589
- const loader = async skuIds => {
590
- const {
591
- products
592
- } = await clients.search.products({
593
- query: `sku:${skuIds.join(';')}`,
594
- page: 0,
595
- count: skuIds.length
596
- });
597
- const skuBySkuId = products.reduce((acc, product) => {
598
- for (const sku of product.items) {
599
- acc[sku.itemId] = enhanceSku(sku, product);
600
- }
601
- return acc;
602
- }, {});
603
- const skus = skuIds.map(skuId => skuBySkuId[skuId]);
604
- const missingSkus = skuIds.filter(skuId => !skuBySkuId[skuId]);
605
- if (missingSkus.length > 0) {
606
- throw new NotFoundError(`Search API did not found the following skus: ${missingSkus.join(',')}`);
607
- }
608
- return skus;
609
- };
610
- return new DataLoader(loader, {
611
- maxBatchSize: 99
612
- });
613
- };
614
-
615
- // Limits concurrent requests to 20 so that they don't timeout
616
- const CONCURRENT_REQUESTS_MAX$1 = 20;
617
- const collectionPageTypes = /*#__PURE__*/new Set(['brand', 'category', 'department', 'subcategory', 'collection', 'cluster']);
618
- const isCollectionPageType = x => typeof x.pageType === 'string' && collectionPageTypes.has(x.pageType.toLowerCase());
619
- const getCollectionLoader = (_, clients) => {
620
- const limit = pLimit(CONCURRENT_REQUESTS_MAX$1);
621
- const loader = async slugs => {
622
- return Promise.all(slugs.map(slug => limit(async () => {
623
- const page = await clients.commerce.catalog.portal.pagetype(slug);
624
- if (isCollectionPageType(page)) {
625
- return page;
626
- }
627
- 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.`);
628
- })));
629
- };
630
- return new DataLoader(loader, {
631
- // DataLoader is being used to cache requests, not to batch them
632
- batch: false
633
- });
634
- };
635
-
636
- const getLoaders = (options, {
637
- clients
638
- }) => {
639
- const skuLoader = getSkuLoader(options, clients);
640
- const simulationLoader = getSimulationLoader(options, clients);
641
- const collectionLoader = getCollectionLoader(options, clients);
642
- const salesChannelLoader = getSalesChannelLoader(options, clients);
643
- return {
644
- skuLoader,
645
- simulationLoader,
646
- collectionLoader,
647
- salesChannelLoader
648
- };
649
- };
650
-
651
- const inStock = offer => offer.AvailableQuantity > 0;
652
- const price = offer => {
653
- var _offer$spotPrice;
654
- return (_offer$spotPrice = offer.spotPrice) != null ? _offer$spotPrice : 0;
655
- };
656
- const sellingPrice = offer => {
657
- var _offer$Price;
658
- return (_offer$Price = offer.Price) != null ? _offer$Price : 0;
659
- };
660
- const availability = available => available ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock';
661
- // Smallest Available Spot Price First
662
- const bestOfferFirst = (a, b) => {
663
- if (inStock(a) && !inStock(b)) {
664
- return -1;
665
- }
666
- if (!inStock(a) && inStock(b)) {
667
- return 1;
668
- }
669
- return price(a) - price(b);
670
- };
671
- const inStockOrderFormItem = itemAvailability => itemAvailability === 'available';
672
-
673
- const StoreAggregateOffer = {
674
- highPrice: offers => {
675
- const availableOffers = offers.filter(inStock);
676
- const highOffer = availableOffers[availableOffers.length - 1];
677
- return highOffer != null ? price(highOffer) : 0;
678
- },
679
- lowPrice: offers => {
680
- const [lowOffer] = offers.filter(inStock);
681
- return lowOffer ? price(lowOffer) : 0;
682
- },
683
- offerCount: offers => offers.length,
684
- priceCurrency: async (_, __, ctx) => {
685
- var _sc$CurrencyCode;
686
- const {
687
- loaders: {
688
- salesChannelLoader
689
- },
690
- storage: {
691
- channel
692
- }
693
- } = ctx;
694
- const sc = await salesChannelLoader.load(channel.salesChannel);
695
- return (_sc$CurrencyCode = sc.CurrencyCode) != null ? _sc$CurrencyCode : '';
696
- },
697
- offers: offers => offers
698
- };
699
-
700
- // TODO: Add a review system integration
701
- const StoreAggregateRating = {
702
- ratingValue: () => 5,
703
- reviewCount: () => 0
704
- };
705
-
706
- /**
707
- * VTEX catalog slugify function
708
- *
709
- * Copied from:
710
- * https://github.com/vtex/rewriter/blob/1ce2010783e0586cab42534ce2fb7a983d8a3a84/node/clients/catalog.ts#L72
711
- *
712
- * Sometimes, we need to slugify strings for creating urls. An example is the
713
- * brand urls, where we create them from the brand's name.
714
- * This slugify function should match exactly what VTEX catalog generates. Any mismatch
715
- * will lead to broken links.
716
- * Hopefully, we had this function implemented on VTEX IO and we've been using it for
717
- * years now. However, looking at the code, I think we can save lots of computing. I'm
718
- * in a hurry for doing these tests now, so I'll leave a small TODO.
719
- *
720
- * TODO: Research for better ways of computing this slugify function. Things I'd try are:
721
- * - Join those 3 regexs for special characters into a single one.
722
- * - Replace the regexp of `removeDiacritics` function with a Map. We can make the complexity
723
- * of this function be O(n) with n=string.length
724
- *
725
- */
726
- const from = 'ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a';
727
- const to = 'AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa';
728
- const removeDiacritics = str => {
729
- let newStr = str.slice(0);
730
- for (let i = 0; i < from.length; i++) {
731
- newStr = newStr.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
732
- }
733
- return newStr;
734
- };
735
- const slugifySpecialCharacters = str => {
736
- return str.replace(/[·/_,:]/, '-');
737
- };
738
- function slugify(str) {
739
- const noCommas = str.replace(/,/g, '');
740
- const replaced = noCommas.replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, '-');
741
- const slugified = slugifySpecialCharacters(removeDiacritics(replaced));
742
- return slugified.toLowerCase();
743
- }
744
-
745
- const isBrand = x => x.type === 'brand' || isCollectionPageType(x) && x.pageType.toLowerCase() === 'brand';
746
- const isCollection = x => isCollectionPageType(x) && x.pageType.toLowerCase() === 'collection';
747
- const slugifyRoot = root => {
748
- if (isBrand(root) || isCollection(root)) {
749
- return slugify(root.name);
750
- }
751
- if (isCollectionPageType(root)) {
752
- return new URL(`https://${root.url}`).pathname.slice(1).toLowerCase();
753
- }
754
- return new URL(root.url).pathname.slice(1).toLowerCase();
755
- };
756
- const StoreCollection = {
757
- id: ({
758
- id
759
- }) => id.toString(),
760
- slug: root => slugifyRoot(root),
761
- seo: root => isBrand(root) || isCollectionPageType(root) ? {
762
- title: root.title,
763
- description: root.metaTagDescription
764
- } : {
765
- title: root.Title,
766
- description: root.MetaTagDescription
767
- },
768
- type: root => isBrand(root) ? 'Brand' : isCollectionPageType(root) ? root.pageType : root.level === 0 ? 'Department' : 'Category',
769
- meta: root => {
770
- const slug = slugifyRoot(root);
771
- return isBrand(root) ? {
772
- selectedFacets: [{
773
- key: 'brand',
774
- value: slug
775
- }]
776
- } : isCollection(root) ? {
777
- selectedFacets: [{
778
- key: 'productclusterids',
779
- value: root.id
780
- }]
781
- } : {
782
- selectedFacets: slug.split('/').map((segment, index) => ({
783
- key: `category-${index + 1}`,
784
- value: segment
785
- }))
786
- };
787
- },
788
- breadcrumbList: async (root, _, ctx) => {
789
- const {
790
- loaders: {
791
- collectionLoader
792
- }
793
- } = ctx;
794
- const slug = slugifyRoot(root);
795
- /**
796
- * Split slug into segments so we fetch all data for
797
- * the breadcrumb. For instance, if we get `/foo/bar`
798
- * we need all metadata for both `/foo` and `/bar` and
799
- * thus we need to fetch pageType for `/foo` and `/bar`
800
- */
801
- const segments = slug.split('/').filter(segment => Boolean(segment));
802
- const slugs = segments.map((__, index) => segments.slice(0, index + 1).join('/'));
803
- const collections = await Promise.all(slugs.map(async s => {
804
- const collection = await collectionLoader.load(s);
805
- return {
806
- slug: s,
807
- ...collection
808
- };
809
- }));
810
- return {
811
- itemListElement: collections.map((collection, index) => ({
812
- item: isCollection(collection) ? `/${collection.slug}` : new URL(`https://${collection.url}`).pathname.toLowerCase(),
813
- name: collection.name,
814
- position: index + 1
815
- })),
816
- numberOfItems: collections.length
817
- };
818
- }
819
- };
820
-
821
- const FACET_CROSS_SELLING_MAP = {
822
- buy: "whoboughtalsobought",
823
- view: "whosawalsosaw",
824
- similars: "similars",
825
- viewAndBought: "whosawalsobought",
826
- accessories: "accessories",
827
- suggestions: "suggestions"
828
- };
829
- /**
830
- * Transform facets from the store to VTEX platform facets.
831
- * For instance, the channel in Store becomes trade-policy and regionId in VTEX's realm
832
- * */
833
- const transformSelectedFacet = ({
834
- key,
835
- value
836
- }) => {
837
- switch (key) {
838
- case 'price':
839
- {
840
- return {
841
- key,
842
- value: value.replace('-to-', ':')
843
- };
844
- }
845
- case 'channel':
846
- case 'locale':
847
- case "buy":
848
- case "view":
849
- case "similars":
850
- case "viewAndBought":
851
- case "accessories":
852
- case "suggestions":
853
- {
854
- return []; // remove this facet from search
855
- }
856
-
857
- default:
858
- return {
859
- key,
860
- value
861
- };
862
- }
863
- };
864
- const parseRange = range => {
865
- const splitted = range.split(':').map(Number);
866
- if (splitted.length !== 2 || Number.isNaN(splitted[0]) || Number.isNaN(splitted[1])) {
867
- return null;
868
- }
869
- return splitted;
870
- };
871
- const isCrossSelling = x => typeof FACET_CROSS_SELLING_MAP[x] === "string";
872
- const findCrossSelling = facets => {
873
- var _filtered$;
874
- const filtered = facets == null ? void 0 : facets.filter(x => isCrossSelling(x.key));
875
- if (Array.isArray(filtered) && filtered.length > 1) {
876
- 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(',')}`);
877
- }
878
- return (_filtered$ = filtered == null ? void 0 : filtered[0]) != null ? _filtered$ : null;
879
- };
880
- const findSlug = facets => {
881
- var _facets$find$value, _facets$find;
882
- 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;
883
- };
884
- const findSkuId = facets => {
885
- var _facets$find$value2, _facets$find2;
886
- 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;
887
- };
888
- const findLocale = facets => {
889
- var _facets$find$value3, _facets$find3;
890
- 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;
891
- };
892
- const findChannel = facets => {
893
- var _facets$find$value4, _facets$find4;
894
- 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;
895
- };
896
-
897
- /**
898
- * More info at: https://en.wikipedia.org/wiki/Order_statistic
899
- */
900
- // O(n) search to find the max of an array
901
- const min = (array, cmp) => {
902
- let best = 0;
903
- for (let curr = 1; curr < array.length; curr++) {
904
- if (cmp(array[best], array[curr]) > 0) {
905
- best = curr;
906
- }
907
- }
908
- return array[best];
909
- };
910
-
911
- const StoreFacet = {
912
- __resolveType: ({
913
- type
914
- }) => type === 'TEXT' ? 'StoreFacetBoolean' : 'StoreFacetRange'
915
- };
916
- const StoreFacetBoolean = {
917
- key: ({
918
- key
919
- }) => key,
920
- label: ({
921
- name
922
- }) => name,
923
- values: ({
924
- values
925
- }) => values.sort((a, b) => a.name.localeCompare(b.name))
926
- };
927
- const StoreFacetRange = {
928
- key: ({
929
- key
930
- }) => key,
931
- label: ({
932
- name
933
- }) => name,
934
- min: ({
935
- values,
936
- key
937
- }, _, {
938
- storage: {
939
- searchArgs
940
- }
941
- }) => {
942
- var _searchArgs$selectedF, _searchArgs$selectedF2, _searchArgs$selectedF3, _facet$range$from, _selectedRange$;
943
- /**
944
- * Fetch the selected range the user queried.
945
- *
946
- * This is necessary because, differently from boolean facets, Search API does
947
- * not return the selected values, making us have to implement it in here
948
- */
949
- 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 : '');
950
- const facet = min(values, (a, b) => a.range.from - b.range.from);
951
- const globalMin = (_facet$range$from = facet == null ? void 0 : facet.range.from) != null ? _facet$range$from : 0;
952
- return {
953
- selected: (_selectedRange$ = selectedRange == null ? void 0 : selectedRange[0]) != null ? _selectedRange$ : globalMin,
954
- absolute: globalMin
955
- };
956
- },
957
- max: ({
958
- values,
959
- key
960
- }, _, {
961
- storage: {
962
- searchArgs
963
- }
964
- }) => {
965
- var _searchArgs$selectedF4, _searchArgs$selectedF5, _searchArgs$selectedF6, _facet$range$to, _selectedRange$2;
966
- /**
967
- * Fetch the selected range the user queried.
968
- *
969
- * This is necessary because, differently from boolean facets, Search API does
970
- * not return the selected values, making us have to implement it in here
971
- */
972
- 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 : '');
973
- const facet = min(values, (a, b) => b.range.to - a.range.to);
974
- const globalMax = (_facet$range$to = facet == null ? void 0 : facet.range.to) != null ? _facet$range$to : 0;
975
- return {
976
- selected: (_selectedRange$2 = selectedRange == null ? void 0 : selectedRange[1]) != null ? _selectedRange$2 : globalMax,
977
- absolute: globalMax
978
- };
979
- }
980
- };
981
-
982
- const StoreFacetValueBoolean = {
983
- value: ({
984
- value
985
- }) => value,
986
- label: ({
987
- name
988
- }) => name || 'unknown',
989
- selected: ({
990
- selected
991
- }) => selected,
992
- quantity: ({
993
- quantity
994
- }) => quantity
995
- };
996
-
997
- const subscribeToNewsletter = async (_, {
998
- data
999
- }, {
1000
- clients: {
1001
- commerce
1002
- }
1003
- }) => {
1004
- const response = await commerce.subscribeToNewsletter(data);
1005
- return {
1006
- id: response == null ? void 0 : response.Id
1007
- };
1008
- };
1009
-
1010
- class ChannelMarshal {
1011
- static parse(channelString) {
1012
- try {
1013
- var _parsedChannel$seller, _parsedChannel$region, _parsedChannel$salesC;
1014
- const parsedChannel = JSON.parse(channelString);
1015
- return {
1016
- seller: (_parsedChannel$seller = parsedChannel.seller) != null ? _parsedChannel$seller : '',
1017
- regionId: (_parsedChannel$region = parsedChannel.regionId) != null ? _parsedChannel$region : '',
1018
- salesChannel: (_parsedChannel$salesC = parsedChannel.salesChannel) != null ? _parsedChannel$salesC : ''
1019
- };
1020
- } catch (error) {
1021
- console.error(error);
1022
- throw new Error('Malformed channel string');
1023
- }
1024
- }
1025
- static stringify(channel) {
1026
- return JSON.stringify(channel);
1027
- }
1028
- }
1029
-
1030
- const mutateChannelContext = (ctx, channelString) => {
1031
- ctx.storage.channel = ChannelMarshal.parse(channelString);
1032
- };
1033
- const mutateLocaleContext = (ctx, locale) => {
1034
- ctx.storage.locale = locale;
1035
- };
1036
-
1037
- const md5 = payload => crypto.createHash('md5').update(payload).digest('hex');
1038
-
1039
- const VALUE_REFERENCES = {
1040
- attachment: 'ATTACHMENT',
1041
- specification: 'SPECIFICATION'
1042
- };
1043
- function attachmentToPropertyValue(attachment) {
1044
- return {
1045
- name: attachment.name,
1046
- value: attachment.content,
1047
- valueReference: VALUE_REFERENCES.attachment
1048
- };
1049
- }
1050
- function getPropertyId(item) {
1051
- return md5(`${item.name}:${JSON.stringify(item.value)}:${item.valueReference}`);
1052
- }
1053
-
1054
- const shouldUpdateShippingData = (orderForm, session) => {
1055
- var _orderForm$shippingDa, _orderForm$shippingDa2;
1056
- if (!hasSessionPostalCodeOrGeoCoordinates(session)) {
1057
- return {
1058
- updateShipping: false,
1059
- addressChanged: false
1060
- };
1061
- }
1062
- if (!hasItems(orderForm)) {
1063
- return {
1064
- updateShipping: false,
1065
- addressChanged: false
1066
- };
1067
- }
1068
- const [selectedAddress] = (_orderForm$shippingDa = orderForm == null ? void 0 : (_orderForm$shippingDa2 = orderForm.shippingData) == null ? void 0 : _orderForm$shippingDa2.selectedAddresses) != null ? _orderForm$shippingDa : [];
1069
- if (checkPostalCode(selectedAddress, session.postalCode) || checkGeoCoordinates(selectedAddress, session.geoCoordinates) || checkAddressType(selectedAddress, session.addressType)) {
1070
- return {
1071
- updateShipping: true,
1072
- addressChanged: true
1073
- };
1074
- }
1075
- // The logisticsInfo will always exist if there´s at least one item inside the cart
1076
- const {
1077
- logisticsInfo
1078
- } = orderForm.shippingData;
1079
- if (shouldUpdateDeliveryInfo(logisticsInfo, session)) {
1080
- return {
1081
- updateShipping: true,
1082
- addressChanged: false
1083
- };
1084
- }
1085
- return {
1086
- updateShipping: false,
1087
- addressChanged: false
1088
- };
1089
- };
1090
- // Validate if theres any postal Code or GeoCoordinates set at the session
1091
- const hasSessionPostalCodeOrGeoCoordinates = session => {
1092
- var _session$geoCoordinat, _session$geoCoordinat2;
1093
- return !!session.postalCode || ((_session$geoCoordinat = session.geoCoordinates) == null ? void 0 : _session$geoCoordinat.latitude) && ((_session$geoCoordinat2 = session.geoCoordinates) == null ? void 0 : _session$geoCoordinat2.longitude);
1094
- };
1095
- // Validate if theres a difference between the session postal code and orderForm postal code
1096
- const checkPostalCode = (address, postalCode) => {
1097
- return typeof postalCode === 'string' && (address == null ? void 0 : address.postalCode) !== postalCode;
1098
- };
1099
- // Validate if theres a difference between the session geoCoords and orderForm geoCoords
1100
- const checkGeoCoordinates = (address, geoCoordinates) => {
1101
- 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));
1102
- };
1103
- const checkAddressType = (address, addressType) => {
1104
- return typeof addressType === 'string' && (address == null ? void 0 : address.addressType) !== addressType;
1105
- };
1106
- // Validate if theres any item inside the orderForm
1107
- const hasItems = orderForm => {
1108
- return orderForm.items.length !== 0;
1109
- };
1110
- const shouldUpdateDeliveryInfo = (logisticsInfo, session) => {
1111
- var _session$deliveryMode, _session$deliveryMode2, _session$deliveryMode3;
1112
- const deliveryChannel = session == null ? void 0 : (_session$deliveryMode = session.deliveryMode) == null ? void 0 : _session$deliveryMode.deliveryChannel;
1113
- const deliveryMethod = session == null ? void 0 : (_session$deliveryMode2 = session.deliveryMode) == null ? void 0 : _session$deliveryMode2.deliveryMethod;
1114
- const {
1115
- startDate,
1116
- endDate
1117
- } = (session == null ? void 0 : (_session$deliveryMode3 = session.deliveryMode) == null ? void 0 : _session$deliveryMode3.deliveryWindow) || {};
1118
- return logisticsInfo.some(({
1119
- selectedDeliveryChannel,
1120
- selectedSla,
1121
- slas
1122
- }) => {
1123
- const checkDeliveryChannel = deliveryChannel && selectedDeliveryChannel !== deliveryChannel;
1124
- const checkDeliveryMethod = deliveryMethod && selectedSla !== deliveryMethod;
1125
- return slas == null ? void 0 : slas.some(sla => {
1126
- var _sla$deliveryWindow, _sla$deliveryWindow2, _sla$availableDeliver;
1127
- if (checkDeliveryChannel && sla.deliveryChannel === deliveryChannel || checkDeliveryMethod && sla.id === deliveryMethod) {
1128
- return true;
1129
- }
1130
- 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));
1131
- });
1132
- });
1133
- };
1134
-
1135
- const getAddressOrderForm = (orderForm, session, addressChanged) => {
1136
- var _orderForm$shippingDa, _orderForm$shippingDa2, _orderForm$shippingDa3, _orderForm$shippingDa4;
1137
- const postalCode = session.postalCode;
1138
- const geoCoordinates = session.geoCoordinates;
1139
- const availableAddresses = (_orderForm$shippingDa = orderForm == null ? void 0 : (_orderForm$shippingDa2 = orderForm.shippingData) == null ? void 0 : _orderForm$shippingDa2.availableAddresses) != null ? _orderForm$shippingDa : [];
1140
- const selectedAddresses = (_orderForm$shippingDa3 = orderForm == null ? void 0 : (_orderForm$shippingDa4 = orderForm.shippingData) == null ? void 0 : _orderForm$shippingDa4.selectedAddresses) != null ? _orderForm$shippingDa3 : [];
1141
- // Validate if no change for the address was made and the deliveryMode has changed we can return the address from the orderForm
1142
- if (!addressChanged && selectedAddresses.length > 0) {
1143
- return [selectedAddresses[0]];
1144
- }
1145
- // Validate if the address from the session already exists at the availableAddresses from the OrderForm to avoid duplication
1146
- if (addressChanged && availableAddresses.length > 0) {
1147
- for (const address of availableAddresses) {
1148
- if (postalCode && geoCoordinates) {
1149
- const addressMatcher = address.postalCode === postalCode || address.geoCoordinates[0] === geoCoordinates.longitude && address.geoCoordinates[1] === geoCoordinates.latitude;
1150
- if (addressMatcher) {
1151
- return [address];
1152
- }
1153
- }
1154
- if (postalCode && !geoCoordinates) {
1155
- const addressMatcher = address.postalCode === postalCode;
1156
- if (addressMatcher) {
1157
- return [address];
1158
- }
1159
- }
1160
- if (geoCoordinates && !postalCode) {
1161
- const addressMatcher = address.geoCoordinates[0] === geoCoordinates.longitude && address.geoCoordinates[1] === geoCoordinates.latitude;
1162
- if (addressMatcher) {
1163
- return [address];
1164
- }
1165
- }
1166
- }
1167
- }
1168
- return null;
1169
- };
1170
-
1171
- const createNewAddress = session => {
1172
- const postalCode = session.postalCode;
1173
- const geoCoordinates = session.geoCoordinates;
1174
- // If the address from the session has changed and it do not exist we will create the new one
1175
- const addressSession = {
1176
- addressType: session.addressType || null,
1177
- postalCode: postalCode || null,
1178
- city: null,
1179
- state: null,
1180
- country: session.country || null,
1181
- street: null,
1182
- number: null,
1183
- neighborhood: null,
1184
- complement: null,
1185
- reference: null,
1186
- geoCoordinates: []
1187
- };
1188
- if (geoCoordinates) {
1189
- const latitude = typeof geoCoordinates === 'object' && 'latitude' in geoCoordinates ? geoCoordinates.latitude : null;
1190
- const longitude = typeof geoCoordinates === 'object' && 'longitude' in geoCoordinates ? geoCoordinates.longitude : null;
1191
- addressSession.geoCoordinates = latitude !== null && longitude !== null ? [longitude, latitude] : [];
1192
- }
1193
- return [addressSession];
1194
- };
1195
-
1196
- const isAttachment = value => value.valueReference === VALUE_REFERENCES.attachment;
1197
- const getId = item => {
1198
- var _item$itemOffered$add;
1199
- 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('::');
1200
- };
1201
- const orderFormItemToOffer = (item, index) => ({
1202
- listPrice: item.listPrice / 100,
1203
- price: item.sellingPrice / 100,
1204
- quantity: item.quantity,
1205
- seller: {
1206
- identifier: item.seller
1207
- },
1208
- itemOffered: {
1209
- sku: item.id,
1210
- image: [],
1211
- name: item.name,
1212
- additionalProperty: item.attachments.map(attachmentToPropertyValue)
1213
- },
1214
- index
1215
- });
1216
- const offerToOrderItemInput = offer => {
1217
- var _offer$itemOffered$ad, _offer$itemOffered$ad2;
1218
- return {
1219
- quantity: offer.quantity,
1220
- seller: offer.seller.identifier,
1221
- id: offer.itemOffered.sku,
1222
- index: offer.index,
1223
- attachments: ((_offer$itemOffered$ad = (_offer$itemOffered$ad2 = offer.itemOffered.additionalProperty) == null ? void 0 : _offer$itemOffered$ad2.filter(isAttachment)) != null ? _offer$itemOffered$ad : []).map(attachment => ({
1224
- name: attachment.name,
1225
- content: attachment.value
1226
- }))
1227
- };
1228
- };
1229
- const groupById = offers => offers.reduce((acc, item) => {
1230
- var _acc$get;
1231
- const id = getId(item);
1232
- if (!acc.has(id)) {
1233
- acc.set(id, []);
1234
- }
1235
- (_acc$get = acc.get(id)) == null ? void 0 : _acc$get.push(item);
1236
- return acc;
1237
- }, new Map());
1238
- const equals = (storeOrder, orderForm) => {
1239
- const pick = (item, index) => ({
1240
- ...item,
1241
- itemOffered: {
1242
- sku: item.itemOffered.sku
1243
- },
1244
- index
1245
- });
1246
- const orderFormItems = orderForm.items.map(orderFormItemToOffer).map(pick);
1247
- const storeOrderItems = storeOrder.acceptedOffer.map(pick);
1248
- const isSameOrder = storeOrder.orderNumber === orderForm.orderFormId;
1249
- const orderItemsAreSync = deepEquals(orderFormItems, storeOrderItems);
1250
- return isSameOrder && orderItemsAreSync;
1251
- };
1252
- const joinItems = form => {
1253
- const itemsById = form.items.reduce((acc, item) => {
1254
- const id = getId(orderFormItemToOffer(item));
1255
- if (!acc[id]) {
1256
- acc[id] = [];
1257
- }
1258
- acc[id].push(item);
1259
- return acc;
1260
- }, {});
1261
- return {
1262
- ...form,
1263
- items: Object.values(itemsById).map(items => {
1264
- const [item] = items;
1265
- const quantity = items.reduce((acc, i) => acc + i.quantity, 0);
1266
- const totalPrice = items.reduce((acc, i) => {
1267
- var _i$priceDefinition$to, _i$priceDefinition, _i$quantity, _i$sellingPrice;
1268
- 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));
1269
- }, 0);
1270
- return {
1271
- ...item,
1272
- quantity,
1273
- sellingPrice: totalPrice / quantity
1274
- };
1275
- })
1276
- };
1277
- };
1278
- const orderFormToCart = async (form, skuLoader) => {
1279
- return {
1280
- order: {
1281
- orderNumber: form.orderFormId,
1282
- acceptedOffer: form.items.map(async item => ({
1283
- ...item,
1284
- product: await skuLoader.load(item.id)
1285
- }))
1286
- },
1287
- messages: form.messages.map(({
1288
- text,
1289
- status
1290
- }) => ({
1291
- text,
1292
- status: status.toUpperCase()
1293
- }))
1294
- };
1295
- };
1296
- const getOrderFormEtag = ({
1297
- items
1298
- }) => md5(JSON.stringify(items));
1299
- const setOrderFormEtag = async (form, commerce) => {
1300
- try {
1301
- const orderForm = await commerce.checkout.setCustomData({
1302
- id: form.orderFormId,
1303
- appId: 'faststore',
1304
- key: 'cartEtag',
1305
- value: getOrderFormEtag(form)
1306
- });
1307
- return orderForm;
1308
- } catch (err) {
1309
- 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');
1310
- throw err;
1311
- }
1312
- };
1313
- /**
1314
- * Checks if cartEtag stored on customData is up to date
1315
- * @description If cartEtag is not up to date, this means that
1316
- * another system changed the cart, like Checkout UI or Order Placed
1317
- */
1318
- const isOrderFormStale = form => {
1319
- var _form$customData, _faststoreData$fields;
1320
- const faststoreData = (_form$customData = form.customData) == null ? void 0 : _form$customData.customApps.find(app => app.id === 'faststore');
1321
- const oldEtag = faststoreData == null ? void 0 : (_faststoreData$fields = faststoreData.fields) == null ? void 0 : _faststoreData$fields.cartEtag;
1322
- if (oldEtag == null) {
1323
- return true;
1324
- }
1325
- const newEtag = getOrderFormEtag(form);
1326
- return newEtag !== oldEtag;
1327
- };
1328
- // Returns the regionalized orderForm
1329
- const getOrderForm = async (id, {
1330
- clients: {
1331
- commerce
1332
- }
1333
- }) => {
1334
- return commerce.checkout.orderForm({
1335
- id
1336
- });
1337
- };
1338
- const clearOrderFormMessages = async (id, {
1339
- clients: {
1340
- commerce
1341
- }
1342
- }) => {
1343
- return commerce.checkout.clearOrderFormMessages({
1344
- id
1345
- });
1346
- };
1347
- const updateOrderFormShippingData = async (orderForm, session, {
1348
- clients: {
1349
- commerce
1350
- }
1351
- }) => {
1352
- // Stores that are not yet providing the session while validating the cart
1353
- // should not be able to update the shipping data
1354
- //
1355
- // This was causing errors while validating regionalizated carts
1356
- // because the following code was trying to change the shippingData to an undefined address/session
1357
- if (!session) {
1358
- return orderForm;
1359
- }
1360
- const {
1361
- updateShipping,
1362
- addressChanged
1363
- } = shouldUpdateShippingData(orderForm, session);
1364
- if (updateShipping) {
1365
- var _session$deliveryMode;
1366
- // Check if the orderForm address matches the one from the session
1367
- const oldAddress = getAddressOrderForm(orderForm, session, addressChanged);
1368
- const address = oldAddress ? oldAddress : createNewAddress(session);
1369
- const selectedAddresses = address;
1370
- const hasDeliveryWindow = (_session$deliveryMode = session.deliveryMode) != null && _session$deliveryMode.deliveryWindow ? true : false;
1371
- if (hasDeliveryWindow) {
1372
- // if you have a Delivery Window you have to first get the delivery window to set the desired after
1373
- await commerce.checkout.shippingData({
1374
- id: orderForm.orderFormId,
1375
- index: orderForm.items.length,
1376
- deliveryMode: session.deliveryMode,
1377
- selectedAddresses: selectedAddresses
1378
- }, false);
1379
- }
1380
- return commerce.checkout.shippingData({
1381
- id: orderForm.orderFormId,
1382
- index: orderForm.items.length,
1383
- deliveryMode: session.deliveryMode,
1384
- selectedAddresses: selectedAddresses
1385
- }, true);
1386
- }
1387
- return orderForm;
1388
- };
1389
- /**
1390
- * This resolver implements the optimistic cart behavior. The main idea in here
1391
- * is that we receive a cart from the UI (as query params) and we validate it with
1392
- * the commerce platform. If the cart is valid, we return null, if the cart is
1393
- * invalid according to the commerce platform, we return the new cart the UI should use
1394
- * instead.
1395
- *
1396
- * The algorithm is something like:
1397
- * 1. Fetch orderForm from VTEX
1398
- * 2. Compute delta changes between the orderForm and the UI's cart
1399
- * 3. Update the orderForm in VTEX platform accordingly
1400
- * 4. If any changes were made, send to the UI the new cart. Null otherwise
1401
- */
1402
- const validateCart = async (_, {
1403
- cart: {
1404
- order
1405
- },
1406
- session
1407
- }, ctx) => {
1408
- const {
1409
- orderNumber,
1410
- acceptedOffer,
1411
- shouldSplitItem
1412
- } = order;
1413
- const {
1414
- clients: {
1415
- commerce
1416
- },
1417
- loaders: {
1418
- skuLoader
1419
- }
1420
- } = ctx;
1421
- const channel = session == null ? void 0 : session.channel;
1422
- const locale = session == null ? void 0 : session.locale;
1423
- if (channel) {
1424
- mutateChannelContext(ctx, channel);
1425
- }
1426
- if (locale) {
1427
- mutateLocaleContext(ctx, locale);
1428
- }
1429
- // Step1: Get OrderForm from VTEX Commerce
1430
- const orderForm = await getOrderForm(orderNumber, ctx);
1431
- // Clear messages so it doesn't keep populating toasts on a loop
1432
- // In the next validateCart mutation it will only have messages if a new message is created on orderForm
1433
- if (orderForm.messages.length !== 0) {
1434
- await clearOrderFormMessages(orderNumber, ctx);
1435
- }
1436
- // Step1.5: Check if another system changed the orderForm with this orderNumber
1437
- // If so, this means the user interacted with this cart elsewhere and expects
1438
- // to see this new cart state instead of what's stored on the user's browser.
1439
- const isStale = isOrderFormStale(orderForm);
1440
- if (isStale && orderNumber) {
1441
- const newOrderForm = await setOrderFormEtag(orderForm, commerce).then(joinItems);
1442
- return orderFormToCart(newOrderForm, skuLoader);
1443
- }
1444
- // Step2: Process items from both browser and checkout so they have the same shape
1445
- const browserItemsById = groupById(acceptedOffer);
1446
- const originItemsById = groupById(orderForm.items.map(orderFormItemToOffer));
1447
- const originItems = Array.from(originItemsById.entries()); // items on the VTEX platform backend
1448
- const browserItems = Array.from(browserItemsById.entries()); // items on the user's browser
1449
- // Step3: Compute delta changes
1450
- const {
1451
- itemsToAdd,
1452
- itemsToUpdate
1453
- } = browserItems.reduce((acc, [id, items]) => {
1454
- const maybeOriginItem = originItemsById.get(id);
1455
- // Adding new items to cart
1456
- if (!maybeOriginItem) {
1457
- items.forEach(item => acc.itemsToAdd.push(item));
1458
- return acc;
1459
- }
1460
- // Update existing items
1461
- const [head, ...tail] = maybeOriginItem;
1462
- const totalQuantity = items.reduce((acc, curr) => acc + curr.quantity, 0);
1463
- // set total quantity to first item
1464
- acc.itemsToUpdate.push({
1465
- ...head,
1466
- quantity: totalQuantity
1467
- });
1468
- // Remove all the rest
1469
- tail.forEach(item => acc.itemsToUpdate.push({
1470
- ...item,
1471
- quantity: 0
1472
- }));
1473
- return acc;
1474
- }, {
1475
- itemsToAdd: [],
1476
- itemsToUpdate: []
1477
- });
1478
- const itemsToDelete = originItems.filter(([id]) => !browserItemsById.has(id)).flatMap(([, items]) => items.map(item => ({
1479
- ...item,
1480
- quantity: 0
1481
- })));
1482
- const changes = [...itemsToAdd, ...itemsToUpdate, ...itemsToDelete].map(offerToOrderItemInput);
1483
- if (changes.length === 0) {
1484
- return null;
1485
- }
1486
- // Step4: Apply delta changes to order form
1487
- const updatedOrderForm = await commerce.checkout
1488
- // update orderForm items
1489
- .updateOrderFormItems({
1490
- id: orderForm.orderFormId,
1491
- orderItems: changes,
1492
- shouldSplitItem
1493
- })
1494
- // update orderForm shippingData
1495
- .then(form => updateOrderFormShippingData(form, session, ctx))
1496
- // update orderForm etag so we know last time we touched this orderForm
1497
- .then(form => setOrderFormEtag(form, commerce)).then(joinItems);
1498
- const equalMessages = deepEquals(orderForm.messages, updatedOrderForm.messages);
1499
- // Step5: If no changes detected before/after updating orderForm, the order is validated
1500
- if (equals(order, updatedOrderForm) && equalMessages) {
1501
- return null;
1502
- }
1503
- // Step6: There were changes, convert orderForm to StoreCart
1504
- return orderFormToCart(updatedOrderForm, skuLoader);
1505
- };
1506
-
1507
- const validateSession = async (_, {
1508
- session: oldSession,
1509
- search
1510
- }, {
1511
- clients
1512
- }) => {
1513
- 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;
1514
- const channel = ChannelMarshal.parse((_oldSession$channel = oldSession.channel) != null ? _oldSession$channel : '');
1515
- const postalCode = String((_oldSession$postalCod = oldSession.postalCode) != null ? _oldSession$postalCod : '').replace(/\D/g, '');
1516
- const geoCoordinates = (_oldSession$geoCoordi = oldSession.geoCoordinates) != null ? _oldSession$geoCoordi : null;
1517
- const country = (_oldSession$country = oldSession.country) != null ? _oldSession$country : '';
1518
- const params = new URLSearchParams(search);
1519
- const salesChannel = (_params$get = params.get('sc')) != null ? _params$get : channel.salesChannel;
1520
- params.set('sc', salesChannel);
1521
- const [regionData, sessionData] = await Promise.all([postalCode || geoCoordinates ? clients.commerce.checkout.region({
1522
- postalCode,
1523
- geoCoordinates,
1524
- country,
1525
- salesChannel
1526
- }) : Promise.resolve(null), clients.commerce.session(params.toString()).catch(() => null)]);
1527
- const profile = (_sessionData$namespac = sessionData == null ? void 0 : sessionData.namespaces.profile) != null ? _sessionData$namespac : null;
1528
- const store = (_sessionData$namespac2 = sessionData == null ? void 0 : sessionData.namespaces.store) != null ? _sessionData$namespac2 : null;
1529
- const region = regionData == null ? void 0 : regionData[0];
1530
- // Set seller only if it's inside a region
1531
- const seller = region == null ? void 0 : region.sellers.find(seller => channel.seller === seller.id);
1532
- const newSession = {
1533
- ...oldSession,
1534
- currency: {
1535
- code: (_store$currencyCode$v = store == null ? void 0 : store.currencyCode.value) != null ? _store$currencyCode$v : oldSession.currency.code,
1536
- symbol: (_store$currencySymbol = store == null ? void 0 : store.currencySymbol.value) != null ? _store$currencySymbol : oldSession.currency.symbol
1537
- },
1538
- country: (_store$countryCode$va = store == null ? void 0 : store.countryCode.value) != null ? _store$countryCode$va : oldSession.country,
1539
- channel: ChannelMarshal.stringify({
1540
- salesChannel: (_store$channel$value = store == null ? void 0 : (_store$channel = store.channel) == null ? void 0 : _store$channel.value) != null ? _store$channel$value : channel.salesChannel,
1541
- regionId: (_region$id = region == null ? void 0 : region.id) != null ? _region$id : channel.regionId,
1542
- seller: seller == null ? void 0 : seller.id
1543
- }),
1544
- person: profile != null && profile.id ? {
1545
- id: (_profile$id$value = (_profile$id = profile.id) == null ? void 0 : _profile$id.value) != null ? _profile$id$value : '',
1546
- email: (_profile$email$value = (_profile$email = profile.email) == null ? void 0 : _profile$email.value) != null ? _profile$email$value : '',
1547
- givenName: (_profile$firstName$va = (_profile$firstName = profile.firstName) == null ? void 0 : _profile$firstName.value) != null ? _profile$firstName$va : '',
1548
- familyName: (_profile$lastName$val = (_profile$lastName = profile.lastName) == null ? void 0 : _profile$lastName.value) != null ? _profile$lastName$val : ''
1549
- } : null
1550
- };
1551
- if (deepEquals(oldSession, newSession)) {
1552
- return null;
1553
- }
1554
- return newSession;
1555
- };
1556
-
1557
- const Mutation = {
1558
- validateCart,
1559
- validateSession,
1560
- subscribeToNewsletter
1561
- };
1562
-
1563
- const ObjectOrString = /*#__PURE__*/new GraphQLScalarType({
1564
- name: 'ObjectOrString',
1565
- description: 'A string or the string representation of an object (a stringified object).',
1566
- parseValue: toObjectOrString,
1567
- serialize: stringify,
1568
- parseLiteral(ast) {
1569
- if (ast.kind === Kind.STRING) {
1570
- return getValueAsObjectOrString(ast.value);
1571
- }
1572
- return null;
1573
- }
1574
- });
1575
- function toObjectOrString(value) {
1576
- if (typeof value === 'string') {
1577
- return getValueAsObjectOrString(value);
1578
- }
1579
- return null;
1580
- }
1581
- function getValueAsObjectOrString(value) {
1582
- try {
1583
- return JSON.parse(value);
1584
- } catch (e) {
1585
- return value;
1586
- }
1587
- }
1588
- function stringify(value) {
1589
- if (typeof value === 'object') {
1590
- return JSON.stringify(value);
1591
- }
1592
- if (typeof value === 'string') {
1593
- return value;
1594
- }
1595
- return null;
1596
- }
1597
-
1598
- const isSearchItem = item => 'Price' in item && 'seller' in item && 'product' in item;
1599
- const isOrderFormItem = item => 'skuName' in item;
1600
- const StoreOffer = {
1601
- priceCurrency: async (_, __, ctx) => {
1602
- var _sc$CurrencyCode;
1603
- const {
1604
- loaders: {
1605
- salesChannelLoader
1606
- },
1607
- storage: {
1608
- channel
1609
- }
1610
- } = ctx;
1611
- const sc = await salesChannelLoader.load(channel.salesChannel);
1612
- return (_sc$CurrencyCode = sc.CurrencyCode) != null ? _sc$CurrencyCode : '';
1613
- },
1614
- priceValidUntil: root => {
1615
- if (isSearchItem(root)) {
1616
- var _root$PriceValidUntil;
1617
- return (_root$PriceValidUntil = root.PriceValidUntil) != null ? _root$PriceValidUntil : '';
1618
- }
1619
- if (isOrderFormItem(root)) {
1620
- var _root$priceValidUntil;
1621
- return (_root$priceValidUntil = root.priceValidUntil) != null ? _root$priceValidUntil : '';
1622
- }
1623
- return null;
1624
- },
1625
- itemCondition: () => 'https://schema.org/NewCondition',
1626
- availability: async root => {
1627
- if (isSearchItem(root)) {
1628
- return availability(inStock(root));
1629
- }
1630
- if (isOrderFormItem(root)) {
1631
- return availability(inStockOrderFormItem(root.availability));
1632
- }
1633
- return null;
1634
- },
1635
- seller: (root, _, ctx) => {
1636
- if (isSearchItem(root)) {
1637
- var _ctx$storage$channel;
1638
- return {
1639
- identifier: ((_ctx$storage$channel = ctx.storage.channel) == null ? void 0 : _ctx$storage$channel.seller) || root.seller.sellerId || ''
1640
- };
1641
- }
1642
- if (isOrderFormItem(root)) {
1643
- return {
1644
- identifier: root.seller
1645
- };
1646
- }
1647
- return null;
1648
- },
1649
- price: root => {
1650
- if (isSearchItem(root)) {
1651
- return price(root);
1652
- }
1653
- if (isOrderFormItem(root)) {
1654
- return root.sellingPrice / 1e2;
1655
- }
1656
- return null;
1657
- },
1658
- sellingPrice: root => {
1659
- if (isSearchItem(root)) {
1660
- return sellingPrice(root);
1661
- }
1662
- if (isOrderFormItem(root)) {
1663
- return root.sellingPrice / 1e2;
1664
- }
1665
- return null;
1666
- },
1667
- listPrice: root => {
1668
- if (isSearchItem(root)) {
1669
- var _root$ListPrice;
1670
- return (_root$ListPrice = root.ListPrice) != null ? _root$ListPrice : 0;
1671
- }
1672
- if (isOrderFormItem(root)) {
1673
- return root.listPrice / 1e2;
1674
- }
1675
- return null;
1676
- },
1677
- itemOffered: root => {
1678
- if (isSearchItem(root)) {
1679
- return root.product;
1680
- }
1681
- if (isOrderFormItem(root)) {
1682
- return {
1683
- ...root.product,
1684
- attachmentsValues: root.attachments
1685
- };
1686
- }
1687
- return null;
1688
- },
1689
- quantity: root => {
1690
- if (isSearchItem(root)) {
1691
- var _root$AvailableQuanti;
1692
- return (_root$AvailableQuanti = root.AvailableQuantity) != null ? _root$AvailableQuanti : 0;
1693
- }
1694
- if (isOrderFormItem(root)) {
1695
- return root.quantity;
1696
- }
1697
- return null;
1698
- }
1699
- };
1700
-
1701
- const canonicalFromProduct = ({
1702
- linkText
1703
- }) => `/${linkText}/p`;
1704
-
1705
- const enhanceCommercialOffer = ({
1706
- offer,
1707
- seller,
1708
- product
1709
- }) => ({
1710
- ...offer,
1711
- product,
1712
- seller
1713
- });
1714
-
1715
- const DEFAULT_IMAGE = {
1716
- imageText: 'image',
1717
- imageUrl: 'https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg'
1718
- };
1719
- const getSlug = (link, id) => `${link}-${id}`;
1720
- const getPath = (link, id) => `/${getSlug(link, id)}/p`;
1721
- const nonEmptyArray = array => Array.isArray(array) && array.length > 0 ? array : null;
1722
- const StoreProduct = {
1723
- productID: ({
1724
- itemId
1725
- }) => itemId,
1726
- name: ({
1727
- isVariantOf,
1728
- name
1729
- }) => name != null ? name : isVariantOf.productName,
1730
- slug: ({
1731
- isVariantOf: {
1732
- linkText
1733
- },
1734
- itemId
1735
- }) => getSlug(linkText, itemId),
1736
- description: ({
1737
- isVariantOf: {
1738
- description
1739
- }
1740
- }) => description,
1741
- seo: ({
1742
- isVariantOf
1743
- }) => ({
1744
- title: isVariantOf.productName,
1745
- description: isVariantOf.description,
1746
- canonical: canonicalFromProduct(isVariantOf)
1747
- }),
1748
- brand: ({
1749
- isVariantOf: {
1750
- brand
1751
- }
1752
- }) => ({
1753
- name: brand
1754
- }),
1755
- breadcrumbList: ({
1756
- isVariantOf: {
1757
- categories,
1758
- productName,
1759
- linkText
1760
- },
1761
- itemId
1762
- }) => {
1763
- return {
1764
- itemListElement: [...categories.reverse().map((categoryPath, index) => {
1765
- const splitted = categoryPath.split('/');
1766
- const name = splitted[splitted.length - 2];
1767
- const item = splitted.map(slugify).join('/');
1768
- return {
1769
- name,
1770
- item,
1771
- position: index + 1
1772
- };
1773
- }), {
1774
- name: productName,
1775
- item: getPath(linkText, itemId),
1776
- position: categories.length + 1
1777
- }],
1778
- numberOfItems: categories.length
1779
- };
1780
- },
1781
- image: ({
1782
- images
1783
- }) => {
1784
- var _nonEmptyArray;
1785
- return ((_nonEmptyArray = nonEmptyArray(images)) != null ? _nonEmptyArray : [DEFAULT_IMAGE]).map(({
1786
- imageUrl,
1787
- imageText
1788
- }) => ({
1789
- alternateName: imageText != null ? imageText : '',
1790
- url: imageUrl.replace('vteximg.com.br', 'vtexassets.com')
1791
- }));
1792
- },
1793
- sku: ({
1794
- itemId
1795
- }) => itemId,
1796
- gtin: ({
1797
- referenceId
1798
- }) => {
1799
- var _referenceId$0$Value, _referenceId$;
1800
- return (_referenceId$0$Value = (_referenceId$ = referenceId[0]) == null ? void 0 : _referenceId$.Value) != null ? _referenceId$0$Value : '';
1801
- },
1802
- review: () => [],
1803
- aggregateRating: () => ({}),
1804
- offers: root => root.sellers.map(seller => enhanceCommercialOffer({
1805
- offer: seller.commertialOffer,
1806
- seller,
1807
- product: root
1808
- })).sort(bestOfferFirst),
1809
- isVariantOf: root => root,
1810
- additionalProperty: ({
1811
- // Search uses the name variations for specifications
1812
- variations: specifications = [],
1813
- attachmentsValues = []
1814
- }) => {
1815
- const propertyValueSpecifications = specifications.flatMap(({
1816
- name,
1817
- values
1818
- }) => values.map(value => ({
1819
- name,
1820
- value,
1821
- valueReference: VALUE_REFERENCES.specification
1822
- })));
1823
- const propertyValueAttachments = attachmentsValues.map(attachmentToPropertyValue);
1824
- return [...propertyValueSpecifications, ...propertyValueAttachments];
1825
- },
1826
- releaseDate: ({
1827
- isVariantOf: {
1828
- releaseDate
1829
- }
1830
- }) => releaseDate != null ? releaseDate : ''
1831
- };
1832
-
1833
- const BLOCKED_SPECIFICATIONS = /*#__PURE__*/new Set(['allSpecifications']);
1834
- const StoreProductGroup = {
1835
- hasVariant: root => root.isVariantOf.items.map(item => enhanceSku(item, root.isVariantOf)),
1836
- productGroupID: ({
1837
- isVariantOf
1838
- }) => isVariantOf.productId,
1839
- name: root => root.isVariantOf.productName,
1840
- skuVariants: root => root,
1841
- additionalProperty: ({
1842
- isVariantOf: {
1843
- specificationGroups
1844
- }
1845
- }) => specificationGroups
1846
- // Filter sku specifications so we don't mix them with product specs.
1847
- .filter(specificationGroup => !BLOCKED_SPECIFICATIONS.has(specificationGroup.name))
1848
- // Transform specs back into product specs.
1849
- .flatMap(({
1850
- specifications
1851
- }) => specifications.flatMap(({
1852
- name,
1853
- values
1854
- }) => values.map(value => ({
1855
- name,
1856
- value,
1857
- valueReference: VALUE_REFERENCES.specification
1858
- }))))
1859
- };
1860
-
1861
- const StorePropertyValue = {
1862
- propertyID: root => getPropertyId(root),
1863
- name: ({
1864
- name
1865
- }) => name,
1866
- value: ({
1867
- value
1868
- }) => value,
1869
- valueReference: ({
1870
- valueReference
1871
- }) => valueReference
1872
- };
1873
-
1874
- const SORT_MAP = {
1875
- price_desc: 'price:desc',
1876
- price_asc: 'price:asc',
1877
- orders_desc: 'orders:desc',
1878
- name_desc: 'name:desc',
1879
- name_asc: 'name:asc',
1880
- release_desc: 'release:desc',
1881
- discount_desc: 'discount:desc',
1882
- score_desc: ''
1883
- };
1884
-
1885
- /**
1886
- * This function implements Portal heuristics for returning the best sku for a product.
1887
- *
1888
- * The best sku is the one with the best (cheapest available) offer
1889
- * */
1890
- const pickBestSku = skus => {
1891
- const offersBySku = skus.flatMap(sku => sku.sellers.map(seller => ({
1892
- offer: seller.commertialOffer,
1893
- sku
1894
- })));
1895
- const best = min(offersBySku, ({
1896
- offer: o1
1897
- }, {
1898
- offer: o2
1899
- }) => bestOfferFirst(o1, o2));
1900
- return best ? best.sku : skus[0];
1901
- };
1902
- const isValidSkuId = skuId => skuId !== '' && !Number.isNaN(Number(skuId));
1903
-
1904
- const Query = {
1905
- product: async (_, {
1906
- locator
1907
- }, ctx) => {
1908
- // Insert channel in context for later usage
1909
- const channel = findChannel(locator);
1910
- const locale = findLocale(locator);
1911
- const id = findSkuId(locator);
1912
- const slug = findSlug(locator);
1913
- if (channel) {
1914
- mutateChannelContext(ctx, channel);
1915
- }
1916
- if (locale) {
1917
- mutateLocaleContext(ctx, locale);
1918
- }
1919
- const {
1920
- loaders: {
1921
- skuLoader
1922
- },
1923
- clients: {
1924
- commerce,
1925
- search
1926
- }
1927
- } = ctx;
1928
- try {
1929
- var _ref;
1930
- const skuId = (_ref = id != null ? id : slug == null ? void 0 : slug.split('-').pop()) != null ? _ref : '';
1931
- if (!isValidSkuId(skuId)) {
1932
- throw new Error('Invalid SkuId');
1933
- }
1934
- const sku = await skuLoader.load(skuId);
1935
- /**
1936
- * Here be dragons 🦄🦄🦄
1937
- *
1938
- * In some cases, the slug has a valid skuId for a different
1939
- * product. This condition makes sure that the fetched sku
1940
- * is the one we actually asked for
1941
- * */
1942
- if (slug && sku.isVariantOf.linkText && !slug.startsWith(sku.isVariantOf.linkText)) {
1943
- throw new Error(`Slug was set but the fetched sku does not satisfy the slug condition. slug: ${slug}, linkText: ${sku.isVariantOf.linkText}`);
1944
- }
1945
- return sku;
1946
- } catch (err) {
1947
- if (slug == null) {
1948
- throw new BadRequestError('Missing slug or id');
1949
- }
1950
- const route = await commerce.catalog.portal.pagetype(`${slug}/p`);
1951
- if (route.pageType !== 'Product' || !route.id) {
1952
- throw new NotFoundError(`No product found for slug ${slug}`);
1953
- }
1954
- const {
1955
- products: [product]
1956
- } = await search.products({
1957
- page: 0,
1958
- count: 1,
1959
- query: `product:${route.id}`
1960
- });
1961
- if (!product) {
1962
- throw new NotFoundError(`No product found for id ${route.id}`);
1963
- }
1964
- const sku = pickBestSku(product.items);
1965
- return enhanceSku(sku, product);
1966
- }
1967
- },
1968
- collection: (_, {
1969
- slug
1970
- }, ctx) => {
1971
- const {
1972
- loaders: {
1973
- collectionLoader
1974
- }
1975
- } = ctx;
1976
- return collectionLoader.load(slug);
1977
- },
1978
- search: async (_, {
1979
- first,
1980
- after: maybeAfter,
1981
- sort,
1982
- term,
1983
- selectedFacets
1984
- }, ctx) => {
1985
- var _query, _selectedFacets$flatM;
1986
- // Insert channel in context for later usage
1987
- const channel = findChannel(selectedFacets);
1988
- const locale = findLocale(selectedFacets);
1989
- const crossSelling = findCrossSelling(selectedFacets);
1990
- if (channel) {
1991
- mutateChannelContext(ctx, channel);
1992
- }
1993
- if (locale) {
1994
- mutateLocaleContext(ctx, locale);
1995
- }
1996
- let query = term;
1997
- /**
1998
- * In case we are using crossSelling, we need to modify the search
1999
- * we will be performing on our search engine. The idea in here
2000
- * is to use the cross selling API for fetching the productIds our
2001
- * search will return for us.
2002
- * Doing this two request workflow makes it possible to have cross
2003
- * selling with Search features, like pagination, internationalization
2004
- * etc
2005
- */
2006
- if (crossSelling) {
2007
- const products = await ctx.clients.commerce.catalog.products.crossselling({
2008
- type: FACET_CROSS_SELLING_MAP[crossSelling.key],
2009
- productId: crossSelling.value
2010
- });
2011
- query = `product:${products.map(x => x.productId).slice(0, first).join(';')}`;
2012
- }
2013
- const after = maybeAfter ? Number(maybeAfter) : 0;
2014
- const searchArgs = {
2015
- page: Math.ceil(after / first),
2016
- count: first,
2017
- query: (_query = query) != null ? _query : undefined,
2018
- sort: SORT_MAP[sort != null ? sort : 'score_desc'],
2019
- selectedFacets: (_selectedFacets$flatM = selectedFacets == null ? void 0 : selectedFacets.flatMap(transformSelectedFacet)) != null ? _selectedFacets$flatM : []
2020
- };
2021
- const productSearchPromise = ctx.clients.search.products(searchArgs);
2022
- return {
2023
- searchArgs,
2024
- productSearchPromise
2025
- };
2026
- },
2027
- allProducts: async (_, {
2028
- first,
2029
- after: maybeAfter
2030
- }, ctx) => {
2031
- const {
2032
- clients: {
2033
- search
2034
- }
2035
- } = ctx;
2036
- const after = maybeAfter ? Number(maybeAfter) : 0;
2037
- const products = await search.products({
2038
- page: Math.ceil(after / first),
2039
- count: first
2040
- });
2041
- const skus = products.products.map(product => product.items.map(sku => enhanceSku(sku, product))).flat().filter(sku => sku.sellers.length > 0);
2042
- return {
2043
- pageInfo: {
2044
- hasNextPage: products.pagination.after.length > 0,
2045
- hasPreviousPage: products.pagination.before.length > 0,
2046
- startCursor: '0',
2047
- endCursor: products.recordsFiltered.toString(),
2048
- totalCount: products.recordsFiltered
2049
- },
2050
- // after + index is bigger than after+first itself because of the array flat() above
2051
- edges: skus.map((sku, index) => ({
2052
- node: sku,
2053
- cursor: (after + index).toString()
2054
- }))
2055
- };
2056
- },
2057
- allCollections: async (_, {
2058
- first,
2059
- after: maybeAfter
2060
- }, ctx) => {
2061
- const {
2062
- clients: {
2063
- commerce
2064
- }
2065
- } = ctx;
2066
- const after = maybeAfter ? Number(maybeAfter) : 0;
2067
- const [brands, tree] = await Promise.all([commerce.catalog.brand.list(), commerce.catalog.category.tree()]);
2068
- const categories = [];
2069
- const dfs = (node, level) => {
2070
- categories.push({
2071
- ...node,
2072
- level
2073
- });
2074
- for (const child of node.children) {
2075
- dfs(child, level + 1);
2076
- }
2077
- };
2078
- for (const node of tree) {
2079
- dfs(node, 0);
2080
- }
2081
- const collections = [...brands.filter(brand => brand.isActive).map(x => ({
2082
- ...x,
2083
- type: 'brand'
2084
- })), ...categories];
2085
- const validCollections = collections
2086
- // Nullable slugs may cause one route to override the other
2087
- .filter(node => Boolean(StoreCollection.slug(node, null, ctx, null)));
2088
- return {
2089
- pageInfo: {
2090
- hasNextPage: validCollections.length - after > first,
2091
- hasPreviousPage: after > 0,
2092
- startCursor: '0',
2093
- endCursor: (Math.min(first, validCollections.length - after) - 1).toString(),
2094
- totalCount: validCollections.length
2095
- },
2096
- edges: validCollections.slice(after, after + first).map((node, index) => ({
2097
- node,
2098
- cursor: (after + index).toString()
2099
- }))
2100
- };
2101
- },
2102
- shipping: async (_, {
2103
- country,
2104
- items,
2105
- postalCode
2106
- }, ctx) => {
2107
- const {
2108
- loaders: {
2109
- simulationLoader
2110
- },
2111
- clients: {
2112
- commerce
2113
- }
2114
- } = ctx;
2115
- const [simulation, address] = await Promise.all([simulationLoader.load({
2116
- country,
2117
- items,
2118
- postalCode
2119
- }), commerce.checkout.address({
2120
- postalCode,
2121
- country
2122
- })]);
2123
- return {
2124
- ...simulation,
2125
- address
2126
- };
2127
- },
2128
- redirect: async (_, {
2129
- term,
2130
- selectedFacets
2131
- }, ctx) => {
2132
- var _selectedFacets$flatM2;
2133
- // 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.
2134
- // https://help.vtex.com/en/tracks/vtex-intelligent-search--19wrbB7nEQcmwzDPl1l4Cb/4Gd2wLQFbCwTsh8RUDwSoL?&utm_source=autocomplete
2135
- if (!term && (!selectedFacets || !selectedFacets.length)) {
2136
- return null;
2137
- }
2138
- const {
2139
- redirect
2140
- } = await ctx.clients.search.products({
2141
- page: 1,
2142
- count: 1,
2143
- query: term != null ? term : undefined,
2144
- selectedFacets: (_selectedFacets$flatM2 = selectedFacets == null ? void 0 : selectedFacets.flatMap(transformSelectedFacet)) != null ? _selectedFacets$flatM2 : []
2145
- });
2146
- return {
2147
- url: redirect
2148
- };
2149
- },
2150
- sellers: async (_, {
2151
- postalCode,
2152
- geoCoordinates,
2153
- country,
2154
- salesChannel
2155
- }, ctx) => {
2156
- const {
2157
- clients: {
2158
- commerce
2159
- }
2160
- } = ctx;
2161
- const regionData = await commerce.checkout.region({
2162
- postalCode,
2163
- geoCoordinates,
2164
- country,
2165
- salesChannel
2166
- });
2167
- const region = regionData == null ? void 0 : regionData[0];
2168
- const {
2169
- id,
2170
- sellers
2171
- } = region;
2172
- return {
2173
- id,
2174
- sellers
2175
- };
2176
- }
2177
- };
2178
-
2179
- const StoreReview = {
2180
- reviewRating: () => ({
2181
- ratingValue: 5,
2182
- bestRating: 5
2183
- }),
2184
- author: () => ({
2185
- name: ''
2186
- })
2187
- };
2188
-
2189
- const isRootFacet = (facet, isDepartment, isBrand) => isDepartment ? facet.key === 'category-1' : isBrand ? facet.key === 'brand' : false;
2190
- const StoreSearchResult = {
2191
- suggestions: async (root, _, ctx) => {
2192
- const {
2193
- clients: {
2194
- search
2195
- }
2196
- } = ctx;
2197
- const {
2198
- searchArgs
2199
- } = root;
2200
- // If there's no search query, suggest the most popular searches.
2201
- if (!searchArgs.query) {
2202
- const topSearches = await search.topSearches();
2203
- return {
2204
- terms: topSearches.searches.map(item => ({
2205
- value: item.term,
2206
- count: item.count
2207
- })),
2208
- products: []
2209
- };
2210
- }
2211
- const {
2212
- productSearchPromise
2213
- } = root;
2214
- const [terms, productSearchResult] = await Promise.all([search.suggestedTerms(searchArgs), productSearchPromise]);
2215
- const skus = productSearchResult.products.map(product => {
2216
- // What determines the presentation of the SKU is the price order
2217
- // https://help.vtex.com/pt/tutorial/ordenando-imagens-na-vitrine-e-na-pagina-de-produto--tutorials_278
2218
- const maybeSku = pickBestSku(product.items);
2219
- return maybeSku && enhanceSku(maybeSku, product);
2220
- }).filter(sku => !!sku);
2221
- const {
2222
- searches
2223
- } = terms;
2224
- return {
2225
- terms: searches.map(item => ({
2226
- value: item.term,
2227
- count: item.count
2228
- })),
2229
- products: skus
2230
- };
2231
- },
2232
- products: async ({
2233
- productSearchPromise
2234
- }) => {
2235
- const productSearchResult = await productSearchPromise;
2236
- const skus = productSearchResult.products.map(product => {
2237
- // What determines the presentation of the SKU is the price order
2238
- // https://help.vtex.com/pt/tutorial/ordenando-imagens-na-vitrine-e-na-pagina-de-produto--tutorials_278
2239
- const maybeSku = pickBestSku(product.items);
2240
- return maybeSku && enhanceSku(maybeSku, product);
2241
- }).filter(sku => !!sku);
2242
- return {
2243
- pageInfo: {
2244
- hasNextPage: productSearchResult.pagination.after.length > 0,
2245
- hasPreviousPage: productSearchResult.pagination.before.length > 0,
2246
- startCursor: '0',
2247
- endCursor: productSearchResult.recordsFiltered.toString(),
2248
- totalCount: productSearchResult.recordsFiltered
2249
- },
2250
- edges: skus.map((sku, index) => ({
2251
- node: sku,
2252
- cursor: index.toString()
2253
- }))
2254
- };
2255
- },
2256
- facets: async ({
2257
- searchArgs
2258
- }, _, ctx) => {
2259
- var _searchArgs$selectedF, _searchArgs$selectedF2;
2260
- const {
2261
- clients: {
2262
- search: is
2263
- }
2264
- } = ctx;
2265
- ctx.storage.searchArgs = searchArgs;
2266
- const {
2267
- facets = []
2268
- } = await is.facets(searchArgs);
2269
- const isCollectionPage = !searchArgs.query;
2270
- const isDepartment = (_searchArgs$selectedF = searchArgs.selectedFacets) != null && _searchArgs$selectedF.length ? searchArgs.selectedFacets[0].key === 'category-1' : false;
2271
- const isBrand = (_searchArgs$selectedF2 = searchArgs.selectedFacets) != null && _searchArgs$selectedF2.length ? searchArgs.selectedFacets[0].key === 'brand' : false;
2272
- const filteredFacets = facets
2273
- // Remove root facet on category and brand pages
2274
- // TODO: Hide category filters for category pages. E.g. /office/desks
2275
- .filter(facet => !isCollectionPage || !isRootFacet(facet, isDepartment, isBrand));
2276
- return filteredFacets;
2277
- },
2278
- metadata: async ({
2279
- searchArgs,
2280
- productSearchPromise
2281
- }) => {
2282
- var _productSearchResult$, _productSearchResult$2;
2283
- if (!searchArgs.query) {
2284
- return null;
2285
- }
2286
- const productSearchResult = await productSearchPromise;
2287
- return {
2288
- isTermMisspelled: (_productSearchResult$ = (_productSearchResult$2 = productSearchResult.correction) == null ? void 0 : _productSearchResult$2.misspelled) != null ? _productSearchResult$ : false,
2289
- logicalOperator: productSearchResult.operator
2290
- };
2291
- }
2292
- };
2293
-
2294
- const StoreSeo = {
2295
- title: ({
2296
- title
2297
- }) => title != null ? title : '',
2298
- description: ({
2299
- description
2300
- }) => description != null ? description : '',
2301
- canonical: ({
2302
- canonical
2303
- }) => canonical != null ? canonical : '',
2304
- titleTemplate: () => ''
2305
- };
2306
-
2307
- const units = ['bd', 'd', 'h', 'm'];
2308
- const isUnit = x => units.includes(x);
2309
- const localizedEstimates = {
2310
- bd: {
2311
- 0: 'Today',
2312
- 1: 'In 1 business day',
2313
- other: `Up to # business days`
2314
- },
2315
- d: {
2316
- 0: 'Today',
2317
- 1: 'In 1 day',
2318
- other: 'Up to # days'
2319
- },
2320
- h: {
2321
- 0: 'Now',
2322
- 1: 'In 1 hour',
2323
- other: 'Up to # hours'
2324
- },
2325
- m: {
2326
- 0: 'Now',
2327
- 1: 'In 1 minute',
2328
- other: 'Up to # minutes'
2329
- }
2330
- };
2331
- /**
2332
- * Transforms estimate (e.g 3bd) into friendly format (e.g Up to 3 business days)
2333
- * based on https://github.com/vtex-apps/shipping-estimate-translator/blob/13e17055d6353dd3f3f4c31bae77ab049002809b/messages/en.json
2334
- */
2335
- const getLocalizedEstimates = estimate => {
2336
- var _localizedEstimates$u;
2337
- const [amount, unit] = [estimate.split(/\D+/)[0], estimate.split(/[0-9]+/)[1]];
2338
- const isAmountNumber = amount !== '' && !Number.isNaN(Number(amount));
2339
- const isUnitValid = isUnit(unit);
2340
- if (!isAmountNumber || !isUnitValid) {
2341
- return '';
2342
- }
2343
- const amountKey = Number(amount) < 2 ? Number(amount) : 'other';
2344
- return (_localizedEstimates$u = localizedEstimates[unit][amountKey].replace('#', amount)) != null ? _localizedEstimates$u : '';
2345
- };
2346
- const ShippingSLA = {
2347
- carrier: root => {
2348
- var _ref, _root$friendlyName;
2349
- return (_ref = (_root$friendlyName = root == null ? void 0 : root.friendlyName) != null ? _root$friendlyName : root == null ? void 0 : root.name) != null ? _ref : '';
2350
- },
2351
- price: root => root != null && root.price ? root.price / 100 : root == null ? void 0 : root.price,
2352
- localizedEstimates: root => root != null && root.shippingEstimate ? getLocalizedEstimates(root.shippingEstimate) : ''
2353
- };
2354
-
2355
- function findSkuVariantImage(availableImages) {
2356
- var _availableImages$find;
2357
- return (_availableImages$find = availableImages.find(imageProperties => imageProperties.imageLabel === 'skuvariation')) != null ? _availableImages$find : availableImages[0];
2358
- }
2359
- function createSlugsMap(variants, dominantVariantName, baseSlug) {
2360
- /**
2361
- * Maps property value combinations to their respective SKU's slug. Enables
2362
- * us to retrieve the slug for the SKU that matches the currently selected
2363
- * variations in O(1) time.
2364
- *
2365
- * Example: `'Color-Red-Size-40': 'classic-shoes-37'`
2366
- */
2367
- const slugsMap = {};
2368
- variants.forEach(variant => {
2369
- var _skuSpecificationProp, _skuSpecificationProp2;
2370
- const skuSpecificationProperties = variant.variations;
2371
- if (skuSpecificationProperties.length === 0) {
2372
- return;
2373
- }
2374
- // Make sure that the 'name-value' pair for the dominant variation
2375
- // is always the first one.
2376
- const dominantNameValue = `${dominantVariantName}-${(_skuSpecificationProp = (_skuSpecificationProp2 = skuSpecificationProperties.find(variationDetails => variationDetails.name === dominantVariantName)) == null ? void 0 : _skuSpecificationProp2.values[0]) != null ? _skuSpecificationProp : ''}`;
2377
- const skuVariantKey = skuSpecificationProperties.reduce((acc, property) => {
2378
- const shouldIgnore = property.name === dominantVariantName;
2379
- if (shouldIgnore) {
2380
- return acc;
2381
- }
2382
- return acc + `-${property.name}-${property.values[0]}`;
2383
- }, dominantNameValue);
2384
- slugsMap[skuVariantKey] = `${baseSlug}-${variant.itemId}`;
2385
- });
2386
- return slugsMap;
2387
- }
2388
- function getActiveSkuVariations(variations) {
2389
- const activeVariations = {};
2390
- variations.forEach(variation => {
2391
- activeVariations[variation.name] = variation.values[0];
2392
- });
2393
- return activeVariations;
2394
- }
2395
- function getVariantsByName(skuSpecifications) {
2396
- const variants = {};
2397
- skuSpecifications == null ? void 0 : skuSpecifications.forEach(specification => {
2398
- var _specification$field$;
2399
- variants[(_specification$field$ = specification.field.originalName) != null ? _specification$field$ : specification.field.name] = specification.values.map(value => {
2400
- var _value$originalName;
2401
- return (_value$originalName = value.originalName) != null ? _value$originalName : value.name;
2402
- });
2403
- });
2404
- return variants;
2405
- }
2406
- function compare(a, b) {
2407
- // Values are always represented as Strings, so we need to handle numbers
2408
- // in this special case.
2409
- if (!Number.isNaN(Number(a) - Number(b))) {
2410
- return Number(a) - Number(b);
2411
- }
2412
- if (a < b) {
2413
- return -1;
2414
- }
2415
- if (a > b) {
2416
- return 1;
2417
- }
2418
- return 0;
2419
- }
2420
- function sortVariants(variantsByName) {
2421
- const sortedVariants = variantsByName;
2422
- for (const variantProperty in variantsByName) {
2423
- variantsByName[variantProperty].sort((a, b) => compare(a.value, b.value));
2424
- }
2425
- return sortedVariants;
2426
- }
2427
- function getFormattedVariations(variants, dominantVariantName, dominantVariantValue) {
2428
- /**
2429
- * SKU options already formatted and indexed by their property name.
2430
- *
2431
- * Ex: {
2432
- * `Size`: [
2433
- * { label: '42', value: '42' },
2434
- * { label: '41', value: '41' },
2435
- * { label: '39', value: '39' },
2436
- * ]
2437
- * }
2438
- */
2439
- const variantsByName = {};
2440
- const previouslySeenPropertyValues = new Set();
2441
- variants.forEach(variant => {
2442
- if (variant.variations.length === 0) {
2443
- return;
2444
- }
2445
- const variantImageToUse = findSkuVariantImage(variant.images);
2446
- const dominantVariantEntry = variant.variations.find(variation => variation.name === dominantVariantName);
2447
- const matchesDominantVariant = (dominantVariantEntry == null ? void 0 : dominantVariantEntry.values[0]) === dominantVariantValue;
2448
- if (!matchesDominantVariant) {
2449
- var _variantImageToUse$im;
2450
- const nameValueIdentifier = `${dominantVariantName}-${dominantVariantEntry == null ? void 0 : dominantVariantEntry.values[0]}`;
2451
- if (!dominantVariantEntry || previouslySeenPropertyValues.has(nameValueIdentifier)) {
2452
- return;
2453
- }
2454
- previouslySeenPropertyValues.add(nameValueIdentifier);
2455
- const formattedVariant = {
2456
- src: variantImageToUse.imageUrl,
2457
- alt: (_variantImageToUse$im = variantImageToUse.imageLabel) != null ? _variantImageToUse$im : '',
2458
- label: `${dominantVariantName}: ${dominantVariantEntry.values[0]}`,
2459
- value: dominantVariantEntry.values[0]
2460
- };
2461
- if (variantsByName[dominantVariantEntry.name]) {
2462
- variantsByName[dominantVariantEntry.name].push(formattedVariant);
2463
- } else {
2464
- variantsByName[dominantVariantEntry.name] = [formattedVariant];
2465
- }
2466
- return;
2467
- }
2468
- variant.variations.forEach(variationProperty => {
2469
- var _variantImageToUse$im2;
2470
- const nameValueIdentifier = `${variationProperty.name}-${variationProperty.values[0]}`;
2471
- if (previouslySeenPropertyValues.has(nameValueIdentifier)) {
2472
- return;
2473
- }
2474
- previouslySeenPropertyValues.add(nameValueIdentifier);
2475
- const formattedVariant = {
2476
- src: variantImageToUse.imageUrl,
2477
- alt: (_variantImageToUse$im2 = variantImageToUse.imageLabel) != null ? _variantImageToUse$im2 : '',
2478
- label: `${variationProperty.name}: ${variationProperty.values[0]}`,
2479
- value: variationProperty.values[0]
2480
- };
2481
- if (variantsByName[variationProperty.name]) {
2482
- variantsByName[variationProperty.name].push(formattedVariant);
2483
- } else {
2484
- variantsByName[variationProperty.name] = [formattedVariant];
2485
- }
2486
- });
2487
- });
2488
- return sortVariants(variantsByName);
2489
- }
2490
-
2491
- const SkuVariants = {
2492
- activeVariations: root => getActiveSkuVariations(root.variations),
2493
- allVariantsByName: root => getVariantsByName(root.isVariantOf.skuSpecifications),
2494
- slugsMap: (root, args) => {
2495
- var _args$dominantVariant, _root$variations$;
2496
- 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);
2497
- },
2498
- availableVariations: (root, args) => {
2499
- var _args$dominantVariant2, _root$variations$2;
2500
- const dominantVariantName = (_args$dominantVariant2 = args.dominantVariantName) != null ? _args$dominantVariant2 : (_root$variations$2 = root.variations[0]) == null ? void 0 : _root$variations$2.name;
2501
- const activeVariations = getActiveSkuVariations(root.variations);
2502
- const activeDominantVariationValue = activeVariations[dominantVariantName];
2503
- const filteredFormattedVariations = getFormattedVariations(root.isVariantOf.items, dominantVariantName, activeDominantVariationValue);
2504
- return filteredFormattedVariations;
2505
- }
2506
- };
2507
-
2508
- const Resolvers = {
2509
- StoreCollection,
2510
- StoreAggregateOffer,
2511
- StoreProduct,
2512
- StoreSeo,
2513
- StoreFacet,
2514
- StoreFacetBoolean,
2515
- StoreFacetRange,
2516
- StoreFacetValueBoolean,
2517
- StoreOffer,
2518
- StoreAggregateRating,
2519
- StoreReview,
2520
- StoreProductGroup,
2521
- StoreSearchResult,
2522
- StorePropertyValue,
2523
- SkuVariants,
2524
- ShippingSLA,
2525
- ObjectOrString,
2526
- Query,
2527
- Mutation
2528
- };
2529
- const getContextFactory = options => ctx => {
2530
- var _options$flags;
2531
- ctx.storage = {
2532
- channel: ChannelMarshal.parse(options.channel),
2533
- flags: (_options$flags = options.flags) != null ? _options$flags : {},
2534
- locale: options.locale
2535
- };
2536
- ctx.clients = getClients(options, ctx);
2537
- ctx.loaders = getLoaders(options, ctx);
2538
- return ctx;
2539
- };
2540
- const getResolvers = _ => Resolvers;
2541
-
2542
- 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}};
2543
- 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}};
2544
-
2545
- 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}};
2546
- 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}};
2547
-
2548
- 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}};
2549
- 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}};
2550
-
2551
- 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}};
2552
- 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}};
2553
-
2554
- 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}};
2555
- 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}};
2556
-
2557
- 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}};
2558
- 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}};
2559
-
2560
- 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}};
2561
- 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}};
2562
-
2563
- 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}};
2564
- 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}};
2565
-
2566
- 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}};
2567
- 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}};
2568
-
2569
- 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}};
2570
- 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}};
2571
-
2572
- 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}};
2573
- 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}};
2574
-
2575
- 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}};
2576
- 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}};
2577
-
2578
- var doc$c = {"kind":"Document","definitions":[{"kind":"ScalarTypeDefinition","name":{"kind":"Name","value":"ObjectOrString"},"directives":[]}],"loc":{"start":0,"end":21}};
2579
- doc$c.loc.source = {"body":"scalar ObjectOrString","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
2580
-
2581
- 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}};
2582
- 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}};
2583
-
2584
- 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}};
2585
- 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}};
2586
-
2587
- 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}};
2588
- 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}};
2589
-
2590
- 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}};
2591
- 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}};
2592
-
2593
- 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}};
2594
- 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}};
2595
-
2596
- 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}};
2597
- 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}};
2598
-
2599
- 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}};
2600
- 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}};
2601
-
2602
- 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}};
2603
- 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}};
2604
-
2605
- 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}};
2606
- 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}};
2607
-
2608
- 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}};
2609
- 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}};
2610
-
2611
- 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}};
2612
- 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}};
2613
-
2614
- 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}};
2615
- 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}};
2616
-
2617
- 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}};
2618
- 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}};
2619
-
2620
- 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}};
2621
- 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}};
2622
-
2623
- 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}};
2624
- 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}};
2625
-
2626
- 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(print).join('\n');
2627
-
2628
- const NAME = "cacheControl";
2629
- const stringify$1 = ({
2630
- scope = "private",
2631
- sMaxAge = 0,
2632
- staleWhileRevalidate = 0
2633
- }) => `${scope}, s-maxage=${sMaxAge}, stale-while-revalidate=${staleWhileRevalidate}`;
2634
- const min$1 = (a, b) => {
2635
- if (typeof a === "number" && typeof b === "number") {
2636
- return a > b ? b : a;
2637
- }
2638
- if (typeof a === "number") {
2639
- return a;
2640
- }
2641
- return b;
2642
- };
2643
- const minScope = (a, b) => {
2644
- if (typeof a === "string" && typeof b === "string") {
2645
- return a === "public" && b === "public" ? "public" : "private";
2646
- }
2647
- return a || b;
2648
- };
2649
- const directive = {
2650
- typeDefs: `directive @cacheControl(sMaxAge: Int, staleWhileRevalidate: Int, scope: String) on FIELD_DEFINITION`,
2651
- transformer: schema => mapSchema(schema, {
2652
- [MapperKind.OBJECT_FIELD]: fieldConfig => {
2653
- var _getDirective;
2654
- const cacheControl = (_getDirective = getDirective(schema, fieldConfig, NAME)) == null ? void 0 : _getDirective[0];
2655
- if (cacheControl) {
2656
- const {
2657
- sMaxAge,
2658
- staleWhileRevalidate,
2659
- scope
2660
- } = cacheControl;
2661
- const resolver = fieldConfig.resolve;
2662
- fieldConfig.resolve = (obj, args, ctx, info) => {
2663
- var _ctx$cacheControl, _ctx$cacheControl2, _ctx$cacheControl3;
2664
- ctx.cacheControl = {
2665
- sMaxAge: min$1((_ctx$cacheControl = ctx.cacheControl) == null ? void 0 : _ctx$cacheControl.sMaxAge, sMaxAge),
2666
- staleWhileRevalidate: min$1((_ctx$cacheControl2 = ctx.cacheControl) == null ? void 0 : _ctx$cacheControl2.staleWhileRevalidate, staleWhileRevalidate),
2667
- scope: minScope((_ctx$cacheControl3 = ctx.cacheControl) == null ? void 0 : _ctx$cacheControl3.scope, scope)
2668
- };
2669
- return resolver == null ? void 0 : resolver(obj, args, ctx, info);
2670
- };
2671
- }
2672
- return fieldConfig;
2673
- }
2674
- })
2675
- };
2676
-
2677
- var AttributeName;
2678
- (function (AttributeName) {
2679
- AttributeName["EXECUTION_ERROR"] = "graphql.error";
2680
- AttributeName["EXECUTION_RESULT"] = "graphql.result";
2681
- AttributeName["RESOLVER_EXECUTION_ERROR"] = "graphql.resolver.error";
2682
- AttributeName["RESOLVER_EXCEPTION"] = "graphql.resolver.exception";
2683
- AttributeName["RESOLVER_FIELD_NAME"] = "graphql.resolver.fieldName";
2684
- AttributeName["RESOLVER_TYPE_NAME"] = "graphql.resolver.typeName";
2685
- AttributeName["RESOLVER_RESULT_TYPE"] = "graphql.resolver.resultType";
2686
- AttributeName["RESOLVER_ARGS"] = "graphql.resolver.args";
2687
- AttributeName["EXECUTION_OPERATION_NAME"] = "graphql.operation.name";
2688
- AttributeName["EXECUTION_OPERATION_TYPE"] = "graphql.operation.type";
2689
- AttributeName["EXECUTION_OPERATION_DOCUMENT"] = "graphql.document";
2690
- AttributeName["EXECUTION_VARIABLES"] = "graphql.variables";
2691
- })(AttributeName || (AttributeName = {}));
2692
- const tracingSpanSymbol = /*#__PURE__*/Symbol('OPEN_TELEMETRY_GRAPHQL');
2693
- function getResolverSpanKey(path) {
2694
- const nodes = [];
2695
- // If the first node (after reversed, it will be the last one) is an integer, that is, identifies a list,
2696
- // we don't want to include it in the key. Note that this will only happen when analysing .prev paths in
2697
- // a list of elements. We just want to remove the initial node that is a integer, not all of them.
2698
- //
2699
- // Nodes with keys 6bc73341b2a183fc::product::image::0::url would not be able to find
2700
- // parents with key 6bc73341b2a183fc::product::image because of the "0" list index -
2701
- // it would search for 6bc73341b2a183fc::product::image::0
2702
- let currentPath = nodes.length === 0 && Number.isInteger(path.key) ? path.prev : path;
2703
- while (currentPath) {
2704
- nodes.push(currentPath.key);
2705
- currentPath = currentPath.prev;
2706
- }
2707
- return [...nodes].reverse().join('.');
2708
- }
2709
- const getFaststoreTelemetryPlugin = (tracingProvider, loggerProvider, serviceName, experimentalSendLogs) => {
2710
- return function useFaststoreTelemetry() {
2711
- const tracer = tracingProvider.getTracer(serviceName);
2712
- const logger = loggerProvider.getLogger(serviceName);
2713
- const resolverContextsByRootSpans = {};
2714
- return {
2715
- onPluginInit({
2716
- addPlugin
2717
- }) {
2718
- addPlugin(
2719
- // eslint-disable-next-line
2720
- useOnResolve(({
2721
- info,
2722
- context: context$1
2723
- }) => {
2724
- if (context$1 && typeof context$1 === 'object' && context$1[tracingSpanSymbol]) {
2725
- var _path$prev, _path$prev2;
2726
- tracer.getActiveSpanProcessor();
2727
- const rootContextSpanId = context$1[tracingSpanSymbol].spanContext().spanId;
2728
- const {
2729
- fieldName,
2730
- returnType,
2731
- parentType,
2732
- path
2733
- } = info;
2734
- const previousResolverSpanKey = path.prev && getResolverSpanKey(path.prev);
2735
- let ctx = null;
2736
- if (previousResolverSpanKey && resolverContextsByRootSpans[rootContextSpanId][previousResolverSpanKey]) {
2737
- ctx = resolverContextsByRootSpans[rootContextSpanId][previousResolverSpanKey];
2738
- } else {
2739
- var _resolverContextsByRo;
2740
- ctx = trace.setSpan(context.active(), context$1[tracingSpanSymbol]);
2741
- resolverContextsByRootSpans[rootContextSpanId] = (_resolverContextsByRo = resolverContextsByRootSpans[rootContextSpanId]) != null ? _resolverContextsByRo : {};
2742
- }
2743
- const resolverIndexInList = Number.isInteger((_path$prev = path.prev) == null ? void 0 : _path$prev.key) ? `[${(_path$prev2 = path.prev) == null ? void 0 : _path$prev2.key}]` : '';
2744
- const resolverSpan = tracer.startSpan(`${parentType.toString()}.${fieldName}${resolverIndexInList}`, {
2745
- attributes: {
2746
- [AttributeName.RESOLVER_FIELD_NAME]: fieldName,
2747
- [AttributeName.RESOLVER_TYPE_NAME]: parentType.toString(),
2748
- [AttributeName.RESOLVER_RESULT_TYPE]: returnType.toString(),
2749
- 'meta.span.path': getResolverSpanKey(path)
2750
- }
2751
- }, ctx);
2752
- const resolverCtx = trace.setSpan(ctx, resolverSpan);
2753
- resolverContextsByRootSpans[rootContextSpanId][getResolverSpanKey(path)] = resolverCtx;
2754
- return ({
2755
- result
2756
- }) => {
2757
- if (result instanceof Error) {
2758
- resolverSpan.setAttributes({
2759
- error: true,
2760
- 'exception.category': AttributeName.RESOLVER_EXECUTION_ERROR,
2761
- 'exception.message': result.message,
2762
- 'exception.type': result.name
2763
- });
2764
- resolverSpan.recordException(result);
2765
- }
2766
- resolverSpan.end();
2767
- };
2768
- }
2769
- return () => {};
2770
- }));
2771
- },
2772
- onExecute({
2773
- args,
2774
- extendContext
2775
- }) {
2776
- var _args$document$defini, _args$operationName;
2777
- const operationType = (_args$document$defini = args.document.definitions.filter(def => def.kind === Kind$1.OPERATION_DEFINITION).map(def => def.operation)) == null ? void 0 : _args$document$defini[0];
2778
- // Span name according to Semantic Conventions
2779
- // https://github.com/open-telemetry/semantic-conventions
2780
- let spanName = 'GraphQL Operation';
2781
- if (operationType && args.operationName) {
2782
- spanName = `${operationType} ${args.operationName}`;
2783
- } else if (operationType && !args.operationName) {
2784
- spanName = operationType;
2785
- }
2786
- const executionSpan = tracer.startSpan(spanName, {
2787
- kind: SpanKind.SERVER,
2788
- attributes: {
2789
- [AttributeName.EXECUTION_OPERATION_NAME]: (_args$operationName = args.operationName) != null ? _args$operationName : undefined,
2790
- [AttributeName.EXECUTION_OPERATION_TYPE]: operationType != null ? operationType : undefined,
2791
- [AttributeName.EXECUTION_OPERATION_DOCUMENT]: print(args.document)
2792
- }
2793
- });
2794
- const executeContext = context.active();
2795
- const resultCbs = {
2796
- onExecuteDone({
2797
- result
2798
- }) {
2799
- var _args$operationName2, _args$variableValues;
2800
- if (isAsyncIterable(result)) {
2801
- executionSpan.end();
2802
- // eslint-disable-next-line no-console
2803
- console.warn(`Plugin "newrelic" encountered a AsyncIterator which is not supported yet, so tracing data is not available for the operation.`);
2804
- return;
2805
- }
2806
- const logRecord = {
2807
- context: executeContext,
2808
- attributes: {
2809
- 'service.name': 'faststore-api',
2810
- 'service.version': '1.12.38',
2811
- 'service.name_and_version': 'faststore-api@1.12.38',
2812
- 'vtex.search_index': 'faststore_beta_api',
2813
- [AttributeName.EXECUTION_OPERATION_NAME]: (_args$operationName2 = args.operationName) != null ? _args$operationName2 : undefined,
2814
- [AttributeName.EXECUTION_OPERATION_DOCUMENT]: print(args.document),
2815
- [AttributeName.EXECUTION_VARIABLES]: JSON.stringify((_args$variableValues = args.variableValues) != null ? _args$variableValues : {})
2816
- }
2817
- };
2818
- if (typeof result.data !== 'undefined' && !(result.errors && result.errors.length > 0)) {
2819
- logRecord.severityNumber = SeverityNumber.INFO;
2820
- logRecord.severityText = 'Info';
2821
- logRecord.attributes[AttributeName.EXECUTION_RESULT] = JSON.stringify(result);
2822
- }
2823
- if (result.errors && result.errors.length > 0) {
2824
- logRecord.severityNumber = SeverityNumber.ERROR;
2825
- logRecord.severityText = 'Error';
2826
- logRecord.attributes[AttributeName.EXECUTION_ERROR] = JSON.stringify(result.errors);
2827
- executionSpan.setAttributes({
2828
- error: true,
2829
- 'exception.category': AttributeName.EXECUTION_ERROR,
2830
- 'exception.message': JSON.stringify(result.errors)
2831
- });
2832
- }
2833
- if (experimentalSendLogs) {
2834
- logger.emit(logRecord);
2835
- }
2836
- executionSpan.end();
2837
- }
2838
- };
2839
- extendContext({
2840
- [tracingSpanSymbol]: executionSpan
2841
- });
2842
- return resultCbs;
2843
- }
2844
- };
2845
- };
2846
- };
2847
-
2848
- const FASTSTORE_API_VERSION = packageJson.version;
2849
- // TODO: These urls are hardcoded for now, but they should be configurable via ENV variables
2850
- // They are only acessible from within the VTEX network, so they are not a security risk
2851
- const TRACE_COLLECTOR_URL = 'opentelemetry-collector.vtex.systems';
2852
- const TRACE_COLLECTOR_URL_DEV = 'opentelemetry-collector-beta.vtex.systems';
2853
- const LOG_COLLECTOR_URL = 'opentelemetry-collector.vtex.systems';
2854
- function getTelemetry(APIOptions, telemetryOptions) {
2855
- var _telemetryOptions$exp;
2856
- const honeycombCollectorOptions = {
2857
- url: (telemetryOptions == null ? void 0 : telemetryOptions.mode) === 'dev' ? TRACE_COLLECTOR_URL_DEV : TRACE_COLLECTOR_URL
2858
- };
2859
- const openSearchCollectorOptions = {
2860
- url: LOG_COLLECTOR_URL
2861
- };
2862
- // Create a new tracer provider
2863
- const tracerProvider = new BasicTracerProvider({
2864
- resource: new Resource({
2865
- 'service.name': 'faststore-api',
2866
- 'service.version': FASTSTORE_API_VERSION,
2867
- 'service.name_and_version': `faststore-api@${FASTSTORE_API_VERSION}`,
2868
- platform: APIOptions.platform,
2869
- [`${APIOptions.platform}.account`]: APIOptions.account,
2870
- [`${APIOptions.platform}.environment`]: APIOptions.environment,
2871
- // TODO: include the following properties in the logs
2872
- // [`${APIOptions.platform}.options.hideUnavailableItems`]:
2873
- // APIOptions.hideUnavailableItems,
2874
- // [`${APIOptions.platform}.flags.enableOrderFormSync`]:
2875
- // APIOptions.flags?.enableOrderFormSync,
2876
- // channel: APIOptions.channel,
2877
- locale: APIOptions.locale
2878
- })
2879
- });
2880
- const loggerProvider = new LoggerProvider();
2881
- // Create trace exporter
2882
- const honeycombExporter = new OTLPTraceExporter(honeycombCollectorOptions);
2883
- // Create log exporter
2884
- const openSearchExporter = new OTLPLogsExporter(openSearchCollectorOptions);
2885
- // Set up a span processor to export spans to Honeycomb
2886
- const honeyCombSpanProcessor = new SimpleSpanProcessor(honeycombExporter);
2887
- // Set up a log record processor to export spans to OpenSearch
2888
- const openSearchLogProcessor = new SimpleLogRecordProcessor(openSearchExporter);
2889
- // Register the span processor with the tracer provider
2890
- tracerProvider.addSpanProcessor(honeyCombSpanProcessor);
2891
- // Register the log record processor with the log provider
2892
- loggerProvider.addLogRecordProcessor(openSearchLogProcessor);
2893
- if ((telemetryOptions == null ? void 0 : telemetryOptions.mode) === 'verbose' || (telemetryOptions == null ? void 0 : telemetryOptions.mode) === 'dev') {
2894
- // Set up a console exporter for verbose mode
2895
- const consoleExporter = new ConsoleSpanExporter();
2896
- const verboseTraceProcessor = new SimpleSpanProcessor(consoleExporter);
2897
- // Set up processors for verbose mode
2898
- const consoleLogExporter = new ConsoleLogRecordExporter();
2899
- const veboseLogRecordExporter = new SimpleLogRecordProcessor(consoleLogExporter);
2900
- tracerProvider.addSpanProcessor(verboseTraceProcessor);
2901
- loggerProvider.addLogRecordProcessor(veboseLogRecordExporter);
2902
- }
2903
- const useFaststoreTelemetry = getFaststoreTelemetryPlugin(
2904
- // The @opentelemetry/sdk-trace-base was renamed from @opentelemetry/tracing but the
2905
- // envelop plugin doesn't support this change yet. This causes the class type to be incompatible,
2906
- // even if they are the same. https://github.com/n1ru4l/envelop/issues/1610
2907
- tracerProvider, loggerProvider, 'faststore-api', (_telemetryOptions$exp = telemetryOptions == null ? void 0 : telemetryOptions.experimentalSendLogs) != null ? _telemetryOptions$exp : false);
2908
- return {
2909
- useFaststoreTelemetry
2910
- };
2911
- }
2912
-
2913
- const platforms = {
2914
- vtex: {
2915
- getResolvers: getResolvers,
2916
- getContextFactory: getContextFactory
2917
- }
2918
- };
2919
- const directives = [directive];
2920
- const getTypeDefs = () => [typeDefs, ...directives.map(d => d.typeDefs)];
2921
- const getResolvers$1 = options => platforms[options.platform].getResolvers(options);
2922
- const getContextFactory$1 = options => platforms[options.platform].getContextFactory(options);
2923
- const getSchema = async options => {
2924
- const schema = makeExecutableSchema({
2925
- resolvers: getResolvers$1(options),
2926
- typeDefs: getTypeDefs()
2927
- });
2928
- return directives.reduce((s, d) => d.transformer(s), schema);
2929
- };
2930
-
2931
- export { BadRequestError, NotFoundError, getContextFactory$1 as getContextFactory, getResolvers$1 as getResolvers, getSchema, getTelemetry, getTypeDefs, isBadRequestError, isFastStoreError, isNotFoundError, stringify$1 as stringifyCacheControl };
2932
- //# sourceMappingURL=api.esm.js.map