id
stringlengths
12
53
messages
listlengths
3
3
code_reskyt-pixel_049fc62c
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of reskyt-pixel/react/utils/getMobileUserAgent.ts from the reskyt-pixel VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport const getMobileUserAgent = (userAgent: string): string => {\n\n let message = ''\n\n if (/Android/i.test(userAgent)) {\n message = 'Google Play'\n }\n\n if (/iPhone|iPad|iPod/i.test(userAgent)) {\n message = 'App Store'\n }\n\n if (/Windows Phone/i.test(userAgent)) {\n message = 'Windows Phone Store'\n }\n\n return message\n}\n\n```" } ]
code_reskyt-pixel_6e4c6227
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of reskyt-pixel/react/utils/reskyt.ts from the reskyt-pixel VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\n// import {html} from 'lit-html'\nimport html from 'html-template-tag'\n\ninterface AppConfig {\n htmlTitle: string\n downloadLink: string\n appImage: string\n appImageAlt: string\n appName: string\n fabName: string\n storePrefix: string\n downloadCTA: string\n}\n\nexport const reskytHtml = ({\n htmlTitle,\n downloadLink,\n appImage,\n appImageAlt,\n appName,\n fabName,\n storePrefix,\n downloadCTA\n}: AppConfig) => html`<html>\n <head>\n <title>${htmlTitle}</title>\n <style>\n #install-app {\n width: 100%;\n right: 0;\n position: fixed;\n bottom: 0px;\n z-index: 900;\n color: black;\n background-color: #f1f5f9;\n font-family: Verdana, Arial, sans-serif;\n font-size: 12px;\n border-top: 1px solid #e8ecf1;\n min-height: 75px;\n }\n\n .close-install-app {\n padding: 8px 5px;\n display: block;\n width: 20px;\n height: 40px;\n font-family: Helvetica, Arial, Verdana, sans-serif;\n font-weight: normal;\n font-size: 14px;\n text-align: center;\n cursor: pointer !important;\n font-weight: bold;\n color: #666;\n position: absolute;\n margin-top: 20px;\n }\n\n .img-app {\n width: 57px;\n border: 1px solid #e8ecf1;\n -webkit-border-radius: 8px;\n -moz-border-radius: 8px;\n border-radius: 8px;\n }\n\n .img-app,\n .content-app {\n float: left;\n }\n\n .fab-app {\n color: #979797;\n font-size: 11px;\n }\n\n .name-app,\n .title-app,\n .fab-app {\n margin-left: 70px;\n padding: 1px 0;\n }\n\n .name-app {\n font-weight: bold;\n margin-top: 2px;\n overflow: hidden;\n height: 16px;\n }\n\n .content-app {\n margin-top: 8px;\n margin-right: 34px;\n margin-left: 30px;\n position: absolute;\n }\n\n .view-install-app {\n color: blue;\n line-height: 25px;\n margin-top: 23px;\n text-transform: uppercase;\n position: absolute;\n right: 7px;\n }\n </style>\n <script>\n function closeBar() {\n dias_expire = 7 /*Dias que queremos que pasen hasta que se vuelva a mostrar la barra*/\n setCookie('reskyt-install-app', 1, dias_expire)\n document.getElementById('href-download-app').style.display = 'none'\n return false\n }\n\n function setCookie(cname, cvalue, exdays) {\n var d = new Date()\n d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000)\n var expires = 'expires=' + d.toUTCString()\n document.cookie =\n cname +\n '=' +\n cvalue +\n ';' +\n expires +\n ';path=/' /*Añadir ;SameSite=None;Secure en caso de que la cookie tenga que ser accesible entre iFrame*/\n }\n\n function getCookie(cname) {\n var name = cname + '='\n var decodedCookie = decodeURIComponent(document.cookie)\n var ca = decodedCookie.split(';')\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i]\n while (c.charAt(0) == ' ') {\n c = c.substring(1)\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length)\n }\n }\n return ''\n }\n\n url = window.location.href\n if (url.indexOf('customapp=') != -1) {\n setCookie('is_app_install_bar', 1, 365)\n document.getElementById('href-download-app').style.display = 'none'\n }\n </script>\n </head>\n <body>\n <a\n href=${downloadLink}\n class=\"href-download-app\"\n id=\"href-download-app\"\n style=\"display:none;\"\n >\n <div id=\"install-app\">\n <span class=\"close-install-app\" onclick=\"return closeBar();\"\n ><span>x</span></span\n >\n <div class=\"content-app\">\n <img class=\"img-app\" src=${appImage} alt=${appImageAlt} />\n <div class=\"name-app\">${appName}</div>\n <div class=\"fab-app\">${fabName}</div>\n <div class=\"title-app\">\n ${storePrefix} <span id=\"platform-app\"></span>\n </div>\n </div>\n <span class=\"view-install-app\">${downloadCTA}</span>\n </div>\n </a>\n </body>\n</html>`\n\n```" } ]
code_reskyt-pixel_2e814a6d
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of reskyt-pixel/react/utils/checkConfiguration.ts from the reskyt-pixel VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ninterface ReskytSettings {\n reskytAppName: string\n reskytFabName: string\n reskytHtmlTitle: string\n reskytDownloadLink: string\n reskytAppImage: string\n reskytAppImageAlt: string\n}\n\nexport const checkConfiguration = (config: ReskytSettings): boolean => {\n const keys = Object.keys(config)\n\n if (!keys.length) return false\n\n for (let i = 0; i < keys.length; i++) {\n if (!config[keys[i] as keyof ReskytSettings]) {\n return false\n }\n }\n\n return true\n}\n\n```" } ]
code_reskyt-pixel_504f75b5
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of reskyt-pixel/react/utils/getCookies.ts from the reskyt-pixel VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport const getCookies = (cookieName: string): string => {\n const name = `${cookieName}=`\n const decodedCookie = decodeURIComponent(document.cookie)\n const cookieJar = decodedCookie.split(';')\n\n for (let i = 0; i < cookieJar.length; i++) {\n let cookie = cookieJar[i]\n\n while (cookie.charAt(0) === ' ') {\n cookie = cookie.substring(1)\n }\n\n if (cookie.indexOf(name) === 0) {\n return cookie.substring(name.length, cookie.length)\n }\n }\n\n return ''\n}\n\n```" } ]
code_shopify_ff5fbdaf
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/server/server.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport \"@babel/polyfill\";\nimport dotenv from \"dotenv\";\nimport \"isomorphic-fetch\";\nimport createShopifyAuth, { verifyRequest } from \"@shopify/koa-shopify-auth\";\nimport Shopify, { ApiVersion } from \"@shopify/shopify-api\";\nimport Koa from \"koa\";\nimport next from \"next\";\nimport Router from \"koa-router\";\nimport koaBody from \"koa-body\";\nimport sequelize from \"./vtex/connection\";\nimport Settings from \"./vtex/Settings\";\nimport {\n logActivity,\n handleProduct,\n handleSimulation,\n orderPlacement,\n orderCancel,\n cancelMarketplaceOrder,\n fulfillOrder,\n notifyMarketplaceInvoice,\n updateMarketplaceTracking\n} from \"./vtex/vtexHandlers\";\n\ndotenv.config();\nconst port = parseInt(process.env.PORT, 10) || 8081;\nconst dev = process.env.NODE_ENV !== \"production\";\nconst app = next({\n dev,\n});\nconst handle = app.getRequestHandler();\n\nShopify.Context.initialize({\n API_KEY: process.env.SHOPIFY_API_KEY,\n API_SECRET_KEY: process.env.SHOPIFY_API_SECRET,\n SCOPES: process.env.SCOPES.split(\",\"),\n HOST_NAME: process.env.HOST.replace(/https:\\/\\//, \"\"),\n API_VERSION: ApiVersion.October20,\n IS_EMBEDDED_APP: true,\n // This should be replaced with your preferred storage strategy\n SESSION_STORAGE: new Shopify.Session.MemorySessionStorage(),\n});\n\n// Storing the currently active shops in memory will force them to re-login when your server restarts. You should\n// persist this object in your app.\nconst ACTIVE_SHOPIFY_SHOPS = {};\n\napp.prepare().then(async () => {\n await sequelize.sync();\n\n const server = new Koa();\n const router = new Router();\n server.keys = [Shopify.Context.API_SECRET_KEY];\n server.use(\n createShopifyAuth({\n async afterAuth(ctx) {\n // Access token and shop available in ctx.state.shopify\n const { shop, accessToken, scope } = ctx.state.shopify;\n const host = ctx.query.host;\n ACTIVE_SHOPIFY_SHOPS[shop] = scope;\n\n await Settings.findOne({ where: { shop: shop } }).then(function (obj) {\n if (obj) {\n obj.update({ shopify_token: accessToken });\n } else {\n Settings.create({ shop: shop, shopify_token: accessToken });\n }\n });\n\n const response = await Shopify.Webhooks.Registry.register({\n shop,\n accessToken,\n path: \"/webhooks\",\n topic: \"APP_UNINSTALLED\",\n webhookHandler: async (topic, shop, body) =>\n delete ACTIVE_SHOPIFY_SHOPS[shop],\n });\n\n if (!response.success) {\n console.log(\n `Failed to register APP_UNINSTALLED webhook: ${response.result}`\n );\n }\n\n await Shopify.Webhooks.Registry.register({\n shop,\n accessToken,\n path: \"/webhooks\",\n topic: \"PRODUCTS_UPDATE\",\n webhookHandler: async (topic, shop, body) =>\n handleProduct(JSON.parse(body), shop),\n });\n\n await Shopify.Webhooks.Registry.register({\n shop,\n accessToken,\n path: \"/webhooks\",\n topic: \"ORDERS_CANCELLED\",\n webhookHandler: async (topic, shop, body) =>\n cancelMarketplaceOrder(JSON.parse(body), shop),\n });\n\n await Shopify.Webhooks.Registry.register({\n shop,\n accessToken,\n path: \"/webhooks\",\n topic: \"ORDERS_PAID\",\n webhookHandler: async (topic, shop, body) =>\n notifyMarketplaceInvoice(JSON.parse(body), shop),\n });\n\n await Shopify.Webhooks.Registry.register({\n shop,\n accessToken,\n path: \"/webhooks\",\n topic: \"ORDERS_UPDATED\",\n webhookHandler: async (topic, shop, body) =>\n updateMarketplaceTracking(JSON.parse(body), shop),\n });\n\n router.post(\"/admin/apps/vtex_connector\", koaBody(), async (ctx) => {\n const query = new URLSearchParams(ctx.request.header.referer);\n const shopParam = query.get(\"shop\");\n const hostParam = query.get(\"host\");\n\n ctx.type = \"application/json; charset=utf-8\";\n\n if (\n hostParam === null ||\n shopParam === null ||\n ACTIVE_SHOPIFY_SHOPS[shopParam] === undefined\n ) {\n ctx.status = 401;\n ctx.body = JSON.stringify({ message: \"Unauthorized!\" });\n } else {\n const payload = JSON.parse(ctx.request.body);\n\n const model = await Settings.findOne({\n where: { shop: shop },\n }).then(function (obj) {\n if (obj) {\n return obj.update(payload);\n }\n payload.shop = shop;\n return Settings.create(payload);\n });\n\n ctx.status = 200;\n ctx.body = JSON.stringify(model.toJSON());\n }\n });\n\n // Redirect to app with shop parameter upon auth\n ctx.redirect(`/?shop=${shop}&host=${host}`);\n },\n })\n );\n\n const handleRequest = async (ctx) => {\n await handle(ctx.req, ctx.res);\n ctx.respond = false;\n ctx.res.statusCode = 200;\n };\n\n router.post(\"/webhooks\", async (ctx) => {\n try {\n await Shopify.Webhooks.Registry.process(ctx.req, ctx.res);\n console.log(`Webhook processed, returned status code 200`);\n } catch (error) {\n console.log(`Failed to process webhook: ${error}`);\n }\n });\n\n router.post(\n \"/graphql\",\n verifyRequest({ returnHeader: true }),\n async (ctx, next) => {\n await Shopify.Utils.graphqlProxy(ctx.req, ctx.res);\n }\n );\n\n router.get(\"/admin/apps/vtex_connector_settings\", async (ctx) => {\n const query = new URLSearchParams(ctx.request.header.referer);\n const shopParam = query.get(\"shop\");\n const hostParam = query.get(\"host\");\n\n ctx.type = \"application/json; charset=utf-8\";\n ctx.status = 200;\n\n if (\n hostParam === null ||\n shopParam === null ||\n ACTIVE_SHOPIFY_SHOPS[shopParam] === undefined\n ) {\n ctx.body = JSON.stringify({});\n } else {\n const response = await Settings.findOne({ where: { shop: shopParam } });\n if (response === null) {\n ctx.body = JSON.stringify({});\n } else {\n ctx.body = JSON.stringify(response.toJSON());\n }\n }\n });\n\n router.post(\"/api/fulfillment/pvt/orderForms/simulation\", koaBody(), handleSimulation);\n router.post(\"/api/fulfillment/pvt/orders\", koaBody(), orderPlacement);\n router.post(\"/api/fulfillment/pvt/orders/:order_id/cancel\", koaBody(), orderCancel);\n router.post(\"/api/fulfillment/pvt/orders/:order_id/fulfill\", koaBody(), fulfillOrder);\n\n router.get(\"(/_next/static/.*)\", handleRequest); // Static content is clear\n router.get(\"/_next/webpack-hmr\", handleRequest); // Webpack content is clear\n router.get(\"(.*)\", async (ctx) => {\n const shop = ctx.query.shop;\n\n // This shop hasn't been seen yet, go through OAuth to create a session\n if (ACTIVE_SHOPIFY_SHOPS[shop] === undefined) {\n ctx.redirect(`/auth?shop=${shop}`);\n } else {\n await handleRequest(ctx);\n }\n });\n\n server.use(async (ctx, next) => {\n await logActivity(ctx, next)\n })\n\n server.use(router.allowedMethods());\n server.use(router.routes());\n\n server.listen(port, () => {\n console.log(`> Ready on http://localhost:${port}`);\n });\n});\n\n```" } ]
code_shopify_98d406e1
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/server/index.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nrequire('@babel/register')({\n presets: ['@babel/preset-env'],\n ignore: ['node_modules']\n});\n\n// Import the rest of our application.\nmodule.exports = require('./server.js');\n\n```" } ]
code_shopify_f57495e7
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/pages/_app.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport ApolloClient from \"apollo-boost\";\nimport { ApolloProvider } from \"react-apollo\";\nimport App from \"next/app\";\nimport { AppProvider } from \"@shopify/polaris\";\nimport { Provider, useAppBridge } from \"@shopify/app-bridge-react\";\nimport { authenticatedFetch } from \"@shopify/app-bridge-utils\";\nimport { Redirect } from \"@shopify/app-bridge/actions\";\nimport \"@shopify/polaris/dist/styles.css\";\nimport translations from \"@shopify/polaris/locales/en.json\";\n\nfunction userLoggedInFetch(app) {\n const fetchFunction = authenticatedFetch(app);\n\n return async (uri, options) => {\n const response = await fetchFunction(uri, options);\n\n if (\n response.headers.get(\"X-Shopify-API-Request-Failure-Reauthorize\") === \"1\"\n ) {\n const authUrlHeader = response.headers.get(\n \"X-Shopify-API-Request-Failure-Reauthorize-Url\"\n );\n\n const redirect = Redirect.create(app);\n redirect.dispatch(Redirect.Action.APP, authUrlHeader || `/auth`);\n return null;\n }\n\n return response;\n };\n}\n\nfunction MyProvider(props) {\n const app = useAppBridge();\n\n const client = new ApolloClient({\n fetch: userLoggedInFetch(app),\n fetchOptions: {\n credentials: \"include\",\n },\n });\n\n const Component = props.Component;\n\n return (\n <ApolloProvider client={client}>\n <Component {...props} />\n </ApolloProvider>\n );\n}\n\nclass MyApp extends App {\n render() {\n const { Component, pageProps, host } = this.props;\n return (\n <AppProvider i18n={translations}>\n <Provider\n config={{\n apiKey: API_KEY,\n host: host,\n forceRedirect: true,\n }}\n >\n <MyProvider Component={Component} {...pageProps} />\n </Provider>\n </AppProvider>\n );\n }\n}\n\nMyApp.getInitialProps = async ({ ctx }) => {\n return {\n host: ctx.query.host,\n };\n};\n\nexport default MyApp;\n\n```" } ]
code_shopify_fff36b9a
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/pages/index.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport { Heading, Page, Form, Button, FormLayout, TextField } from \"@shopify/polaris\";\nimport React from 'react';\n\nclass Index extends React.Component {\n\n constructor(props) {\n super(props);\n this.state = {\n account_name: '',\n app_key: '',\n app_token: '',\n seller_id: '',\n access_token: '',\n account_name_error: null,\n app_key_error: null,\n app_token_error: null,\n seller_id_error: null,\n access_token_error: null\n };\n }\n\n componentDidMount() {\n this.getSettings()\n }\n\n async getSettings() {\n await fetch('/admin/apps/vtex_connector_settings')\n .then(response => response.json())\n .then(json => {\n if (Object.keys(json).length) {\n const { account_name, app_key, app_token, seller_id, access_token } = json\n this.setState({ account_name, app_key, app_token, seller_id, access_token })\n }\n })\n }\n\n handleSubmit() {\n const { account_name, app_key, app_token, seller_id, access_token } = this.state\n if (this.validateForm()) {\n fetch('/admin/apps/vtex_connector', {\n method: 'POST',\n body: JSON.stringify({ account_name, app_key, app_token, seller_id, access_token })\n })\n .then(response => response.json())\n .then(() => window.location.reload())\n }\n }\n\n validateForm() {\n const {\n account_name,\n app_key,\n app_token,\n seller_id,\n access_token\n } = this.state\n\n const account_name_error = account_name !== \"\" ? null : \"Required\"\n const app_key_error = app_key !== \"\" ? null : \"Required\"\n const app_token_error = app_token !== \"\" ? null : \"Required\"\n const seller_id_error = seller_id !== \"\" ? null : \"Required\"\n const access_token_error = access_token !== \"\" ? null : \"Required\"\n\n this.setState({\n account_name_error,\n app_key_error,\n app_token_error,\n seller_id_error,\n access_token_error\n })\n\n return !account_name_error\n && !app_key_error\n && !app_token_error\n && !seller_id_error\n && !access_token_error;\n }\n\n\n render() {\n return (\n <Page>\n <Heading>VTEX connector settings</Heading>\n <br/>\n <Form onSubmit={() => this.handleSubmit()}>\n <FormLayout>\n <TextField\n value={this.state.account_name}\n onChange={value => this.setState({ account_name: value })}\n label=\"Marketplace account\"\n type=\"text\"\n error={this.state.account_name_error}\n />\n\n <TextField\n value={this.state.app_key}\n onChange={value => this.setState({ app_key: value })}\n label=\"App key\"\n type=\"text\"\n error={this.state.app_key_error}\n />\n\n <TextField\n value={this.state.app_token}\n onChange={value => this.setState({ app_token: value })}\n label=\"App token\"\n type=\"text\"\n error={this.state.app_token_error}\n />\n\n <TextField\n value={this.state.seller_id}\n onChange={value => this.setState({ seller_id: value })}\n label=\"Seller ID\"\n type=\"text\"\n error={this.state.seller_id_error}\n />\n\n <TextField\n value={this.state.access_token}\n onChange={value => this.setState({ access_token: value })}\n label=\"Fulfillment API Access Token\"\n type=\"text\"\n error={this.state.access_token_error}\n />\n\n <Button submit>Submit</Button>\n </FormLayout>\n </Form>\n </Page>\n )\n }\n\n}\n\nexport default Index;\n\n```" } ]
code_shopify_fd7bb567
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/server/vtex/vtexHelper.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport Shopify from \"@shopify/shopify-api\";\nimport {getShippingZones, getShopData} from \"./vtexHandlers\";\n\nexport const priceMultiplier = 100\n\nexport async function formattedProductData(skuId, data, shopSettings) {\n let product = data.variants.filter(function(item) {\n return item.id === skuId\n });\n product = product[0]\n const sku = `${shopSettings.seller_id}-${skuId}`\n const variant = await getVariant(skuId, shopSettings)\n const shopData = await getShopData(shopSettings)\n\n return {\n ProductName: `${data.title} ${product.title}`,\n ProductId: data.id,\n ProductDescription: data.body_html,\n BrandName: data.vendor??\"NONAME\",\n SkuName: sku,\n SellerId: shopSettings.seller_id,\n Height: 1,\n Width: 1,\n Length: 1,\n WeightKg: product.weight,\n RefId: sku,\n SellerStockKeepingUnitId: skuId,\n CategoryFullPath: variant?.product?.collections?.edges[0]?.node?.title ?? \"NONAME\",\n SkuSpecifications: await specifications(skuId, data),\n ProductSpecifications: await specifications(skuId, data),\n Images: await images(data),\n MeasurementUnit: 'un',\n UnitMultiplier: 1,\n AvailableQuantity: product.inventory_quantity,\n Pricing: {\n Currency: shopData.shop.currency,\n SalePrice: product.price,\n CurrencySymbol: shopData.shop.currency,\n },\n }\n}\n\nexport async function getSimulationProducts(data, settings) {\n const response = []\n await Promise.all(data.items.map(async (item, index) => {\n await getVariant(item.id, settings)\n .then(variant => {\n response.push({\n id: item.id,\n requestIndex: index,\n quantity: item.quantity,\n price: variant.price * priceMultiplier,\n listPrice: variant.price * priceMultiplier,\n sellingPrice: variant.price * priceMultiplier,\n measurementUnit: 'un',\n merchantName: null,\n priceValidUntil: null,\n seller: settings.seller_id,\n unitMultiplier: 1,\n attachmentOfferings: [],\n offerings: [],\n priceTags: [],\n availability: variant.inventoryQuantity?'available':'unavailable'\n })\n })\n }))\n return response\n}\n\n\nexport async function getSimulationLogisticInfo(data, settings) {\n const response = []\n let shipping = 0\n const shippingZones = await getShippingZones(settings)\n let shippingZone = shippingZones.shipping_zones.filter(function(item) {\n return item.name === \"Domestic\"\n })\n if (shippingZone.length) {\n shippingZone = shippingZone[0]\n if (shippingZone.price_based_shipping_rates.length) {\n shipping = shippingZone.price_based_shipping_rates[0].price * priceMultiplier\n }\n }\n\n await Promise.all(data.items.map(async (item, index) => {\n await getVariant(item.id, settings)\n .then(variant => {\n response.push({\n itemIndex: index,\n quantity: item.quantity,\n stockBalance: variant.inventoryQuantity,\n shipsTo: [ ...[], data?.country ],\n slas: [\n {\n id: 'Normal',\n deliveryChannel: 'delivery',\n name: 'Normal',\n shippingEstimate: '1bd',\n price: shipping / data.items.length\n }\n ],\n deliveryChannels: [\n {\n id: 'delivery',\n stockBalance: variant.inventoryQuantity\n }\n ]\n })\n })\n }))\n return response\n}\n\nexport async function images(data) {\n const output = []\n\n await Promise.all(data.images.map(async (item) => {\n output.push({\n imageName: `Image${item.id}`,\n imageUrl: item.src\n })\n })\n )\n\n return output\n}\n\nexport async function specifications(skuId, data) {\n const output = []\n\n let product = data.variants.filter(function(item) {\n return item.id === skuId\n });\n product = product[0]\n\n await Promise.all(data.options.map(async (item) => {\n if (product[`option${item.position}`]) {\n output.push({\n 'FieldName': item.name,\n 'FieldValues': [\n product[`option${item.position}`]\n ]\n })\n }\n })\n )\n\n return output\n}\n\nexport async function getProduct(id, settings) {\n const client = new Shopify.Clients.Graphql(settings.shop, settings.shopify_token);\n\n const { body: { data: { product } } } = await client.query({\n data: `{\n product(id: \"gid://shopify/Product/${id}\") {\n title,\n handle,\n variants(first: 1) {\n edges {\n node {\n id,\n price,\n inventoryQuantity\n }\n }\n }\n }\n }`,\n });\n\n return product;\n}\n\nexport async function getVariant(id, settings) {\n const client = new Shopify.Clients.Graphql(settings.shop, settings.shopify_token);\n\n const { body: { data: { productVariant } } } = await client.query({\n data: `{\n productVariant(id: \"gid://shopify/ProductVariant/${id}\") {\n title,\n price,\n inventoryQuantity,\n product {\n collections(first: 1) {\n edges {\n node {\n title\n }\n }\n }\n }\n }\n }`,\n });\n\n return productVariant;\n}\n\nexport async function formattedInvoiceData(data) {\n const items = await Promise.all(\n data.line_items.map(async (item) => {\n return {\n id: item.variant_id,\n quantity: item.quantity,\n price: item.price * priceMultiplier,\n };\n })\n );\n\n return {\n type: \"Output\",\n invoiceNumber: data.id,\n invoiceValue: data.current_total_price * priceMultiplier,\n issuanceDate: new Date().toISOString(),\n items: items\n }\n}\n\n```" } ]
code_shopify_91caba06
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/server/vtex/ActivityLogs.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nconst { Sequelize } = require('sequelize');\nconst sequelize = require('./connection');\n\nconst ActivityLogs = sequelize.define('activity_logs', {\n created_at: Sequelize.STRING,\n action: Sequelize.STRING,\n request: Sequelize.STRING,\n response: Sequelize.STRING,\n type: Sequelize.STRING,\n shop: Sequelize.STRING\n})\n\nmodule.exports = ActivityLogs\n\n```" } ]
code_shopify_c2e45b71
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/server/vtex/vtexClient.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport Settings from \"./Settings\";\nimport { formattedProductData, formattedInvoiceData } from \"./vtexHelper\";\n\nasync function getShopSettings(shop) {\n return await Settings.findOne({where: {shop: shop}})\n}\n\nexport const headers = (settings) => {\n return {\n 'Content-Type': 'application/json; charset=utf-8',\n 'Accept': 'application/json',\n 'X-VTEX-API-AppKey': settings.app_key,\n 'X-VTEX-API-AppToken': settings.app_token,\n }\n}\n\nexport async function changeNotification(skuId, shop) {\n const shopSettings = (await getShopSettings(shop)).toJSON()\n\n return await fetch(`https://${shopSettings.account_name}.myvtex.com/api/catalog_system/pvt/skuseller/changenotification/${shopSettings.seller_id}/${skuId}`, {\n method: \"POST\",\n headers: headers(shopSettings)\n })\n}\n\nexport async function sendSKUSuggestion(skuId, body, shop) {\n const shopSettings = (await getShopSettings(shop)).toJSON()\n const payload = await formattedProductData(skuId, body, shopSettings)\n\n if (payload.Images.length) {\n return await fetch(`https://api.vtex.com/${shopSettings.account_name}/suggestions/${shopSettings.seller_id}/${skuId}`, {\n method: \"PUT\",\n headers: headers(shopSettings),\n body: JSON.stringify(payload)\n })\n }\n}\n\nexport async function cancelOrder(order_id, shop) {\n const shopSettings = (await getShopSettings(shop)).toJSON()\n return await fetch(`https://${shopSettings.account_name}.myvtex.com/api/oms/pvt/orders/${order_id}/cancel`, {\n method: \"POST\",\n headers: headers(shopSettings)\n })\n}\n\nexport async function notifyInvoice(data, shop) {\n const shopSettings = (await getShopSettings(shop)).toJSON()\n const payload = await formattedInvoiceData(data)\n\n return await fetch(`https://${shopSettings.account_name}.myvtex.com/api/oms/pvt/orders/${data.reference}/invoice`, {\n method: \"POST\",\n headers: headers(shopSettings),\n body: JSON.stringify(payload)\n })\n}\n\nexport async function updateTracking(data, shop) {\n const shopSettings = (await getShopSettings(shop)).toJSON()\n\n if (\n data\n && data.hasOwnProperty('fulfillments')\n && data.fulfillments[0].hasOwnProperty('tracking_number')\n && data.fulfillments[0].tracking_number\n ) {\n const payload = {\n trackingNumber: data.fulfillments[0].tracking_number,\n courier: data.fulfillments[0].tracking_company,\n trackingUrl: data.fulfillments[0].tracking_url,\n }\n\n return await fetch(`https://${shopSettings.account_name}.myvtex.com/api/oms/pvt/orders/${data.reference}/invoice/${data.id}`, {\n method: \"PATCH\",\n headers: headers(shopSettings),\n body: JSON.stringify(payload)\n })\n }\n}\n\n\n\n```" } ]
code_shopify_4d9fb5a3
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/server/vtex/connection.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nconst { Sequelize } = require('sequelize');\nconst sequelize = new Sequelize({\n dialect: 'sqlite',\n storage: 'database.sqlite'\n});\n\nmodule.exports = sequelize;\n\n```" } ]
code_shopify_988db880
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/server/vtex/vtexHandlers.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport {cancelOrder, changeNotification, notifyInvoice, sendSKUSuggestion, updateTracking} from \"./vtexClient\";\nimport Settings from \"./Settings\";\nimport ActivityLogs from \"./ActivityLogs\";\nimport { getSimulationLogisticInfo, getSimulationProducts } from \"./vtexHelper\";\nimport { generateOrderObject } from \"../shopify/shopifyHelper\";\nimport moment from \"moment\";\n\nexport async function logActivity(ctx, next) {\n let settings = null;\n\n await checkAuth(ctx).then(async (response) => {\n if (response) {\n settings = response.toJSON();\n }\n });\n\n await next()\n .then(() => {\n if (settings) {\n ActivityLogs.create({\n created_at: new Date().toString(),\n action: ctx.url,\n request: ctx.method,\n response: JSON.stringify(ctx.body),\n type: \"success\",\n shop: settings.shop,\n });\n }\n })\n .catch((error) => {\n if (settings) {\n ActivityLogs.create({\n created_at: new Date().toString(),\n action: ctx.url,\n request: ctx.method,\n response: JSON.stringify(error.toString()),\n type: \"error\",\n shop: settings.shop,\n });\n }\n });\n}\n\nasync function checkAuth(ctx) {\n const params = ctx.request.url.split(\"?\");\n const query = new URLSearchParams(params[1]);\n const token = query.get(\"token\");\n return await Settings.findOne({ where: { access_token: token } });\n}\n\nexport async function handleProduct(body, shop) {\n body.variants.map(async (item) => {\n await changeNotification(item.id, shop).then(async (response) => {\n if (response.status === 404) {\n await sendSKUSuggestion(item.id, body, shop);\n }\n });\n })\n}\n\nexport const handleSimulation = async (ctx) => {\n await checkAuth(ctx).then(async (response) => {\n if (response) {\n const settings = response.toJSON();\n const payload = ctx.request.body;\n\n const items = await getSimulationProducts(payload, settings);\n const logisticsInfo = await getSimulationLogisticInfo(payload, settings);\n\n const body = {\n country: payload.country,\n postalCode: payload.postalCode,\n geoCoordinates: payload.geoCoordinates,\n pickupPoints: [],\n messages: [],\n items: items,\n logisticsInfo: logisticsInfo,\n };\n\n ctx.status = 200;\n ctx.body = body;\n }\n });\n};\n\nexport const orderPlacement = async (ctx) => {\n await checkAuth(ctx).then(async (response) => {\n if (response) {\n const payload = ctx.request.body;\n const settings = response.toJSON();\n const orderBody = await generateOrderObject(payload, settings);\n\n const order = await fetch(\n `https://${settings.shop}/admin/api/2021-07/orders.json`,\n {\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Shopify-Access-Token\": settings.shopify_token,\n },\n method: \"POST\",\n body: JSON.stringify(orderBody),\n }\n );\n const orderResponse = await order.json();\n\n response = [{\n marketplaceOrderId: payload[0].marketplaceOrderId,\n orderId: orderResponse.order.id.toString(),\n followUpEmail: payload[0].clientProfileData.email,\n items: payload[0].items,\n clientProfileData: payload[0].clientProfileData,\n shippingData: payload[0].shippingData,\n paymentData: null\n }]\n\n ctx.status = 200;\n ctx.body = response;\n }\n });\n};\n\nexport const orderCancel = async (ctx) => {\n await checkAuth(ctx).then(async (response) => {\n if (response) {\n const payload = ctx.request.body;\n const settings = response.toJSON();\n\n const orderCancellation = await fetch(\n `https://${settings.shop}/admin/api/2021-07/orders/${ctx.params.order_id}/cancel.json`,\n {\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Shopify-Access-Token\": settings.shopify_token,\n },\n method: \"POST\",\n body: JSON.stringify({}),\n }\n );\n await orderCancellation.json();\n\n response = {\n date: moment().format('YYYY-MM-DD HH:m:s'),\n marketplaceOrderId: payload.marketplaceOrderId,\n orderId: ctx.params.order_id,\n receipt: null\n }\n\n ctx.status = 200;\n ctx.body = response;\n }\n });\n};\n\nexport async function cancelMarketplaceOrder(body, shop) {\n await cancelOrder(body.reference, shop);\n}\n\nexport const fulfillOrder = async (ctx) => {\n await checkAuth(ctx).then(async (response) => {\n if (response) {\n const payload = ctx.request.body;\n const settings = response.toJSON();\n\n //this will capture the payment and marks the order ad paid, but it will automatically trigger the\n //ORDERS_PAID webhook witch will automatically send the invoice notification\n\n // const capture = await fetch(\n // `https://${settings.shop}/admin/api/2021-07/orders/${ctx.params.order_id}/transactions.json`,\n // {\n // headers: {\n // \"Content-Type\": \"application/json\",\n // \"X-Shopify-Access-Token\": settings.shopify_token,\n // },\n // method: \"POST\",\n // body: JSON.stringify({\n // transaction: {\n // kind: \"capture\",\n // gateway: \"manual\"\n // }\n // }),\n // }\n // );\n // await capture.json();\n\n response = {\n date: moment().format('YYYY-MM-DD HH:m:s'),\n marketplaceOrderId: payload.marketplaceOrderId,\n orderId: ctx.params.order_id,\n receipt: null\n }\n\n ctx.status = 200;\n ctx.body = response;\n }\n });\n}\n\nexport async function notifyMarketplaceInvoice(body, shop) {\n await notifyInvoice(body, shop);\n}\n\nexport async function updateMarketplaceTracking(body, shop) {\n await updateTracking(body, shop);\n}\n\nexport async function getShopData(settings) {\n const data = await fetch(\n `https://${settings.shop}/admin/api/2021-07/shop.json`,\n {\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Shopify-Access-Token\": settings.shopify_token,\n },\n method: \"GET\",\n }\n );\n return await data.json()\n}\n\nexport async function getShippingZones(settings) {\n const data = await fetch(\n `https://${settings.shop}/admin/api/2021-07/shipping_zones.json`,\n {\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Shopify-Access-Token\": settings.shopify_token,\n },\n method: \"GET\",\n }\n );\n return await data.json()\n}\n\n```" } ]
code_shopify_3ae6493f
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/server/vtex/Settings.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nconst { Sequelize } = require('sequelize');\nconst sequelize = require('./connection');\n\nconst Settings = sequelize.define('settings', {\n account_name: Sequelize.STRING,\n app_key: Sequelize.STRING,\n app_token: Sequelize.STRING,\n seller_id: Sequelize.STRING,\n access_token: Sequelize.STRING,\n shop: Sequelize.STRING,\n shopify_token: Sequelize.STRING,\n})\n\nmodule.exports = Settings\n\n```" } ]
code_shopify_8547867b
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/server/shopify/shopifyHelper.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport {getVariant, priceMultiplier} from \"../vtex/vtexHelper\";\n\nexport async function generateOrderObject(data, settings) {\n const { clientProfileData, items, shippingData, marketplacePaymentValue } = data[0];\n\n const shippingCost = shippingData.logisticsInfo.reduce((result, item) => {\n return result + item.price\n }, 0)\n\n const products = await Promise.all(\n items.map(async (item) => {\n const variant = await getVariant(item.id, settings);\n return {\n title: variant.title,\n variant_id: item.id,\n quantity: item.quantity * item.unitMultiplier,\n price: item.price / item.unitMultiplier / priceMultiplier,\n };\n })\n );\n return {\n order: {\n line_items: products,\n shipping_lines: [\n {\n code: \"INT.TP\",\n price: shippingCost / priceMultiplier,\n title: \"Standard\",\n carrier_identifier: null,\n requested_fulfillment_service_id: null\n }\n ],\n customer: {\n first_name: clientProfileData.firstName,\n last_name: clientProfileData.lastName,\n email: clientProfileData.email,\n },\n billing_address: {\n first_name: clientProfileData.firstName,\n last_name: clientProfileData.lastName,\n address1: `${shippingData.address.street} ${shippingData.address.number}`,\n phone: clientProfileData.phone,\n city: shippingData.address.city,\n province: shippingData.address.state,\n country: shippingData.address.country,\n zip: shippingData.address.postalCode,\n },\n shipping_address: {\n first_name: clientProfileData.firstName,\n last_name: clientProfileData.lastName,\n address1: `${shippingData.address.street} ${shippingData.address.number}`,\n phone: clientProfileData.phone,\n city: shippingData.address.city,\n province: shippingData.address.state,\n country: shippingData.address.country,\n zip: shippingData.address.postalCode,\n },\n email: clientProfileData.email,\n financial_status: \"pending\",\n reference: data[0].marketplaceOrderId,\n fulfillment_status: \"fulfilled\",\n transactions: [\n {\n amount: marketplacePaymentValue / priceMultiplier,\n kind: \"authorization\",\n status: \"success\"\n }\n ]\n },\n };\n}\n\n```" } ]
code_shopify_e200596e
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/server/handlers/client.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport ApolloClient from \"apollo-boost\";\n\nexport const createClient = (shop, accessToken) => {\n return new ApolloClient({\n uri: `https://${shop}/admin/api/2019-10/graphql.json`,\n request: operation => {\n operation.setContext({\n headers: {\n \"X-Shopify-Access-Token\": accessToken,\n \"User-Agent\": `shopify-app-node ${\n process.env.npm_package_version\n } | Shopify App CLI`\n }\n });\n }\n });\n};\n\n```" } ]
code_shopify_ecff1b9a
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/server/handlers/index.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport { createClient } from \"./client\";\nimport { getOneTimeUrl } from \"./mutations/get-one-time-url\";\nimport { getSubscriptionUrl } from \"./mutations/get-subscription-url\";\n\nexport { createClient, getOneTimeUrl, getSubscriptionUrl };\n\n```" } ]
code_shopify_26ecb697
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/server/handlers/mutations/get-one-time-url.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport \"isomorphic-fetch\";\nimport { gql } from \"apollo-boost\";\n\nexport function ONETIME_CREATE(url) {\n return gql`\n mutation {\n appPurchaseOneTimeCreate(\n name: \"test\"\n price: { amount: 10, currencyCode: USD }\n returnUrl: \"${url}\"\n test: true\n ) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appPurchaseOneTime {\n id\n }\n }\n }\n `;\n}\n\nexport const getOneTimeUrl = async (ctx) => {\n const { client } = ctx;\n const confirmationUrl = await client\n .mutate({\n mutation: ONETIME_CREATE(process.env.HOST),\n })\n .then((response) => response.data.appPurchaseOneTimeCreate.confirmationUrl);\n return ctx.redirect(confirmationUrl);\n};\n\n```" } ]
code_shopify_e3ebb863
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shopify/server/handlers/mutations/get-subscription-url.js from the shopify VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport \"isomorphic-fetch\";\nimport { gql } from \"apollo-boost\";\n\nexport function RECURRING_CREATE(url) {\n return gql`\n mutation {\n appSubscriptionCreate(\n name: \"Super Duper Plan\"\n returnUrl: \"${url}\"\n test: true\n lineItems: [\n {\n plan: {\n appUsagePricingDetails: {\n cappedAmount: { amount: 10, currencyCode: USD }\n terms: \"$1 for 1000 emails\"\n }\n }\n }\n {\n plan: {\n appRecurringPricingDetails: {\n price: { amount: 10, currencyCode: USD }\n }\n }\n }\n ]\n ) {\n userErrors {\n field\n message\n }\n confirmationUrl\n appSubscription {\n id\n }\n }\n }`;\n}\n\nexport const getSubscriptionUrl = async ctx => {\n const { client } = ctx;\n const confirmationUrl = await client\n .mutate({\n mutation: RECURRING_CREATE(process.env.HOST)\n })\n .then(response => response.data.appSubscriptionCreate.confirmationUrl);\n\n return ctx.redirect(confirmationUrl);\n};\n\n```" } ]
code_bing-ads_4b61b942
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bing-ads/docs/README.md from the bing-ads VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# Bing UET\n\n**Universal Event Tracking**\nTrack how your clients activities after they click on your ad. Universal Event Tracking (UET) is an advanced tool that records everything or what users use on your site. Microsoft Advertising creates a UET tag and places it across your site to collect data that can track conversion goals and target your audience using remarketing lists.\nFor more information please visit, [Bing UET](https://about.ads.microsoft.com/en-us/resources/training/universal-event-tracking) website.\n\n## App Installation\nOpen the VTEX APP Store and install the Bing UET app on your store.\n\nor\n\nRun the following command:\n\n```sh\nvtex install vtex.bing@0.x\n```\n\nNext, open the app settings on your admin and fill the form with your Bing UET information.\n```" } ]
code_bing-ads_91cfbb5e
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bing-ads/react/index.tsx from the bing-ads VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport { PixelMessage } from './typings/events'\nimport { canUseDOM } from 'vtex.render-runtime'\n\nfunction handleMessages(e: PixelMessage) {\n if (e.data.eventName === \"vtex:orderPlaced\") {\n window.uetq = window.uetq || [];\n window.uetq.push('event', 'purchase', {\n 'transaction_id': e?.data?.transactionId,\n 'ecomm_prodid': e?.data?.transactionProducts.map(item=>item.skuRefId),\n 'ecomm_pagetype': 'purchase',\n 'ecomm_totalvalue': e?.data?.transactionTotal,\n 'revenue_value': e?.data?.transactionTotal,\n 'currency': e?.data?.transactionCurrency,\n 'items': e?.data?.transactionProducts.map(item=>({id:item.skuRefId, quantity:item.quantity, price:item.price}))\n })\n}}\n\nif (canUseDOM) {\n window.addEventListener('message', handleMessages)}\n\n```" } ]
code_bing-ads_d6389b04
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bing-ads/react/package.json from the bing-ads VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"scripts\": {\n \"test\": \"vtex-test-tools test\"\n },\n \"dependencies\": {\n \"ramda\": \"^0.26.1\"\n },\n \"devDependencies\": {\n \"@types/graphql\": \"^14.2.0\",\n \"@types/jest\": \"^24.0.11\",\n \"@types/node\": \"^11.13.0\",\n \"@types/ramda\": \"^0.26.5\",\n \"@vtex/test-tools\": \"^1.1.0\",\n \"eslint\": \"^5.16.0\",\n \"eslint-config-vtex-react\": \"^4.1.0\",\n \"prettier\": \"^1.18.2\",\n \"tslint-eslint-rules\": \"^5.4.0\",\n \"typescript\": \"3.9.7\"\n },\n \"version\": \"1.1.0\"\n}\n\n```" } ]
code_bing-ads_e1e10a35
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bing-ads/store/interfaces.json from the bing-ads VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"pixel.bing\": {\n \"component\": \"index\"\n }\n}\n\n```" } ]
code_bing-ads_890ccb0d
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bing-ads/react/typings/events.d.ts from the bing-ads VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport interface PixelMessage extends MessageEvent {\n data:\n | ProductViewData\n | ProductClickData\n | OrderPlacedData\n | PageViewData\n | ProductImpressionData\n | AddToCartData\n | RemoveToCartData\n}\n\nexport interface EventData {\n event: string\n eventName: string\n currency: string\n}\n\nexport interface PageViewData extends EventData {\n event: 'pageView'\n eventName: 'vtex:pageView'\n pageTitle: string\n pageUrl: string\n referrer: string\n}\n\nexport interface AddToCartData extends EventData {\n event: 'addToCart'\n eventName: 'vtex:addToCart'\n items: CartItem[]\n}\n\nexport interface RemoveToCartData extends EventData {\n event: 'removeFromCart'\n eventName: 'vtex:removeFromCart'\n items: CartItem[]\n}\n\nexport interface OrderPlacedData extends Order, EventData {\n event: 'orderPlaced'\n eventName: 'vtex:orderPlaced'\n}\n\nexport interface ProductViewData extends EventData {\n event: 'productView'\n eventName: 'vtex:productView'\n product: Product\n}\n\nexport interface ProductClickData extends EventData {\n event: 'productClick'\n eventName: 'vtex:productClick'\n product: Product\n}\n\nexport interface ProductImpressionData extends EventData {\n event: 'productImpression'\n eventName: 'vtex:productImpression'\n impressions: Impression[]\n product?: Product // deprecated, use impressions list!\n position?: number // deprecated, use impressions list!\n list: string\n}\n\ninterface CartItem {\n skuId: string\n variant: string\n price: number\n name: string\n quantity: number\n productRefId: string\n brand: string\n category: string\n}\n\nexport interface Order {\n currency: string\n accountName: string\n orderGroup: string\n salesChannel: string\n coupon: string\n visitorType: string\n visitorContactInfo: string[]\n visitorAddressState: string\n visitorAddressCountry: string\n visitorAddressPostalCode: string\n transactionId: string\n transactionDate: string\n transactionAffiliation: string\n transactionTotal: number\n transactionShipping: number\n transactionSubtotal: number\n transactionDiscounts: number\n transactionTax: number\n transactionCurrency: string\n transactionPaymentType: PaymentType[]\n transactionShippingMethod: ShippingMethod[]\n transactionProducts: ProductOrder[]\n transactionPayment: {\n id: string\n }\n}\n\nexport interface Impression {\n product: Product\n position: number\n}\n\ninterface PaymentType {\n group: string\n paymentSystemName: string\n installments: number\n value: number\n}\n\ninterface ShippingMethod {\n itemId: string\n selectedSla: string\n}\n\ninterface ProductOrder {\n id: string\n name: string\n sku: string\n skuRefId: string\n skuName: string\n productRefId: string\n ean: string\n slug: string\n brand: string\n brandId: string\n seller: string\n sellerId: string\n category: string\n categoryId: string\n categoryTree: string[]\n categoryIdTree: string[]\n priceTags: PriceTag[]\n originalPrice: number\n price: number\n sellingPrice: number\n tax: number\n quantity: number\n components: any[]\n measurementUnit: string\n unitMultiplier: number\n}\n\ninterface PriceTag {\n identifier: string\n isPercentual: boolean\n value: number\n}\n\ninterface Product {\n brand: string\n categoryId?: string // inconsistency\n categories: string[]\n productId: string\n productName: string\n selectedSku?: string // inconsistency\n items: Item[]\n sku: Item\n [key: string]: any\n}\n\ninterface Item {\n itemId: string\n name: string\n seller?: Seller\n [key: string]: any\n}\n\ninterface Seller {\n commertialOffer: CommertialOffer\n [key: string]: any\n}\n\ninterface CommertialOffer {\n Price: number\n [key: string]: any\n}\n\n```" } ]
code_bing-ads_9c25d670
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bing-ads/react/typings/vtex.render-runtime.d.ts from the bing-ads VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.render-runtime' {\n export const canUseDOM: boolean\n}\n\n```" } ]
code_bing-ads_a30bdfdf
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bing-ads/react/typings/global.d.ts from the bing-ads VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ninterface Event extends Event {\n data: any;\n}\n\n\ninterface Window extends Window {\n uetq: any\n}\n\n```" } ]
code_buyer-org-supplier_118950ad
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of buyer-org-supplier/node/service.json from the buyer-org-supplier VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"memory\": 256,\n \"ttl\": 10,\n \"timeout\": 2,\n \"minReplicas\": 2,\n \"maxReplicas\": 4,\n \"workers\": 1,\n \"routes\": {\n \"buyer-org-supplier\": {\n \"public\": true,\n \"path\": \"/buyer-org-supplier\"\n }\n }\n}\n\n```" } ]
code_buyer-org-supplier_4c9b3f0b
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of buyer-org-supplier/node/package.json from the buyer-org-supplier VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"license\": \"MIT\",\n \"devDependencies\": {\n \"@types/axios\": \"^0.14.0\",\n \"@types/co-body\": \"^6.1.0\",\n \"@types/jsonwebtoken\": \"^8.5.4\",\n \"vtex.buyer-org-supplier\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.buyer-org-supplier@0.4.1/public/_types/react\"\n },\n \"dependencies\": {\n \"@vtex/api\": \"6.45.6\",\n \"co-body\": \"^6.1.0\",\n \"jsonwebtoken\": \"^8.5.1\"\n },\n \"version\": \"0.6.0\"\n}\n\n```" } ]
code_buyer-org-supplier_1f4f01d0
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of buyer-org-supplier/node/index.ts from the buyer-org-supplier VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport type { ClientsConfig, ServiceContext } from '@vtex/api'\nimport { LRUCache, method, Service } from '@vtex/api'\n\nimport { Clients } from './clients'\nimport { createBuyerOrg } from './routes/createBuyerOrg'\n\nconst TIMEOUT_MS = 800\nconst memoryCache = new LRUCache<string, never>({ max: 5000 })\n\nmetrics.trackCache('status', memoryCache)\n\ndeclare global {\n type Context = ServiceContext<Clients>\n}\n\nconst clients: ClientsConfig<Clients> = {\n implementation: Clients,\n options: {\n default: {\n retries: 2,\n timeout: TIMEOUT_MS,\n },\n status: {\n memoryCache,\n },\n },\n}\n\n// Export a service that defines route handlers and client options.\nexport default new Service({\n clients,\n routes: {\n 'buyer-org-supplier': method({\n POST: createBuyerOrg,\n }),\n },\n})\n\n```" } ]
code_buyer-org-supplier_526ae2b6
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of buyer-org-supplier/node/clients/clClient.ts from the buyer-org-supplier VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport type { InstanceOptions, IOContext, RequestConfig } from '@vtex/api'\nimport { JanusClient } from '@vtex/api'\nimport type { AxiosError } from 'axios'\n\nimport { statusToError } from '../utils/statusCodeUtils'\n\nconst FIVE_SECONDS_MS = 5 * 1000\n\nexport type CLSchema = {\n id: string\n}\n\nexport class CLClient extends JanusClient {\n constructor(context: IOContext, options?: InstanceOptions) {\n super(context, {\n ...options,\n headers: {\n ...(options && options.headers),\n VtexIdClientAutCookie: context.authToken,\n },\n timeout: FIVE_SECONDS_MS,\n })\n }\n\n public getClientData = (userId: string, customFields?: string): Promise<CLSchema[] | AxiosError> =>\n this.get<CLSchema[]>(\n this.searchPathByUserId(userId),\n {\n metric: 'cl-getCLData',\n params: {\n extraFields: customFields,\n },\n }\n )\n\n protected get = <T>(url: string, config?: RequestConfig) =>\n this.http.get<T>(url, config).catch<AxiosError>(statusToError)\n\n private searchPathByUserId = (userId: string) => `/api/dataentities/CL/search?_fields=_all&_where=userId=${userId}`\n}\n\n```" } ]
code_buyer-org-supplier_993df371
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of buyer-org-supplier/node/clients/profileSystem.ts from the buyer-org-supplier VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport type {InstanceOptions, IOContext, RequestConfig} from '@vtex/api'\nimport {JanusClient} from '@vtex/api'\nimport type {AxiosError} from 'axios'\n\nimport {statusToError} from '../utils/statusCodeUtils'\nimport type {CurrentProfile, Profile} from '../typings/profileSystem'\n\nconst FIVE_SECONDS_MS = 5 * 1000\n\nexport type ProfileCreationResponse = {\n profileId: string\n}\n\nexport class ProfileSystemClient extends JanusClient {\n constructor(context: IOContext, options?: InstanceOptions) {\n super(context, {\n ...options,\n headers: {\n ...(options && options.headers),\n VtexIdClientAutCookie: context.authToken,\n },\n timeout: FIVE_SECONDS_MS,\n })\n }\n\n private getUserIdentification = (user: CurrentProfile) =>\n user.userId ?? encodeURIComponent(user.email)\n\n public getProfileInfo = (user: CurrentProfile, customFields?: string) =>\n this.get<Profile>(\n `${this.baseUrl}/${this.getUserIdentification(user)}/personalData`,\n {\n metric: 'profile-system-getProfileInfo',\n params: {\n extraFields: customFields,\n },\n }\n )\n\n public createProfile = (profile: any): Promise<ProfileCreationResponse | AxiosError> =>\n this.post<ProfileCreationResponse>(\n this.baseUrl,\n { personalData: profile },\n {\n metric: 'profile-system-createProfile',\n }\n )\n\n public updateAddress = (user: Profile, addressesData: any) =>\n this.post(\n `${this.baseUrl}/${this.getUserIdentification(user)}/addresses`,\n addressesData,\n {\n metric: 'profile-system-updateAddress',\n }\n )\n\n protected post = <T>(url: string, data?: unknown, config?: RequestConfig) =>\n this.http.post<T>(url, data, config).catch<AxiosError>(statusToError)\n\n protected get = <T>(url: string, config?: RequestConfig) =>\n this.http.get<T>(url, config).catch<AxiosError>(statusToError)\n\n private baseUrl = '/api/profile-system/pvt/profiles'\n}\n\n```" } ]
code_buyer-org-supplier_eb03cd14
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of buyer-org-supplier/node/clients/index.ts from the buyer-org-supplier VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { IOClients } from '@vtex/api'\n\nimport { ProfileSystemClient } from './profileSystem'\nimport { CLClient } from \"./clClient\";\n\nexport class Clients extends IOClients {\n public get profileSystem() {\n return this.getOrSet('profileSystem', ProfileSystemClient)\n }\n\n public get clClient() {\n return this.getOrSet('clClient', CLClient)\n }\n}\n\n```" } ]
code_buyer-org-supplier_be1bf63e
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of buyer-org-supplier/node/typings/profileSystem.d.ts from the buyer-org-supplier VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport type { Maybe } from '@vtex/api'\n\ninterface Address {\n id?: string\n userId?: string\n receiverName?: string\n complement?: string\n neighborhood?: string\n country?: string\n state?: string\n number?: string\n street?: string\n postalCode?: string\n city?: string\n reference?: string\n addressName?: string\n addressType?: string\n geoCoordinates?: string\n}\n\nexport interface Profile {\n firstName?: string\n lastName?: string\n profilePicture?: string\n email: string\n document?: string\n userId: string\n birthDate?: string\n gender?: string\n homePhone?: string\n businessPhone?: string\n isCorporate?: boolean\n corporateName?: string\n corporateDocument?: string\n stateRegistration?: string\n approved?: boolean\n addresses?: Address[]\n tradeName?: string\n payments?: PaymentProfile[]\n customFields?: ProfileCustomField[]\n createdIn?: Maybe<Date>\n}\n\ninterface CurrentProfile {\n email: string\n userId?: string\n}\n\n```" } ]
code_buyer-org-supplier_e70ec9cc
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of buyer-org-supplier/node/typings/buyerOrgService.d.ts from the buyer-org-supplier VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ntype BuyerOrgAddress = {\n id: string\n country: string\n zipCode: string\n state: string\n city: string\n neighborhood: string\n street: string\n streetNumber: string\n complement?: string\n roomFloorUnit?: string\n createdAt: Date\n updatedAt: Date\n}\n\ntype BuyerOrgCompany = {\n id: string\n corporateDocument: string\n companyName: string\n tradeName: string\n stateRegistration?: string\n}\n\nexport type BuyerOrgRaw = {\n id: string\n tenantName: string\n createdAt: Date\n updatedAt: Date\n organizationEmail: string\n address: BuyerOrgAddress\n company: BuyerOrgCompany\n}\n\n```" } ]
code_buyer-org-supplier_6295c8e3
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of buyer-org-supplier/node/utils/getRequestConfig.ts from the buyer-org-supplier VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport type { IOContext, RequestTracingConfig } from '@vtex/api'\n\ntype Args = {\n context: IOContext\n authMethod: AuthMethod\n metric: string\n tracingConfig?: RequestTracingConfig\n}\n\nexport type AuthMethod = 'AUTH_TOKEN' | 'STORE_TOKEN' | 'ADMIN_TOKEN'\n\nexport const createTracing = (\n metric: string,\n tracingConfig?: RequestTracingConfig\n) => ({\n requestSpanNameSuffix: metric,\n ...tracingConfig?.tracing,\n})\n\nexport const getAuthToken = (ctx: IOContext, method: AuthMethod) => {\n switch (method) {\n case 'STORE_TOKEN':\n return ctx.storeUserAuthToken\n\n case 'ADMIN_TOKEN':\n return ctx.adminUserAuthToken\n\n case 'AUTH_TOKEN':\n return ctx.authToken\n\n default:\n return null\n }\n}\n\nexport const getRequestConfig = ({\n context,\n authMethod,\n metric,\n tracingConfig,\n}: Args) => {\n const token = getAuthToken(context, authMethod)\n const headers: Headers = token\n ? {\n VtexIdclientAutCookie: token,\n }\n : {}\n\n return {\n headers,\n metric,\n tracing: createTracing(metric, tracingConfig),\n }\n}\n\nexport interface Headers {\n [key: string]: string\n}\n\n```" } ]
code_buyer-org-supplier_b8e55620
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of buyer-org-supplier/node/utils/statusCodeUtils.ts from the buyer-org-supplier VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport type { AxiosError } from 'axios'\nimport { AuthenticationError, ForbiddenError, UserInputError } from '@vtex/api'\n\nexport function isNotSuccessCode(statusCode: number) {\n return statusCode < 200 || statusCode > 299\n}\n\nexport const statusToError = (e: AxiosError) => {\n console.log(e.response?.data)\n if (!e.response) throw e\n\n const { response } = e as AxiosError\n\n if (!response?.status) throw e\n\n const { status } = response\n\n if (status === 401) throw new AuthenticationError(e)\n\n if (status === 403) throw new ForbiddenError(e)\n\n if (status === 400) throw new UserInputError(e)\n\n throw e\n}\n\n```" } ]
code_buyer-org-supplier_d5d7f39f
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of buyer-org-supplier/node/utils/wrapTryCatch.ts from the buyer-org-supplier VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport default async function wrapTryCatch<T>(promise: Promise<T>) {\n try {\n const response = await promise\n\n console.log('try', { response })\n\n return {\n response,\n error: null,\n }\n } catch (error) {\n console.log({ error })\n\n return {\n response: null,\n error: 'ERROR',\n }\n }\n}\n\n```" } ]
code_buyer-org-supplier_e1c2ed1d
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of buyer-org-supplier/node/routes/createBuyerOrg.ts from the buyer-org-supplier VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport parse from 'co-body'\n\nimport type { BuyerOrgRaw } from '../typings/buyerOrgService'\nimport type { Profile } from '../typings/profileSystem'\nimport { CLSchema } from \"../clients/clClient\";\nimport { ProfileCreationResponse } from \"../clients/profileSystem\";\n\nexport async function createBuyerOrg(ctx: Context, next: () => Promise<void>) {\n const { clients, req } = ctx\n const body: BuyerOrgRaw = await parse.json(req)\n try {\n const { zipCode, streetNumber } = body.address\n const { companyName, tradeName, corporateDocument } = body.company\n\n const address = {\n ...body.address,\n postalCode: zipCode,\n number: streetNumber,\n }\n\n const profile = {\n userId: body.organizationEmail,\n email: body.organizationEmail,\n firstName: tradeName,\n approved: false,\n isCorporate: true,\n corporateName: companyName,\n tradeName,\n corporateDocument,\n }\n\n const currentProfile = await clients.profileSystem.getProfileInfo({\n email: body.organizationEmail,\n userId: body.organizationEmail,\n })\n\n if ((currentProfile as Profile).createdIn) {\n ctx.status = 401\n ctx.body = {\n message: 'Buyer Organization already exists',\n }\n\n return next()\n }\n\n const addresses = { Default: address }\n\n const profileData = await clients.profileSystem.createProfile(profile)\n const clData = await clients.clClient.getClientData((profileData as ProfileCreationResponse).profileId)\n\n await clients.profileSystem.updateAddress(profile, addresses)\n\n ctx.status = 200\n ctx.body = {\n message: 'Buyer Organization created',\n id: (clData as CLSchema[])[0].id\n }\n\n return next()\n } catch (error) {\n console.log('an error occurred when creating the BO in the profile')\n console.log('error:', error.message)\n console.log('body:', body)\n ctx.status = 500\n ctx.body = {\n message: error,\n }\n\n await next()\n }\n}\n\n```" } ]
code_rebuy_61bb81fe
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/messages/hu.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/rebuy.add-to-cart\": \"Hozzáadása a kosárhoz\",\n \"store/rebuy.last-order\": \"Itt az utolsó megrendelés\",\n \"store/rebuy.total\": \"Összesen\"\n}\n\n```" } ]
code_rebuy_e6db7053
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/messages/ja.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/rebuy.add-to-cart\": \"カートに追加\",\n \"store/rebuy.last-order\": \"これは前回の注文です\",\n \"store/rebuy.total\": \"合計\"\n}\n\n```" } ]
code_rebuy_793dbbfa
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/messages/pt.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/rebuy.add-to-cart\": \"Adicionar ao carrinho\",\n \"store/rebuy.last-order\": \"Aqui está seu último pedido\",\n \"store/rebuy.total\": \"Total\"\n}\n\n```" } ]
code_rebuy_176f35bf
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/messages/en.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/rebuy.add-to-cart\": \"Add to cart\",\n \"store/rebuy.last-order\": \"Here is your last order\",\n \"store/rebuy.total\": \"Total\"\n}\n\n```" } ]
code_rebuy_ddc7d06c
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/messages/ro.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/rebuy.add-to-cart\": \"Adaugă în coș\",\n \"store/rebuy.last-order\": \"Iată ultima ta comandă\",\n \"store/rebuy.total\": \"Total\"\n}\n\n```" } ]
code_rebuy_7d0f0f85
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/messages/context.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/rebuy.add-to-cart\": \"Add to cart button label\",\n \"store/rebuy.last-order\": \"Last order title string\",\n \"store/rebuy.total\": \"Total value string\"\n}\n\n```" } ]
code_rebuy_073c3b0c
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/messages/ko.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/rebuy.add-to-cart\": \"장바구니에 담기\",\n \"store/rebuy.last-order\": \"마지막 주문입니다\",\n \"store/rebuy.total\": \"총액\"\n}\n\n```" } ]
code_rebuy_7ec8eb22
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/messages/da.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/rebuy.add-to-cart\": \"Føj til kurv\",\n \"store/rebuy.last-order\": \"Her er din seneste ordre\",\n \"store/rebuy.total\": \"I alt\"\n}\n\n```" } ]
code_rebuy_b2d6271e
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/messages/sv.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/rebuy.add-to-cart\": \"Lägg till i kundvagnen\",\n \"store/rebuy.last-order\": \"Här är din sista beställning\",\n \"store/rebuy.total\": \"Totalt\"\n}\n\n```" } ]
code_rebuy_69cdddc2
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/messages/es.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/rebuy.add-to-cart\": \"Añadir al carrito\",\n \"store/rebuy.last-order\": \"Aquí está tu último pedido\",\n \"store/rebuy.total\": \"Total\"\n}\n\n```" } ]
code_rebuy_80ef1dc5
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/messages/ar.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/rebuy.add-to-cart\": \"إضافة إلى العربة\",\n \"store/rebuy.last-order\": \"هنا طلبك الأخير\",\n \"store/rebuy.total\": \"المجموع\"\n}\n\n```" } ]
code_rebuy_e79c3441
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/docs/README.md from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# rebuy\nVTEX Rebuy app\n\nThis app shows the last order for the identified user, with a button to buy the same products again.\n\n## Usage\n\nFor this to work, you need to create the `lastOrders` schema on the `orders` dataentity. [Docs](http://help.vtex.com/en/tutorial/master-data-v2)\n\n```json\n{\n \"properties\": {\n \"clientProfileData\": {\n \"type\": \"object\",\n \"properties\": {\n \"email\": {\n \"type\": \"string\",\n \"format\": \"email\"\n }\n }\n }\n },\n \"v-default-fields\": [\"items\", \"value\"],\n \"v-security\": {\n \"allowGetAll\": false,\n \"publicRead\": [\"items\", \"value\"],\n \"publicFilter\": [\"clientProfileData\"]\n },\n \"v-indexed\": [\"clientProfileData\"]\n}\n```\n\n```" } ]
code_rebuy_a9650b48
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/index.js from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport { compose, path } from 'ramda'\nimport { graphql } from 'react-apollo'\nimport { session } from 'vtex.store-resources/Queries'\n\nimport userLastOrder from './queries/userLastOrder.gql'\nimport Content from './components/Content'\nimport { userLastOrderType } from './components/propTypes'\n\nclass Rebuy extends Component {\n container = React.createRef()\n\n static propTypes = {\n lastOrderQuery: PropTypes.shape({\n loading: PropTypes.bool,\n userLastOrder: userLastOrderType,\n }),\n sessionQuery: PropTypes.shape({\n loading: PropTypes.bool,\n getSession: PropTypes.shape({ \n profile: PropTypes.object,\n }),\n }),\n }\n state = {\n isVisible: false,\n }\n\n componentDidUpdate(prevProps) {\n const getProfile = (props) => path(['sessionQuery', 'getSession', 'profile'], props)\n const oldProfile = getProfile(prevProps)\n const currentProfile = getProfile(this.props)\n\n // Checking if user just logged in\n if (oldProfile == null && currentProfile != null) {\n this.props.lastOrderQuery.refetch()\n }\n }\n\n triggerOpenTransition = () => {\n setTimeout(() => {\n this.setState({\n isVisible: true,\n })\n\n const containerElement = this.container.current\n\n if (!containerElement) {\n return\n }\n\n const transitionDuration = 800\n // get the actual container height\n containerElement.style.height = 'auto'\n const containerHeight = containerElement.clientHeight\n\n // sets the height back to zero, and triggers a layout,\n // by trying to get getBoundingClientRect\n containerElement.style.height = 0\n containerElement.getBoundingClientRect()\n\n // sets the transition and set the height to the target value\n containerElement.style.transition = `height ${transitionDuration}ms ease-in-out`\n containerElement.style.height = `${containerHeight}px`\n\n // after the transition, sets the height to auto, in case the\n // content or height change\n setTimeout(() => {\n containerElement.style.height = 'auto'\n }, transitionDuration + 100)\n }, 500)\n }\n\n render() {\n const { isVisible } = this.state\n\n const lastOrder = path(['lastOrderQuery', 'userLastOrder'], this.props)\n\n if (!lastOrder) {\n return null\n }\n\n if (!isVisible) {\n this.triggerOpenTransition()\n }\n return <Content lastOrder={lastOrder} />\n }\n}\n\nexport default compose (\n graphql(session, { name: 'sessionQuery'}),\n graphql(userLastOrder, { name: 'lastOrderQuery'}),\n)(Rebuy)\n\n```" } ]
code_rebuy_60229ed0
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/package.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"name\": \"rebuy\",\n \"vendor\": \"vtex\",\n \"version\": \"1.7.0\",\n \"title\": \"Rebuy\",\n \"description\": \"VTEX Rebuy app\",\n \"mustUpdateAt\": \"2019-10-26\",\n \"dependencies\": {\n \"apollo-client\": \"^2.4.7\",\n \"graphql\": \"^14.0.2\",\n \"ramda\": \"^0.26.1\",\n \"react\": \"^16.5.2\",\n \"react-apollo\": \"^2.3.2\",\n \"react-device-detect\": \"^1.6.2\",\n \"react-intl\": \"^2.8.0\",\n \"recompose\": \"^0.30.0\"\n },\n \"devDependencies\": {\n \"@babel/core\": \"^7.2.2\",\n \"@babel/preset-env\": \"^7.3.1\",\n \"babel-jest\": \"^24.0.0\",\n \"babel-preset-react-app\": \"^7.0.0\",\n \"babel\": \"^6.23.0\",\n \"babel-core\": \"^6.26.0\",\n \"babel-preset-es2015\": \"^6.24.1\",\n \"babel-preset-env\": \"^1.7.0\",\n \"enzyme\": \"^3.3.0\",\n \"enzyme-adapter-react-16\": \"^1.1.1\",\n \"enzyme-react-intl\": \"^2.0.0\",\n \"identity-obj-proxy\": \"^3.0.0\",\n \"intl\": \"^1.2.5\",\n \"jest\": \"^24.0.0\",\n \"jsdom\": \"^11.10.0\",\n \"react-dom\": \"^16.3.1\"\n },\n \"jest\": {\n \"verbose\": true,\n \"transform\": {\n \"^.+\\\\.(js|jsx|mjs)$\": \"<rootDir>/node_modules/babel-jest\"\n },\n \"setupFiles\": [\n \"./setupTests.js\"\n ],\n \"transformIgnorePatterns\": [\n \"[/\\\\\\\\]node_modules[/\\\\\\\\].+\\\\.(js|jsx|mjs)$\"\n ],\n \"moduleNameMapper\": {\n \"\\\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$\": \"<rootDir>/__test__/fileMock.js\",\n \"\\\\.(css|less|scss)$\": \"identity-obj-proxy\"\n }\n }\n}\n\n```" } ]
code_rebuy_c46d0a30
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/rebuy.css from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.item {}\n.items {}\n.itemColumn {}\n.itemDetails {}\n.itemName {}\n.itemPrice {}\n.itemImage {}\n\n.totalContainer {}\n.totalTitle {}\n.totalPrice {}\n\n```" } ]
code_rebuy_c8107415
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/setupTests.js from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport Enzyme from 'enzyme'\nimport Adapter from 'enzyme-adapter-react-16'\n\n/* eslint-disable */\nwindow.matchMedia = window.matchMedia || function () {\n return {\n matches: false,\n addListener: function () { },\n removeListener: function () { },\n }\n}\n\nEnzyme.configure({ adapter: new Adapter() })\n```" } ]
code_rebuy_62f96afd
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/store/interfaces.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"rebuy\": {\n \"required\": [\n \"greeting\"\n ],\n \"component\": \"index\"\n },\n \"greeting\": {\n \"component\": \"vtex.store-components/Greeting\"\n }\n}\n```" } ]
code_rebuy_efb0b62a
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/queries/userLastOrder.gql from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```graphql\nquery userLastOrder {\n userLastOrder {\n orderId\n value\n orderGroup\n items {\n uniqueId\n id\n name\n sellingPrice\n imageUrl\n detailUrl\n quantity\n parentItemIndex\n parentAssemblyBinding\n seller\n additionalInfo {\n brandName\n }\n }\n totals {\n id\n name\n value\n }\n }\n}\n\n```" } ]
code_rebuy_2b40d6e5
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/utils/attachments.js from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport { all, compose, filter, isNil, map, partition, pick, propEq, propOr, props, values } from 'ramda'\n\nexport const isParentItem = item => all(isNil, props(['parentItemIndex', 'parentAssemblyBinding'], item))\n\nexport const separateParentChildren = (items) => partition(isParentItem, items)\n\nconst parseOrderItemToButton = ({ id, sellingPrice, additionalInfo={}, ...rest }) =>\n ({ ...rest, skuId: id, price: sellingPrice / 100, brand: additionalInfo.brandName })\n\nexport const buildItemsWithOptions = (lastItems) => {\n const [parentItems, assemblyOptions] = separateParentChildren(lastItems)\n\n const parentMap = parentItems.reduce((prev, curr) => \n ({ ...prev, [curr.id]: parseOrderItemToButton(curr) }), {})\n\n const pickProps = pick(['skuId', 'quantity', 'seller', 'options', 'price', 'name', 'brand'])\n const mapAndPick = compose(map(pickProps), values)\n \n return mapAndPick(\n assemblyOptions.reduce((prev, currOption) => {\n const { parentItemIndex, parentAssemblyBinding } = currOption\n const parentId = lastItems[parentItemIndex].id\n const parentObj = prev[parentId]\n const option = {\n assemblyId: parentAssemblyBinding,\n ...pick(['id', 'quantity', 'seller'], currOption),\n }\n const options = [...propOr([], 'options', parentObj), option]\n parentObj.options = options\n return {\n ...prev,\n [parentId]: parentObj,\n }\n }, parentMap)\n )\n}\n\nconst isSonOfIndex = (index) => propEq('parentItemIndex', index)\n\nexport const sumTotalPricePerUnit = (assemblyOptions, parentIndex, parentItem) => {\n const children = filter(isSonOfIndex(parentIndex), assemblyOptions)\n return children.reduce(\n (total, item) => total + item.sellingPrice * item.quantity / parentItem.quantity,\n parentItem.sellingPrice\n )\n}\n\n```" } ]
code_rebuy_358d1313
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/components/OrderTotal.js from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport React, { memo } from 'react'\nimport { number } from 'prop-types'\nimport { FormattedMessage } from 'react-intl'\nimport ProductPrice from 'vtex.store-components/ProductPrice'\n\nimport rebuy from '../rebuy.css'\n\nconst OrderTotal = ({ value = 0 }) => (\n <div className={`${rebuy.totalContainer} flex justify-end items-end mt6-s`}>\n <span className={`${rebuy.totalTitle} t-heading-5 c-on-base`}>\n <FormattedMessage id=\"store/rebuy.total\" />\n </span>\n <span className={`${rebuy.totalPrice} ml4`}>\n <ProductPrice sellingPriceClass=\"c-on-base t-heading-5\" sellingPrice={value / 100} showListPrice={false} showLabels={false} />\n </span>\n </div>\n)\n\nOrderTotal.propTypes = {\n value: number.isRequired,\n}\n\nexport default memo(OrderTotal)\n\n```" } ]
code_rebuy_3c54da51
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/components/ItemImage.js from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport React, { memo } from 'react'\nimport { string, number } from 'prop-types'\nimport { head } from 'ramda'\n\nimport rebuy from '../rebuy.css'\n\nconst httpRegex = new RegExp(/http:\\/\\//)\n\nexport function toHttps(url) {\n return url.replace(httpRegex, 'https://')\n}\n\nconst correctImageUrl = (imageUrl, size) => {\n const urlSplitted = imageUrl.split('/')\n const idsStringIdx = urlSplitted.findIndex(content => content === 'ids')\n if (idsStringIdx < 0 || idsStringIdx === urlSplitted.length - 1) return imageUrl\n const sizeStringIdx = idsStringIdx + 1\n const sizeString = urlSplitted[sizeStringIdx]\n const imageId = head(sizeString.split('-'))\n const newSizeString = `${imageId}-${size * 2}-auto`\n return [...urlSplitted.slice(0, sizeStringIdx), newSizeString, ...urlSplitted.slice(sizeStringIdx+1)].join('/')\n}\n\nconst ItemImage = ({ imageUrl, size }) => (\n <img\n width={size}\n height={size}\n className={`${rebuy.itemImage}`}\n src={correctImageUrl(toHttps(imageUrl), size)}\n />\n)\n\nItemImage.propTypes = {\n imageUrl: string.isRequired,\n size: number.isRequired,\n}\n\nexport default memo(ItemImage)\n```" } ]
code_rebuy_52a57ddd
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/components/OrderItems.js from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport React from 'react'\nimport { arrayOf } from 'prop-types'\n\nimport { orderItemType } from './propTypes'\nimport OrderItem from './OrderItem'\n\nimport { isParentItem, separateParentChildren } from '../utils/attachments'\n\nimport rebuy from '../rebuy.css'\n\nconst OrderItems = ({ items = [] }) => {\n const [_, assemblyOptions] = separateParentChildren(items)\n return (\n <ul className={`${rebuy.items} list ma0 pa0`}>\n {items.map((item, index) => isParentItem(item) ? (\n <OrderItem {...{ item, assemblyOptions, index}} key={item.uniqueId} />\n ) : null)}\n </ul>\n )\n}\n\nOrderItems.propTypes = {\n items: arrayOf(orderItemType),\n}\n\nexport default OrderItems\n\n```" } ]
code_rebuy_5d7d8988
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/components/OrderItem.js from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport React from 'react'\nimport { arrayOf, number } from 'prop-types'\nimport { Link } from 'vtex.render-runtime'\nimport ProductPrice from 'vtex.store-components/ProductPrice'\n\nimport { orderItemType } from './propTypes'\nimport ItemImage from './ItemImage'\n\nimport { sumTotalPricePerUnit } from '../utils/attachments'\n\nimport rebuy from '../rebuy.css'\n\nconst OrderItem = ({ item, index, assemblyOptions }) => (\n <li className={`${rebuy.item} flex justify-between pt3 bb b--muted-4`}>\n <div className={`${rebuy.itemColumn} flex-shrink-0 mr5`}>\n <Link className=\"link c-muted-1\" to={item.detailUrl}>\n <ItemImage size={64} imageUrl={item.imageUrl} />\n </Link>\n </div>\n <div className={`${rebuy.itemColumn} flex-auto`}>\n <div className={`${rebuy.itemDetails} flex justify-center justify-between-ns items-center-ns flex-column flex-row-ns h-100 mb2-s`}>\n <Link className=\"link t-body t-heading-5-ns c-on-base\" to={item.detailUrl}>\n <span className={`${rebuy.itemName}`}>{`${item.quantity}x ${item.name}`}</span>\n </Link>\n <span className={`${rebuy.itemPrice}`}>\n <ProductPrice\n sellingPriceClass=\"c-on-base t-body t-heading-5-ns b-s\"\n sellingPrice={sumTotalPricePerUnit(assemblyOptions, index, item) / 100}\n showListPrice={false}\n showLabels={false}\n />\n </span>\n </div>\n </div>\n </li>\n)\n\nOrderItem.propTypes = {\n item: orderItemType.isRequired,\n index: number.isRequired,\n assemblyOptions: arrayOf(orderItemType).isRequired,\n}\n\nexport default OrderItem\n```" } ]
code_rebuy_7a0829c8
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/components/propTypes.js from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport PropTypes from 'prop-types'\n\nexport const orderItemType = PropTypes.shape({\n uniqueId: PropTypes.string,\n id: PropTypes.string,\n name: PropTypes.string,\n sellingPrice: PropTypes.number,\n imageUrl: PropTypes.string,\n detailUrl: PropTypes.string,\n quantity: PropTypes.number,\n parentItemIndex: PropTypes.number,\n parentAssemblyBinding: PropTypes.string,\n seller: PropTypes.string,\n additionalInfo: PropTypes.shape({ brandName: PropTypes.string }),\n})\n\nexport const userLastOrderType = PropTypes.shape({\n orderId: PropTypes.string,\n value: PropTypes.number,\n orderGroup: PropTypes.string,\n items: PropTypes.arrayOf(orderItemType),\n totals: PropTypes.arrayOf(PropTypes.shape({\n id: PropTypes.string,\n name: PropTypes.string,\n value: PropTypes.number,\n }))\n})\n\n```" } ]
code_rebuy_abda5af3
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/components/Content.js from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nimport React, { Fragment, useCallback, useState} from 'react'\nimport { isMobileOnly } from 'react-device-detect'\nimport { prop, find, propEq } from 'ramda'\nimport { ExtensionPoint } from 'vtex.render-runtime'\nimport { FormattedMessage } from 'react-intl'\nimport { Button } from 'vtex.styleguide'\nimport OrderItems from './OrderItems'\nimport OrderTotal from './OrderTotal'\nimport { userLastOrderType } from './propTypes'\n\nconst Wrapper = ({children}) => (\n <div className=\"mv4 mh4 mh6-ns bg-base border-box br1 bw1 ba b--muted-4\">\n {children}\n </div>\n)\n\nconst LastOrderLabel = () => (\n <div className=\"t-body c-on-base ml4-ns\">\n <FormattedMessage id=\"store/rebuy.last-order\" />\n </div>\n) \n \nconst AddButton = ({ onClick, isLoading }) => (\n <div className=\"pt5 pt7-ns mh5\">\n <Button block onClick={onClick} isLoading={isLoading}>\n <FormattedMessage id=\"store/rebuy.add-to-cart\" />\n </Button>\n </div>\n)\n\nconst findItemTotal = (lastOrder) => prop('value', find(propEq('id', 'Items'), lastOrder.totals))\n\nconst MobileContent = ({ lastOrder, onClick, isLoading }) => (\n <Fragment>\n <ExtensionPoint id=\"greeting\" />\n <Wrapper>\n <div className=\"w-100 pa4 flex flex-column\">\n <LastOrderLabel />\n <OrderItems items={lastOrder.items} />\n <OrderTotal value={findItemTotal(lastOrder)} />\n </div>\n </Wrapper>\n <AddButton onClick={onClick} isLoading={isLoading} />\n </Fragment> \n)\n\nconst Content = ({ lastOrder }) => {\n const [isLoading, setLoading] = useState(false);\n\n const goToCart = useCallback(() => {\n setLoading(true)\n location.assign(`/checkout/orderform/createby/${lastOrder.orderGroup}`)\n }, [lastOrder.orderGroup])\n\n if (isMobileOnly) {\n return <MobileContent lastOrder={lastOrder} onClick={goToCart} isLoading={isLoading} />\n }\n return (\n <Wrapper>\n <div className=\"w-100 pv6 ph4 flex\">\n <div className=\"w-third\">\n <ExtensionPoint id=\"greeting\" />\n <LastOrderLabel />\n <AddButton onClick={goToCart} isLoading={isLoading} />\n </div>\n <div className=\"mh6 ba b--muted-4\" style={{ width: '1px' }} />\n <div className=\"w-two-thirds flex flex-column justify-between\">\n <OrderItems items={lastOrder.items} />\n <OrderTotal value={findItemTotal(lastOrder)} />\n </div>\n </div>\n </Wrapper>\n )\n}\n\nContent.propTypes = {\n lastOrder: userLastOrderType,\n}\n\nexport default Content\n\n```" } ]
code_rebuy_98ee6407
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/utils/__mock__/lastOrderMock.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{ \n \"orderId\":\"111aaa\",\n \"value\":1750,\n \"items\":[ \n { \n \"uniqueId\":\"0\",\n \"id\":\"0\",\n \"name\":\"Pepperoni small\",\n \"sellingPrice\":1400,\n \"imageUrl\":\"http://delivery.vteximg.com.br/arquivos/ids/155439-55-55/pepperoni-feast.0e1c4c9e7b8900d08cc51ff285fd9ae3.1.jpg?v=636770441237070000\",\n \"detailUrl\":\"/pizza-pepperoni/p\",\n \"quantity\":1,\n \"parentItemIndex\":null,\n \"parentAssemblyBinding\":null,\n \"seller\":\"1\",\n \"additionalInfo\":{ \n \"brandName\":\"Pizza\"\n }\n },\n { \n \"uniqueId\":\"1\",\n \"id\":\"1\",\n \"name\":\"Pepperoni\",\n \"sellingPrice\":0,\n \"imageUrl\":\"http://delivery.vteximg.com.br/arquivos/ids/155439-55-55/pepperoni-feast.0e1c4c9e7b8900d08cc51ff285fd9ae3.1.jpg?v=636770441237070000\",\n \"detailUrl\":\"/pizza-pepperoni/p\",\n \"quantity\":1,\n \"parentItemIndex\":0,\n \"parentAssemblyBinding\":\"Pepperoni - Small_Basic Toppings\",\n \"seller\":\"1\",\n \"additionalInfo\":{ \n \"brandName\":\"Pizza\"\n }\n },\n { \n \"uniqueId\":\"2\",\n \"id\":\"2\",\n \"name\":\"Onion\",\n \"sellingPrice\":0,\n \"imageUrl\":\"http://delivery.vteximg.com.br/arquivos/ids/155439-55-55/pepperoni-feast.0e1c4c9e7b8900d08cc51ff285fd9ae3.1.jpg?v=636770441237070000\",\n \"detailUrl\":\"/pizza-pepperoni/p\",\n \"quantity\":1,\n \"parentItemIndex\":0,\n \"parentAssemblyBinding\":\"Pepperoni - Small_Basic Toppings\",\n \"seller\":\"1\",\n \"additionalInfo\":{ \n \"brandName\":\"Pizza\"\n }\n },\n { \n \"uniqueId\":\"2\",\n \"id\":\"2\",\n \"name\":\"Classic Crust\",\n \"sellingPrice\":0,\n \"imageUrl\":\"http://delivery.vteximg.com.br/arquivos/ids/155439-55-55/pepperoni-feast.0e1c4c9e7b8900d08cc51ff285fd9ae3.1.jpg?v=636770441237070000\",\n \"detailUrl\":\"/pizza-pepperoni/p\",\n \"quantity\":1,\n \"parentItemIndex\":0,\n \"parentAssemblyBinding\":\"Pepperoni - Small_Crust\",\n \"seller\":\"1\",\n \"additionalInfo\":{ \n \"brandName\":\"Pizza\"\n }\n },\n { \n \"uniqueId\":\"3\",\n \"id\":\"1\",\n \"name\":\"Pepperoni\",\n \"sellingPrice\":100,\n \"imageUrl\":\"http://delivery.vteximg.com.br/arquivos/ids/155439-55-55/pepperoni-feast.0e1c4c9e7b8900d08cc51ff285fd9ae3.1.jpg?v=636770441237070000\",\n \"detailUrl\":\"/pizza-pepperoni/p\",\n \"quantity\":2,\n \"parentItemIndex\":0,\n \"parentAssemblyBinding\":\"Pepperoni - Small_Toppings\",\n \"seller\":\"1\",\n \"additionalInfo\":{ \n \"brandName\":\"Pizza\"\n }\n }\n ],\n \"totals\":[ \n { \n \"id\":\"Items\",\n \"name\":\"Items\",\n \"value\":1600\n },\n { \n \"id\":\"Shipping\",\n \"name\":\"Shipping\",\n \"value\":150\n }\n ]\n}\n```" } ]
code_rebuy_e44dfa7f
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/utils/__mock__/productOrderSnapshot.json from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n[ \n { \n \"skuId\":\"0\",\n \"quantity\":1,\n \"seller\":\"1\",\n \"options\":[ \n { \n \"assemblyId\":\"Pepperoni - Small_Basic Toppings\",\n \"id\":\"1\",\n \"quantity\":1,\n \"seller\":\"1\"\n },\n { \n \"assemblyId\":\"Pepperoni - Small_Basic Toppings\",\n \"id\":\"2\",\n \"quantity\":1,\n \"seller\":\"1\"\n },\n { \n \"assemblyId\":\"Pepperoni - Small_Crust\",\n \"id\":\"2\",\n \"quantity\":1,\n \"seller\":\"1\"\n },\n { \n \"assemblyId\":\"Pepperoni - Small_Toppings\",\n \"id\":\"1\",\n \"quantity\":2,\n \"seller\":\"1\"\n }\n ],\n \"price\":14,\n \"name\":\"Pepperoni small\",\n \"brand\":\"Pizza\"\n }\n]\n```" } ]
code_rebuy_393ac525
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of rebuy/react/utils/__tests__/attachments.test.js from the rebuy VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\n/* eslint-env jest */\nimport { equals } from 'ramda'\n\nimport { buildItemsWithOptions, separateParentChildren, sumTotalPricePerUnit } from '../attachments'\nimport lastOrderMock from '../__mock__/lastOrderMock.json'\nimport productOrderSnapshot from '../__mock__/productOrderSnapshot.json'\n\nit('build buy button products with assembly options properly', () => {\n const productItems = buildItemsWithOptions(lastOrderMock.items)\n expect(productItems.length).toBe(1)\n expect(productItems[0].options.length).toBe(4)\n expect(equals(productItems, productOrderSnapshot)).toBe(true)\n})\n\nit('should sum price of parent with its children', () => {\n const [_, assemblyoptions] = separateParentChildren(lastOrderMock.items)\n const pepperoniWholePrice = sumTotalPricePerUnit(assemblyoptions, 0, lastOrderMock.items[0])\n expect(pepperoniWholePrice).toBe(1600)\n})\n```" } ]
code_shareasale_d288acb2
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shareasale/docs/README.md from the shareasale VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# Shareasale\n\nVTEX Shareasale first-party app\n\n## How to install\n\nOpen the VTEX App Store and install this app on your store.\n\nNow, open the app settings on your admin and fill in your Shareasale's Merchant ID and Transaction Type.\n\n```" } ]
code_shareasale_003d53f9
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shareasale/react/index.tsx from the shareasale VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport { canUseDOM } from 'vtex.render-runtime'\nimport { Order, PixelMessage } from './typings/events'\n\nfunction addPixelImage(order: Order) {\n const merchantId = window.__shareasale_merchant_id\n const transtype = window.__shareasale_transtype\n\n if (!merchantId || !transtype) {\n return\n }\n\n const total = order.transactionSubtotal\n const orderId = order.transactionId\n\n const img = document.createElement('img')\n const url = `https://shareasale.com/sale.cfm?amount=${total}&tracking=${orderId}&transtype=${transtype}&merchantID=${merchantId}`\n\n img.setAttribute('width', '1')\n img.setAttribute('height', '1')\n img.setAttribute('src', url)\n\n document.body.appendChild(img)\n}\n\nfunction handleMessages(e: PixelMessage) {\n switch (e.data.eventName) {\n case 'vtex:orderPlaced': {\n const order = e.data\n addPixelImage(order)\n break\n }\n default:\n break\n }\n}\n\nif (canUseDOM) {\n window.addEventListener('message', handleMessages)\n}\n\n```" } ]
code_shareasale_33462bad
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shareasale/react/package.json from the shareasale VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"scripts\": {\n \"lint\": \"tsc --noEmit --pretty && tslint -c tslint.json './**/*.ts'\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^10.12.18\",\n \"@types/prop-types\": \"^15.5.6\",\n \"@types/ramda\": \"types/npm-ramda#dist\",\n \"@types/react\": \"^16.4.14\",\n \"tslint\": \"^5.11.0\",\n \"tslint-config-vtex\": \"^2.0.0\",\n \"tslint-eslint-rules\": \"^5.4.0\",\n \"typescript\": \"^3.1.1\"\n },\n \"version\": \"1.0.3\"\n}\n\n```" } ]
code_shareasale_9e40d245
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shareasale/store/interfaces.json from the shareasale VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"pixel.shareasale\": {\n \"component\": \"index\"\n }\n}\n\n```" } ]
code_shareasale_0247d6bb
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shareasale/react/typings/events.d.ts from the shareasale VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport interface PixelMessage extends MessageEvent {\n data: OrderPlacedData\n}\n\nexport interface EventData {\n event: string\n eventName: string\n currency: string\n}\n\nexport interface OrderPlacedData extends Order, EventData {\n event: 'orderPlaced'\n eventName: 'vtex:orderPlaced'\n}\n\nexport interface Order {\n currency: string\n accountName: string\n orderGroup: string\n salesChannel: string\n coupon: string\n visitorType: string\n visitorContactInfo: string[]\n visitorAddressState: string\n visitorAddressCountry: string\n visitorAddressPostalCode: string\n transactionId: string\n transactionDate: string\n transactionAffiliation: string\n transactionTotal: number\n transactionShipping: number\n transactionSubtotal: number\n transactionDiscounts: number\n transactionTax: number\n transactionCurrency: string\n transactionPaymentType: PaymentType[]\n transactionShippingMethod: ShippingMethod[]\n transactionProducts: ProductOrder[]\n transactionPayment: {\n id: string\n }\n}\n\ninterface PaymentType {\n group: string\n paymentSystemName: string\n installments: number\n value: number\n}\n\ninterface ShippingMethod {\n itemId: string\n selectedSla: string\n}\n\ninterface ProductOrder {\n id: string\n name: string\n sku: string\n skuRefId: string\n skuName: string\n brand: string\n brandId: string\n seller: string\n sellerId: string\n category: string\n categoryId: string\n categoryTree: string[]\n categoryIdTree: string[]\n priceTags: PriceTag[]\n originalPrice: number\n price: number\n sellingPrice: number\n tax: number\n quantity: number\n components: any[]\n measurementUnit: string\n unitMultiplier: number\n}\n\ninterface PriceTag {\n identifier: string\n isPercentual: boolean\n value: number\n}\n\n```" } ]
code_shareasale_261941fb
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shareasale/react/typings/vtex.render-runtime.d.ts from the shareasale VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.render-runtime' {\n export const canUseDOM: boolean\n}\n\n```" } ]
code_shareasale_29ca155a
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of shareasale/react/typings/global.d.ts from the shareasale VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ninterface Window extends Window {\n __shareasale_merchant_id: string\n __shareasale_transtype: string\n}\n\n```" } ]
code_iodas-bookstore-theme_71514600
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/sitemap/sitemap.json from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"urlset\": {\n \"url\": [\n {\n \"loc\": \"https://storetheme.vtex.com/about-us\"\n }\n ]\n }\n}\n```" } ]
code_iodas-bookstore-theme_2e943e07
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks.jsonc from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n/* Blocks can be defined both on the store/blocks.json file, and in any number of json\n * files inside the store/blocks directory, with any arbitrary directory structure.\n *\n * Additionally, all blocks files can support comments, such as this one, if given the\n * .jsonc file extension.\n *\n * The store/blocks.json file is intended for backwards compatibility, for miscellaneous\n * blocks, or if the app is simple enough that it doesn't warrant splitting the file.\n */\n{\n \"store.orderplaced\": {\n \"blocks\": [\"order-placed\"]\n },\n\n \"store.account\": {\n \"blocks\": [\"my-account\"],\n \"parent\": {\n \"challenge\": \"challenge.profile\"\n }\n },\n\n \"store.login\": {\n \"blocks\": [\"login-content#default\"]\n },\n\n \"login-content#default\": {\n \"props\": {\n \"isInitialScreenOptionOnly\": false,\n \"defaultOption\": 1,\n \"showPasswordVerificationIntoTooltip\": true\n }\n },\n\n\"product-summary.shelf\": {\n \"children\": [\n \"product-summary-name\",\n \"product-summary-price\",\n \"product-summary-buy-button\",\n \"product-summary-image\",\n \"product-rating-inline\"\n ],\n \"props\": {\n \"showListPrice\": true,\n \"showLabels\": true,\n \"showInstallments\": true,\n \"showBadge\": true,\n \"labelSellingPrice\": \"POR\",\n \"labelListPrice\": \"DE\",\n \"showSavings\": true\n }\n},\n\n \"store.product-review-form\": {\n \"blocks\": [\"product-review-form\"]\n }\n}\n\n```" } ]
code_iodas-bookstore-theme_bc186aa2
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/routes.json from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.custom#black-friday\": {\n \"path\": \"/blackfriday\"\n }\n}\n\n```" } ]
code_iodas-bookstore-theme_c14315f1
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/styles/css/vtex.rich-text.css from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.container--deals {\n color: #ffffff;\n}\n\n.italic--deals {\n text-align: right;\n justify-content: right ;\n}\n\n.container--deals .paragraph {\n margin: 0;\n}\n\n.container--link {\n justify-content: center;\n}\n\n.container--question {\n justify-content: center;\n}\n\n.container--bf-lp-text {\n color: #fff;\n}\n\n.container--question .paragraph {\n text-align: center;\n max-width: 540px;\n margin: 0 16px;\n padding-top: 120px;\n color: #03034E;\n}\n\n.container--question .strong {\n font-size: 32px;\n line-height: 2rem;\n font-weight: 700;\n}\n\n.container--link .paragraph {\n text-align: center;\n max-width: 540px;\n padding-top: 36px;\n padding-bottom: 84px;\n color: #03034E;\n}\n\n.container--link .strong {\n font-size: 16px;\n font-weight: 700;\n text-transform: uppercase;\n}\n\n.container--link .link {\n text-decoration: none;\n font-size: 36px;\n font-weight: 300;\n color: #03034E;\n}\n\n.container--title {\n color: #03034E;\n font-size: 28px;\n font-weight: 700;\n}\n\n@media only screen and (min-width: 640px) {\n .container--question .strong {\n font-size: 40px;\n line-height: 3rem;\n }\n\n .container--about {\n max-width: 85%;\n }\n\n .container--title {\n color: #03034E;\n font-size: 40px;\n font-weight: 700;\n max-width: 60%;\n }\n\n .container--title .paragraph {\n line-height: 1.3em;\n }\n}\n\n```" } ]
code_iodas-bookstore-theme_fa6b8f54
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/styles/css/vtex.product-summary.css from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.image {\n position: relative;\n margin-top: -180px;\n}\n.container {\n border: 1px solid #eee;\n}\n\n.container img {\n background: #eee;\n}\n\n.container:hover img {\n opacity: 0.05;\n z-index: -1;\n transition: transform .5s ease;\n transform: scale(1.40);\n}\n\n.buyButton {\n width: 40%;\n}\n\n.container:hover .priceContainer span {\n transform: scale(1.5);\n font-weight: bolder;\n}\n\n.container:hover .nameContainer span {\n font-weight: bolder;\n}\n\n\n\n```" } ]
code_iodas-bookstore-theme_90eabb78
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/styles/css/vtex.store-header.css from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.headerRow--menu-link :global(.vtex-menu-2-x-styledLink) {\n color: #ffffff;\n font-size: 14px;\n}\n\n.headerRow--main-header .headerRowBackground {\n background-color: #F0F0F0;\n}\n\n.headerRow--main-header :global(.vtex-menu-2-x-styledLink) {\n color: #727273;\n font-size: 14px;\n}\n\n.headerRow--main-header-mobile .headerRowBackground {\n padding: 10px 0px;\n background-color: #F0F0F0;\n}\n\n```" } ]
code_iodas-bookstore-theme_145db81a
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/styles/css/vtex.store-components.css from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.notificationBarContainer {\n background-color: #F71963;\n color: #FFFFFF;\n font-weight: 700;\n font-size: 12px;\n text-decoration: none;\n}\n\n.searchBarContainer {\n max-width: 265px;\n}\n\n.infoCardContainer--info-card-home {\n max-width: 1520px;\n margin: 0 auto;\n background-color: #E6F1E6;\n padding: 0px;\n}\n\n.newsletter {\n background: url(\"https://uploaddeimagens.com.br/images/002/472/280/original/background_newsletter_final.jpg?1572620965\") no-repeat;\n background-size: 100%;\n max-width: 100%;\n margin: 0 auto;\n}\n\n.newsletter .container {\n padding: 60px 10px;\n}\n\n.label {\n color: #fff;\n font-size: 26px;\n}\n\n.inputGroup {\n padding-bottom: 4px;\n border-bottom: 2px solid #fff;\n display: flex;\n color: #fff;\n}\n\n.inputGroup input {\n background-color: transparent;\n color: #fff;\n border: none;\n padding-left: 0px;\n}\n\n.inputGroup input::placeholder {\n color: #fff;\n font-size: 16px;\n}\n\n.inputGroup button {\n background-color: transparent;\n color: #fff;\n border: none;\n margin-right: -24px;\n}\n\n.buttonContainer {\n padding-top: 0px;\n}\n\n.imageElement--storePrint {\n max-height: 300px;\n margin-bottom: 20px;\n}\n\n@media only screen and (min-width: 640px) {\n .newsletter .container {\n padding: 140px;\n }\n\n .label {\n font-size: 40px;\n }\n\n .infoCardContainer--info-card-home .infoCardTextContainer {\n width: 30%;\n }\n\n .infoCardContainer--info-card-home .infoCardImageContainer {\n width: 70%;\n }\n\n .imageElement--storePrint {\n margin-bottom: 0px;\n max-height: 600px;\n }\n}\n\n.imageElement--home-special-card:hover {\n transition: transform .5s ease;\n transform: scale(1.10);\n}\n\n.productDescriptionTitle {\n display: none;\n}\n\n.productDescriptionContainer {\n margin: 35px 0;\n text-transform: uppercase;\n}\n\n.productDescriptionContainer .h-auto {\n color: #000 !important;\n}\n\n.productNameContainer span {\n font-weight: bold;\n text-transform: uppercase;\n font-size: xx-large;\n}\n\n```" } ]
code_iodas-bookstore-theme_7bd6aa92
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/styles/css/vtex.store-footer.css from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.row--menu-row {\n padding-right: 24px;\n}\n\n.row--menu-row .rowContainer {\n align-items: flex-start;\n}\n\n.row--payment-methods {\n padding-top: 16px;\n}\n\n.row {\n background: #6f99ad;\n}\n\n```" } ]
code_iodas-bookstore-theme_2f971db8
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/styles/css/vtex.flex-layout.css from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.flexRow--deals {\n background-color: #a7afbd;\n padding: 14px 0px;\n}\n\n.flexRow--deals .stretchChildrenWidth {\n align-items: normal;\n}\n\n.flexRow--deals .flexCol {\n align-items: normal;\n}\n\n.flexCol--filterCol {\n max-width: 500px;\n min-width: 230px;\n}\n\n.flexCol--productCountCol {\n align-items: flex-start;\n}\n\n.flexCol--orderByCol {\n align-items: flex-end;\n}\n\n.flexCol--orderByMobileCol {\n width: 42%;\n}\n\n.flexCol--filterMobileCol {\n width: 38%;\n}\n\n.flexCol--switcherMobileCol {\n width: 20%;\n}\n\n.flexRow--bf-lp-banner {\n background: url(https://www.iwantwallpaper.co.uk/images/arthouse-vip-black-brick-wall-pattern-faux-stone-effect-motif-mural-wallpaper-623007-p2130-4065_image.jpg);\n background-size: \"150px\";\n}\n\n.flexRow--product-main {\n background-color: #ffb30f;\n}\n\n```" } ]
code_iodas-bookstore-theme_225ffd08
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/styles/css/vtex.carousel.css from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.containerImg {\n background-color: #F0F0F0;\n}\n\n.containerImg img {\n max-width: 1520px;\n position: inherit;\n}\n\n.containerImg div {\n position: relative;\n}\n\n```" } ]
code_iodas-bookstore-theme_eaef348c
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/styles/css/vtex.slider-layout.css from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.sliderLayoutContainer--deals {\n background-color: #a7afbd;\n padding: 14px 0px;\n}\n\n```" } ]
code_iodas-bookstore-theme_b651ec90
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/styles/css/vtex.stack-layout.css from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.stackContainer--product-outdoor {\n background-color: #ffb30f;\n}\n\n.stackItem--product-outdoor {\n width: 100%;\n top: none;\n bottom: 0;\n}\n\n\n```" } ]
code_iodas-bookstore-theme_8edd2caf
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/styles/configs/style.json from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"typeScale\": [\n 3, 2.25, 1.5, 1.25, 1, 0.875, 0.75\n ],\n \"spacing\": [0.125, 0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4, 8, 16],\n \"customMedia\": [\n { \"s\": 20 },\n { \"ns\": {\n \"value\": 40,\n \"minWidth\": true\n }\n },\n { \"m\": {\n \"value\": 40,\n \"minWidth\": true\n }\n },\n { \"l\": {\n \"value\": 64,\n \"minWidth\": true\n }\n },\n { \"xl\": {\n \"value\": 80,\n \"minWidth\": true\n }\n }\n ],\n \"colors\": {\n \"black-90\": \"rgba(0,0,0,.9)\",\n \"black-80\": \"rgba(0,0,0,.8)\",\n \"black-70\": \"rgba(0,0,0,.7)\",\n \"black-60\": \"rgba(0,0,0,.6)\",\n \"black-50\": \"rgba(0,0,0,.5)\",\n \"black-40\": \"rgba(0,0,0,.4)\",\n \"black-30\": \"rgba(0,0,0,.3)\",\n \"black-20\": \"rgba(0,0,0,.2)\",\n \"black-10\": \"rgba(0,0,0,.1)\",\n \"black-05\": \"rgba(0,0,0,.05)\",\n \"black-025\": \"rgba(0,0,0,.025)\",\n \"black-0125\": \"rgba(0,0,0,.0125)\",\n\n \"white-90\": \"rgba(255,255,255,.9)\",\n \"white-80\": \"rgba(255,255,255,.8)\",\n \"white-70\": \"rgba(255,255,255,.7)\",\n \"white-60\": \"rgba(255,255,255,.6)\",\n \"white-50\": \"rgba(255,255,255,.5)\",\n \"white-40\": \"rgba(255,255,255,.4)\",\n \"white-30\": \"rgba(255,255,255,.3)\",\n \"white-20\": \"rgba(255,255,255,.2)\",\n \"white-10\": \"rgba(255,255,255,.1)\",\n \"white-05\": \"rgba(255,255,255,.05)\",\n \"white-025\": \"rgba(255,255,255,.025)\",\n \"white-0125\": \"rgba(255,255,255,.0125)\"\n },\n \"semanticColors\": {\n \"background\": {\n \"base\": \"#ffffff\",\n \"base--inverted\": \"#03044e\",\n \"action-primary\": \"#000000\",\n \"action-secondary\": \"#eef3f7\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#f2f4f5\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"hover-background\": {\n \"action-primary\": \"#666\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"active-background\": {\n \"action-primary\": \"#0c389f\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"text\": {\n \"action-primary\": \"#0F3E99\",\n \"action-secondary\": \"#eef3f7\",\n \"link\": \"#0F3E99\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#979899\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"visited-text\": {\n \"link\": \"#0c389f\"\n },\n \"hover-text\": {\n \"action-primary\": \"#072c75\",\n \"action-secondary\": \"#dbe9fd\",\n \"link\": \"#0c389f\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\"\n },\n \"active-text\": {\n \"link\": \"#0c389f\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\"\n },\n \"border\": {\n \"action-primary\": \"#000000\",\n \"action-secondary\": \"#eef3f7\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#e3e4e6\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"hover-border\": {\n \"action-primary\": \"#000000\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"active-border\": {\n \"action-primary\": \"#000000\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"on\": {\n \"base\": \"#3f3f40\",\n \"base--inverted\": \"#ffffff\",\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#0F3E99\",\n \"emphasis\": \"#ffffff\",\n \"disabled\": \"#979899\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\",\n \"muted-1\": \"#ffffff\",\n \"muted-2\": \"#ffffff\",\n \"muted-3\": \"#3f3f40\",\n \"muted-4\": \"#3f3f40\",\n \"muted-5\": \"#3f3f40\"\n },\n \"hover-on\": {\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#0F3E99\",\n \"emphasis\": \"#ffffff\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\"\n },\n \"active-on\": {\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#0F3E99\",\n \"emphasis\": \"#ffffff\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\"\n }\n },\n \"borderWidths\": [0, 0.125, 0.25, 0.5, 1, 2],\n \"borderRadius\": [0, 0.125, 0.25, 0.5, 1],\n \"widths\": [1, 2, 4, 8, 16],\n \"maxWidths\": [1, 2, 4, 8, 16, 32, 48, 64, 96],\n \"heights\": [1, 2, 4, 8, 16],\n \"sizes\": [\n {\"name\": \"small\", \"value\": 2},\n {\"name\": \"regular\", \"value\": 2.5},\n {\"name\": \"large\", \"value\": 3}\n ],\n \"typography\":{\n \"measure\": [30, 34, 20],\n \"styles\": {\n \"heading-1\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"3rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-2\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"2.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-3\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"1.75rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-4\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.5rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-5\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-6\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"body\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"small\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"0.875rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"mini\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"0.75rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"action\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"action--small\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"0.875rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"action--large\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"code\": {\n \"fontFamily\": \"Consolas, monaco, monospace\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n }\n }\n },\n \"opacity\": [1, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.05, 0.025, 0]\n}\n\n```" } ]
code_iodas-bookstore-theme_9f194897
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks/home/benefits.json from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"slider-layout#benefits\": {\n \"children\": [\n \"flex-layout.row#deals1\",\n \"flex-layout.row#deals2\",\n \"flex-layout.row#deals3\",\n \"flex-layout.row#deals4\"\n ],\n \"props\": {\n \"blockClass\": \"deals\",\n \"infinite\": true,\n \"showNavigationArrows\": \"mobileOnly\",\n \"showPaginationDots\": \"never\",\n \"navigationStep\": 1,\n \"itemsPerPage\": {\n \"desktop\": 4,\n \"tablet\": 4,\n \"phone\": 1\n }\n }\n },\n \"flex-layout.row#deals1\": {\n \"children\": [\n \"image#deal1\",\n \"rich-text#deal1\"\n ]\n },\n \"image#deal1\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/iconfinder_rocket_2120156___e884f125797ff490dd981f81480b0fd0.png\",\n \"maxHeight\": \"48px\"\n }\n },\n \"rich-text#deal1\": {\n \"props\": {\n \"text\": \"ENTREGA FOGUETE*<br>*confira o regulamento*\",\n \"blockClass\": \"deals\"\n }\n },\n \"flex-layout.row#deals2\": {\n \"children\": [\n \"image#deal2\",\n \"rich-text#deal2\"\n ]\n },\n \"image#deal2\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/iconfinder_truck_115775___654edfa0a3266b14f9dc2179b5e178df.png\",\n \"maxHeight\": \"48px\"\n }\n },\n \"rich-text#deal2\": {\n \"props\": {\n \"text\": \"FRETE GRÁTIS*<br>*confira o regulamento*\",\n \"blockClass\": \"deals\"\n }\n },\n \"flex-layout.row#deals3\": {\n \"children\": [\n \"image#deal3\",\n \"rich-text#deal3\"\n ]\n },\n \"image#deal3\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/iconfinder_business_finance_money-38_2784269___4bfde021b43419e0297c96bc1b6506af.png\",\n \"maxHeight\": \"48px\"\n }\n },\n \"rich-text#deal3\": {\n \"props\": {\n \"text\": \"10X SEM JUROS*<br>*confira o regulamento*\",\n \"blockClass\": \"deals\"\n }\n },\n \"flex-layout.row#deals4\": {\n \"children\": [\n \"image#deal4\",\n \"rich-text#deal4\"\n ]\n },\n \"image#deal4\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/iconfinder_thefreeforty_shop_1243706___3afb6534ba6abe44624bef0c09b97f2a.png\",\n \"maxHeight\": \"48px\"\n }\n },\n \"rich-text#deal4\": {\n \"props\": {\n \"text\": \"RETIRADA EM LOJA*<br>*confira o regulamento*\",\n \"blockClass\": \"deals\"\n }\n }\n}\n\n```" } ]
code_iodas-bookstore-theme_747e967f
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks/home/special-cards.json from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"flex-layout.col#special-card-1\": {\n \"title\": \"Cards Especiais\",\n \"children\": [\n \"image#special-card-1\"\n ],\n \"props\": {\n \"horizontalAlign\": \"center\"\n }\n },\n \"flex-layout.col#special-card-2\": {\n \"title\": \"Cards Especiais\",\n \"children\": [\n \"image#special-card-2\"\n ],\n \"props\": {\n \"horizontalAlign\": \"center\"\n }\n },\n \"flex-layout.col#special-card-3\": {\n \"title\": \"Cards Especiais\",\n \"children\": [\n \"image#special-card-3\"\n ],\n \"props\": {\n \"horizontalAlign\": \"center\"\n }\n },\n \"flex-layout.col#special-card-4\": {\n \"title\": \"Cards Especiais\",\n \"children\": [\n \"image#special-card-4\"\n ],\n \"props\": {\n \"horizontalAlign\": \"center\"\n }\n },\n \"image#special-card-1\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/ebooks_home___336cc1c2de5044900bca441aad43774f.jpg\",\n \"blockClass\": \"home-special-card\",\n \"maxHeight\": \"400px\"\n }\n },\n \"image#special-card-2\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/games_home___e668b875196382345949f12e985ff2ee.png\",\n \"blockClass\": \"home-special-card\",\n \"maxHeight\": \"400px\"\n }\n },\n \"image#special-card-3\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/stamplers___e9dfd3b5af47e879320c2fecb46a7af9.png\",\n \"blockClass\": \"home-special-card\",\n \"maxHeight\": \"400px\"\n }\n },\n \"image#special-card-4\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/backtoschool_home___79a24a92eb54aa6c05d66c17e905f452.png\",\n \"blockClass\": \"home-special-card\",\n \"maxHeight\": \"400px\"\n }\n }\n}\n\n```" } ]
code_iodas-bookstore-theme_ead1922a
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks/home/brands-carousel.json from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"slider-layout#brands-carousel\": {\n \"title\": \"Carrossel de marcas\",\n \"children\": [\n \"image#brand-1\",\n \"image#brand-2\",\n \"image#brand-3\",\n \"image#brand-4\",\n \"image#brand-5\",\n \"image#brand-6\"\n ],\n \"props\": {\n \"blockClass\": \"brand-carousel\",\n \"infinite\": true,\n \"showNavigationArrows\": \"never\",\n \"showPaginationDots\": \"never\",\n \"navigationStep\": 1,\n \"itemsPerPage\": {\n \"desktop\": 6,\n \"tablet\": 4,\n \"phone\": 2\n }\n }\n },\n \"image#brand-1\": {\n \"props\": {\n \"src\": \"https://uploaddeimagens.com.br/images/002/472/220/original/marca_1.png?1572620027\",\n \"maxHeight\": \"96px\"\n }\n },\n \"image#brand-2\": {\n \"props\": {\n \"src\": \"https://uploaddeimagens.com.br/images/002/472/226/original/marca_2.png?1572620063\",\n \"maxHeight\": \"96px\"\n }\n },\n \"image#brand-3\": {\n \"props\": {\n \"src\": \"https://uploaddeimagens.com.br/images/002/472/230/original/marca_3.png?1572620105\",\n \"maxHeight\": \"96px\"\n }\n },\n \"image#brand-4\": {\n \"props\": {\n \"src\": \"https://uploaddeimagens.com.br/images/002/472/233/original/marca_4.png?1572620153\",\n \"maxHeight\": \"96px\"\n }\n },\n \"image#brand-5\": {\n \"props\": {\n \"src\": \"https://uploaddeimagens.com.br/images/002/472/235/original/marca_5.png?1572620181\",\n \"maxHeight\": \"96px\"\n }\n },\n \"image#brand-6\": {\n \"props\": {\n \"src\": \"https://uploaddeimagens.com.br/images/002/472/239/original/marca_6.png?1572620215\",\n \"maxHeight\": \"96px\"\n }\n }\n}\n\n```" } ]
code_iodas-bookstore-theme_a82fe71f
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks/home/home.jsonc from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.home\": {\n \"blocks\": [\n \"carousel#home\",\n \"slider-layout#benefits\",\n \"shelf#lancamentos\",\n \"flex-layout.row#special-cards\",\n \"flex-layout.row#brands-carousel\",\n \"image#special-campaign\",\n \"shelf#mais-vendidos\",\n \"newsletter\"\n ]\n },\n \"newsletter\": {\n \"props\": {\n \"label\": \"Receba nossas notícias :D\",\n \"placeholder\": \"Seu email\",\n \"submit\": \"ENVIAR\"\n }\n },\n\n \"flex-layout.row#special-cards\": {\n \"children\": [\n \"flex-layout.col#special-card-1\",\n \"flex-layout.col#special-card-2\",\n \"flex-layout.col#special-card-3\",\n \"flex-layout.col#special-card-4\"\n ],\n \"props\": {\n \"horizontalAlign\": \"center\",\n \"marginTop\": \"3\",\n \"marginBottom\": \"3\"\n }\n },\n\n \"flex-layout.row#brands-carousel\": {\n \"children\": [\n \"slider-layout#brands-carousel\"\n ],\n \"props\": {\n \"horizontalAlign\": \"center\",\n \"marginTop\": \"3\",\n \"marginBottom\": \"3\"\n }\n },\n\n \"carousel#home\": {\n \"props\": {\n \"autoplay\": false,\n \"banners\": [\n {\n \"image\": \"https://storecomponents.vteximg.com.br/arquivos/banner-principal.png\",\n \"mobileImage\": \"https://storecomponents.vteximg.com.br/arquivos/banner-principal-mobile.jpg\"\n },\n {\n \"image\": \"https://storecomponents.vteximg.com.br/arquivos/banner.jpg\",\n \"mobileImage\": \"https://storecomponents.vteximg.com.br/arquivos/banner-principal-mobile.jpg\"\n }\n ],\n \"height\": 720,\n \"showArrows\": true,\n \"showDots\": true\n }\n },\n\n \"shelf#lancamentos\": {\n \"blocks\": [\"product-summary.shelf\"],\n \"props\": {\n \"orderBy\": \"OrderByReleaseDateDESC\",\n \"paginationDotsVisibility\": \"hidden\",\n \"productList\": {\n \"maxItems\": 12,\n \"itemsPerPage\": 4,\n \"minItemsPerPage\": 1.5,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"titleText\": \"Lançamentos\"\n }\n }\n },\n \"shelf#mais-vendidos\": {\n \"blocks\": [\"product-summary.shelf\"],\n \"props\": {\n \"orderBy\": \"OrderByReleaseDateDESC\",\n \"paginationDotsVisibility\": \"hidden\",\n \"productList\": {\n \"maxItems\": 12,\n \"itemsPerPage\": 4,\n \"minItemsPerPage\": 1.5,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"titleText\": \"Mais vendidos\"\n }\n }\n },\n\n \"image#special-campaign\": {\n \"title\": \"Campanha em destaque\",\n \"props\": {\n \"src\": \"https://uploaddeimagens.com.br/images/002/473/060/original/bannerviagens.png?1572632764\",\n \"maxWidth\": \"100%\"\n }\n }\n\n}\n\n```" } ]
code_iodas-bookstore-theme_03bf6b2e
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks/footer/footer.json from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"footer\": {\n \"blocks\": [\"footer-layout.desktop\", \"footer-layout.mobile\"]\n },\n \"footer-layout.desktop\": {\n \"children\": [\n \"flex-layout.row#footer-0-desktop\",\n \"flex-layout.row#footer-1-desktop\",\n \"flex-layout.row#footer-2-desktop\",\n \"flex-layout.row#footer-3-desktop\"\n ]\n },\n \"flex-layout.row#footer-0-desktop\": {\n \"children\": [\n \"image#footer-brand\"\n ],\n \"props\": {\n \"paddingTop\": 6,\n \"paddingBottom\": 6\n }\n },\n \"image#footer-brand\": {\n \"props\": {\n \"src\": \"https://i.pinimg.com/originals/cf/41/f2/cf41f285d7f65240d92dd6fbf4c31ef9.png\",\n \"maxHeight\": \"200px\"\n }\n },\n \"flex-layout.row#footer-1-desktop\": {\n \"children\": [\n \"menu#footer-duvidas\",\n \"menu#footer-atendimento\",\n \"menu#footer-institucional\",\n \"menu#footer-links\"\n ],\n \"props\": {\n \"blockClass\": \"menu-footer-row\",\n \"paddingTop\": 6,\n \"paddingBottom\": 3\n }\n },\n\n \"social-networks\": {\n \"props\": {\n \"socialNetworks\": [\n {\n \"name\": \"Facebook\",\n \"url\": \"https://www.facebook.com/vtexonline/\"\n },\n {\n \"name\": \"Instagram\",\n \"url\": \"https://www.instagram.com/vtextruecloud/\"\n },\n {\n \"name\": \"Twitter\",\n \"url\": \"https://twitter.com/vtexonline\"\n },\n {\n \"name\": \"Youtube\",\n \"url\": \"https://www.youtube.com/user/VTEXTV\"\n }\n ]\n }\n },\n\n \"flex-layout.row#footer-2-desktop\": {\n \"children\": [\"accepted-payment-methods\"],\n \"props\": {\n \"blockClass\": \"payment-methods\"\n }\n },\n \"accepted-payment-methods\": {\n \"props\": {\n \"paymentMethods\": [\"MasterCard\", \"Visa\", \"Diners Club\"]\n }\n },\n\n \"flex-layout.row#footer-3-desktop\": {\n \"children\": [\"rich-text#footer\"],\n \"props\": {\n \"blockClass\": \"credits\"\n }\n },\n \"rich-text#footer\": {\n \"props\": {\n \"text\": \"All stock and product photos are from photos.icons8.com\",\n \"blockClass\": \"footer\"\n }\n },\n\n \"footer-layout.mobile\": {\n \"children\": [\n \"flex-layout.row#1-footer-mobile\",\n \"flex-layout.row#2-footer-mobile\"\n ]\n },\n \"flex-layout.row#2-footer-mobile\": {\n \"children\": [\"flex-layout.col#footer-1-mobile\"],\n \"props\": {\n \"blockClass\": \"payment-methods\",\n \"paddingTop\": 4,\n \"paddingBottom\": 4\n }\n },\n \"flex-layout.col#footer-1-mobile\": {\n \"children\": [\n \"accepted-payment-methods\",\n \"social-networks\",\n \"rich-text#footer-mobile\"\n ],\n \"props\": {\n \"blockClass\": \"payment-methods\",\n \"paddingTop\": 4,\n \"paddingBottom\": 4,\n \"rowGap\": 4\n }\n },\n \"flex-layout.row#1-footer-mobile\": {\n \"props\": {\n \"paddingTop\": 4,\n \"paddingBottom\": 4\n },\n \"children\": [\"vtex.menu@2.x:menu#footer-mobile\"]\n },\n \"rich-text#footer-mobile\": {\n \"props\": {\n \"text\": \"All stock and product photos are from photos.icons8.com\",\n \"blockClass\": \"footer\"\n }\n }\n}\n\n```" } ]
code_iodas-bookstore-theme_63a99722
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks/footer/menu.json from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"vtex.menu@2.x:menu#Products\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#news\",\n \"menu-item#blackfriday\",\n \"menu-item#sale\",\n \"menu-item#personalization\"\n ]\n },\n \"menu-item#news\": {\n \"props\": {\n \"id\": \"menu-item-news\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"News\",\n \"text\": \"News\"\n }\n }\n },\n \"menu-item#blackfriday\": {\n \"props\": {\n \"id\": \"menu-item-black-friday\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"BlackFriday\",\n \"text\": \"Black Friday\"\n }\n }\n },\n \"menu-item#sale\": {\n \"props\": {\n \"id\": \"menu-item-sale\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Sale\",\n \"text\": \"Sale\"\n }\n }\n },\n \"menu-item#personalization\": {\n \"props\": {\n \"id\": \"menu-item-personalization\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Personalization\",\n \"text\": \"Personalization\"\n }\n }\n },\n\n \"vtex.menu@2.x:menu#footer-decoration\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#smartphones\",\n \"menu-item#videogames\",\n \"menu-item#tvs\"\n ]\n },\n\n \"menu-item#smartphones\": {\n \"props\": {\n \"id\": \"menu-item-smartphones\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/decoration/smartphones\",\n \"noFollow\": true,\n \"tagTitle\": \"Smartphones\",\n \"text\": \"Smartphones\"\n }\n }\n },\n\n \"menu-item#videogames\": {\n \"props\": {\n \"id\": \"menu-item-videogames\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/decoration/videogames\",\n \"noFollow\": true,\n \"tagTitle\": \"Videogames\",\n \"text\": \"Videogames\"\n }\n }\n },\n\n \"menu-item#tvs\": {\n \"props\": {\n \"id\": \"menu-item-tvs\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/decoration/tvs\",\n \"noFollow\": true,\n \"tagTitle\": \"TVs\",\n \"text\": \"TVs\"\n }\n }\n },\n\n \"vtex.menu@2.x:menu#footer-bags\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#bags\",\n \"menu-item#backpacks\",\n \"menu-item#necessaire\"\n ]\n },\n\n \"menu-item#bags\": {\n \"props\": {\n \"id\": \"menu-item-bags\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/bags/d\",\n \"noFollow\": true,\n \"tagTitle\": \"Bags\",\n \"text\": \"Bags\"\n }\n }\n },\n\n \"menu-item#backpacks\": {\n \"props\": {\n \"id\": \"menu-item-backpacks\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/bags/backpacks\",\n \"noFollow\": true,\n \"tagTitle\": \"Backpacks\",\n \"text\": \"Backpacks\"\n }\n }\n },\n\n \"menu-item#necessaire\": {\n \"props\": {\n \"id\": \"menu-item-necessaire\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/bags/necessaire\",\n \"noFollow\": true,\n \"tagTitle\": \"Necessaire\",\n \"text\": \"Necessaire\"\n }\n }\n },\n\n \"vtex.menu@2.x:menu#footer-clothing\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#clothing\",\n \"menu-item#shorts\",\n \"menu-item#tank-tops\",\n \"menu-item#shirts\",\n \"menu-item#sweatshirt\",\n \"menu-item#cropped\"\n ]\n },\n\n \"vtex.menu@2.x:menu#footer-mobile\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#clothing-mobile\",\n \"menu-item#decoration-mobile\",\n \"menu-item#sale-mobile\"\n ]\n },\n\n \"menu-item#clothing-mobile\": {\n \"props\": {\n \"id\": \"menu-item-category-clothing\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/d\",\n \"noFollow\": true,\n \"tagTitle\": \"Clothing\",\n \"text\": \"Clothing\"\n }\n },\n \"blocks\": [\"vtex.menu@2.x:submenu.accordion#clothing\"]\n },\n \"vtex.menu@2.x:submenu.accordion#clothing\": {\n \"children\": [\"vtex.menu@2.x:menu#clothing-accordion\"]\n },\n\n \"vtex.menu@2.x:menu#clothing-accordion\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#shorts\",\n \"menu-item#tank-tops\",\n \"menu-item#shirts\",\n \"menu-item#sweatshirt\",\n \"menu-item#cropped\"\n ]\n },\n\n \"menu-item#decoration-mobile\": {\n \"props\": {\n \"itemProps\": {\n \"tagTitle\": \"Decoration\",\n \"text\": \"Decoration\"\n }\n },\n \"blocks\": [\"vtex.menu@2.x:submenu.accordion#decoration\"]\n },\n \"vtex.menu@2.x:submenu.accordion#decoration\": {\n \"children\": [\"vtex.menu@2.x:menu#footer-decoration-mobile\"]\n },\n\n \"vtex.menu@2.x:menu#footer-decoration-mobile\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#smartphones\",\n \"menu-item#videogames\",\n \"menu-item#tvs\"\n ]\n },\n\n \"menu-item#sale-mobile\": {\n \"props\": {\n \"itemProps\": {\n \"tagTitle\": \"Sale\",\n \"text\": \"Sale\"\n }\n },\n \"blocks\": [\"vtex.menu@2.x:submenu.accordion#sale\"]\n },\n \"vtex.menu@2.x:submenu.accordion#sale\": {\n \"children\": [\"vtex.menu@2.x:menu#footer-sale-mobile\"]\n },\n\n \"vtex.menu@2.x:menu#footer-sale-mobile\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#smartphones\",\n \"menu-item#videogames\",\n \"menu-item#tvs\"\n ]\n },\n\n \"menu-item#clothing\": {\n \"props\": {\n \"id\": \"menu-item-category-clothing\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/d\",\n \"noFollow\": true,\n \"tagTitle\": \"Clothing\",\n \"text\": \"Clothing\"\n }\n }\n },\n\n \"menu-item#shorts\": {\n \"props\": {\n \"id\": \"menu-item-shorts\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/shorts\",\n \"noFollow\": false,\n \"tagTitle\": \"Shorts\",\n \"text\": \"Shorts\"\n }\n }\n },\n\n \"menu-item#tank-tops\": {\n \"props\": {\n \"id\": \"menu-item-tank-tops\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/tank-tops\",\n \"noFollow\": false,\n \"tagTitle\": \"Tank tops\",\n \"text\": \"Tank tops\"\n }\n }\n },\n\n \"menu-item#shirts\": {\n \"props\": {\n \"id\": \"menu-item-shirts\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/shirts\",\n \"noFollow\": false,\n \"tagTitle\": \"Shirts\",\n \"text\": \"Shirts\"\n }\n }\n },\n\n \"menu-item#sweatshirt\": {\n \"props\": {\n \"id\": \"menu-item-sweat-shirts\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/sweatshirt\",\n \"noFollow\": false,\n \"tagTitle\": \"Sweatshirt\",\n \"text\": \"Sweatshirt\"\n }\n }\n },\n\n \"menu-item#cropped\": {\n \"props\": {\n \"id\": \"menu-item-cropped\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/cropped\",\n \"noFollow\": false,\n \"tagTitle\": \"Cropped\",\n \"text\": \"Cropped\"\n }\n }\n },\n\n \"menu#footer-duvidas\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#footer-faq\",\n \"menu-item#formas-pagamento\",\n \"menu-item#formas-entrega\",\n \"menu-item#devolucao\"\n ]\n },\n \"menu-item#footer-faq\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Perguntas Frequentes\",\n \"text\": \"Perguntas Frequentes\"\n }\n }\n },\n \"menu-item#formas-pagamento\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Formas de Pagamento\",\n \"text\": \"Formas de Pagamento\"\n }\n }\n },\n \"menu-item#formas-entrega\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Formas de Entrega\",\n \"text\": \"Formas de Entrega\"\n }\n }\n },\n \"menu-item#devolucao\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Trocas e Devolução\",\n \"text\": \"Trocas e Devolução\"\n }\n }\n },\n \"menu#footer-atendimento\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#fale-conosco\",\n \"menu-item#meus-pedidos\",\n \"menu-item#lojas\"\n ]\n },\n \"menu-item#fale-conosco\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Fale Conosco\",\n \"text\": \"Fale Conosco\"\n }\n }\n },\n \"menu-item#meus-pedidos\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Meus pedidos\",\n \"text\": \"Meus pedidos\"\n }\n }\n },\n \"menu-item#lojas\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Encontre nossas lojas\",\n \"text\": \"Encontre nossas lojas\"\n }\n }\n },\n \"menu#footer-institucional\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#historia\",\n \"menu-item#trabalhe-conosco\",\n \"menu-item#sustentabilidade\",\n \"menu-item#nosso-blog\"\n ]\n },\n \"menu-item#historia\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Nossa história\",\n \"text\": \"Nossa história\"\n }\n }\n },\n \"menu-item#trabalhe-conosco\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Trabalhe Conosco\",\n \"text\": \"Trabalhe Conosco\"\n }\n }\n },\n \"menu-item#sustentabilidade\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Sustentabilidade\",\n \"text\": \"Sustentabilidade\"\n }\n }\n },\n \"menu-item#nosso-blog\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Visite o nosso blog\",\n \"text\": \"Visite o nosso blog\"\n }\n }\n },\n \"menu#footer-links\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#privacidade\",\n \"menu-item#codigo-defesa-consumidor\",\n \"menu-item#termos\",\n \"menu-item#procon\"\n ]\n },\n \"menu-item#privacidade\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Política de Privacidade\",\n \"text\": \"Política de Privacidade\"\n }\n }\n },\n \"menu-item#codigo-defesa-consumidor\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Código de Defesa do Consumidor\",\n \"text\": \"Código de Defesa do Consumidor\"\n }\n }\n },\n \"menu-item#termos\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Termos de Uso\",\n \"text\": \"Termos de Uso\"\n }\n }\n },\n \"menu-item#procon\": {\n \"props\": {\n \"itemProps\": {\n \"type\": \"internal\",\n \"tagTitle\": \"Procon\",\n \"text\": \"Procon\"\n }\n }\n }\n}\n\n```" } ]
code_iodas-bookstore-theme_bd0c6449
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks/custom-page/black-friday.json from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.custom#black-friday\": {\n \"blocks\": [\n \"flex-layout.row#bf-banner\",\n \"flex-layout.row#bf-shelf\",\n \"flex-layout.row#bf-search\"\n ]\n },\n\n \"flex-layout.row#bf-banner\": {\n \"children\": [\n \"flex-layout.col#image-bf\", \n \"flex-layout.col#text-bf\"\n ],\n \"props\": {\n \"blockClass\": \"bf-lp-banner\",\n \"paddingTop\": 7,\n \"paddingBottom\": 7\n }\n },\n\n \"flex-layout.col#text-bf\": {\n \"children\": [\n \"rich-text#bf-title\",\n \"rich-text#bf-text\"\n ],\n \"props\": {\n \"blockclass\": \"textColumn\",\n \"horizontalAlign\": \"center\"\n }\n },\n\n \"rich-text#bf-title\": {\n \"props\": {\n \"text\": \"# A BLACK VEM AÍ\",\n \"blockClass\": \"bf-lp-text\"\n }\n },\n\n \"rich-text#bf-text\": {\n \"props\": {\n \"text\": \"**O que é?** \\n Black Friday é o dia que inaugura a temporada de compras natalícias com significativas promoções em muitas lojas retalhistas e grandes armazéns.\",\n \"blockClass\": \"bf-lp-text\"\n }\n },\n \n \"flex-layout.col#image-bf\": {\n \"props\": {\n \"verticalAlign\": \"middle\",\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"image#bf-counter\" \n ]\n },\n\n \"image#bf-counter\": {\n \"props\": {\n \"src\": \"https://gen.sendtric.com/countdown/wch3xdgn75\"\n }\n },\n\n \"flex-layout.row#bf-shelf\": {\n \"children\": [\n \"flex-layout.col#bf-shelf\"\n ]\n },\n\n \"flex-layout.col#bf-shelf\": {\n \"children\": [\n \"rich-text#bf-shelf\"\n ],\n \"props\": {\n \"horizontalAlign\": \"center\"\n }\n },\n\n \"rich-text#bf-shelf\": {\n \"props\": {\n \"text\": \"### Confira algumas promoções que antecipamos pra você\",\n \"horizontalAlign\": \"center\"\n }\n },\n\n \"flex-layout.row#bf-search\": {\n \"children\": [\n \"search-result\"\n ],\n \"props\": {\n \"blockClass\": \"bf-lp-search\"\n }\n }\n}\n```" } ]
code_iodas-bookstore-theme_7b778b19
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks/category/search.json from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.search#category\": {\n \"blocks\": [\"carousel#store-search\", \"search-result-layout\"]\n },\n \"store.search#subcategory\": {\n \"blocks\": [\"carousel#store-search\", \"search-result-layout\"]\n }\n}\n\n```" } ]
code_iodas-bookstore-theme_0dc187b5
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks/department/search.json from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.search#department\": {\n \"blocks\": [\"carousel#store-search\", \"search-result-layout\"]\n }\n}\n\n```" } ]
code_iodas-bookstore-theme_506b0995
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks/product/product-assembly.jsonc from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"sticky-layout#buy-button\": {\n \"props\": {\n \"position\": \"bottom\"\n },\n \"children\": [\"flex-layout.row#buy-button\"]\n },\n \"product-assembly-options\": {\n \"children\": [\n \"flex-layout.row#product-assembly-options\",\n \"assembly-option-input-values\"\n ]\n },\n \"assembly-option-input-values\": {\n \"props\": {\n \"optionsDisplay\": \"box\"\n }\n },\n \"flex-layout.row#product-assembly-options\": {\n \"props\": {\n \"colGap\": 2,\n \"preserveLayoutOnMobile\": true,\n \"colSizing\": \"auto\"\n },\n \"children\": [\n \"flex-layout.col#product-assembly-image\",\n \"flex-layout.col#product-assembly-middle\",\n \"flex-layout.col#product-assembly-quantity\"\n ]\n },\n \"flex-layout.col#product-assembly-quantity\": {\n \"props\": {\n \"verticalAlign\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-quantity-selector\"\n ]\n },\n \"flex-layout.col#product-assembly-image\": {\n \"props\": {\n \"marginRight\": 4\n },\n \"children\": [\n \"assembly-option-item-image\"\n ]\n },\n \"flex-layout.col#product-assembly-middle\": {\n \"props\": {\n \"width\": \"grow\",\n \"verticalAlignment\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-name\",\n \"assembly-option-item-price\",\n \"assembly-option-item-children-description\",\n \"assembly-option-item-customize#first-level\"\n ]\n },\n \"assembly-option-item-customize#first-level\": {\n \"props\": {\n \"buttonProps\": {\n \"collapse\": \"left\"\n }\n },\n \"children\": [\n \"flex-layout.row#item-customize\"\n ]\n },\n \"flex-layout.row#item-customize\": {\n \"props\": {\n \"colGap\": 2,\n \"preserveLayoutOnMobile\": true,\n \"colSizing\": \"auto\"\n },\n \"children\": [\n \"flex-layout.col#product-assembly-image\",\n \"flex-layout.col#item-customize-middle\",\n \"flex-layout.col#item-customize-quantity\"\n ]\n },\n \"flex-layout.col#item-customize-middle\": {\n \"props\": {\n \"width\": \"grow\",\n \"verticalAlignment\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-name\",\n \"assembly-option-item-price\",\n \"assembly-option-item-children-description\",\n \"assembly-option-item-customize#sec-level\"\n ]\n },\n \"flex-layout.col#item-customize-quantity\": {\n \"props\": {\n \"horizontalAlign\": \"right\",\n \"verticalAlign\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-quantity-selector\"\n ]\n },\n \"assembly-option-item-customize#sec-level\": {\n \"props\": {\n \"buttonProps\": {\n \"collapse\": \"left\"\n }\n },\n \"children\": [\n \"assembly-option-item-image\",\n \"assembly-option-item-name\",\n \"assembly-option-item-price\",\n \"assembly-option-item-quantity-selector\"\n ]\n }\n}\n```" } ]
code_iodas-bookstore-theme_d1be80c3
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks/product/product-description.jsonc from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"flex-layout.row#product-description\": {\n \"children\": [\n \n ]\n }\n}\n```" } ]
code_iodas-bookstore-theme_0f4c82e1
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks/product/product.json from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.product\": {\n \"children\": [\n \"stack-layout#product-outdoor\",\n \"flex-layout.row#product-main\",\n \"flex-layout.row#product-outdoor-shelf\"\n ]\n },\n\n \"flex-layout.row#product-outdoor-shelf\": {\n \"children\": [\n \"shelf#product-outdoor\"\n ],\n \"props\": {\n \"fullWidth\": true,\n \"marginBottom\": 0\n }\n },\n\n \"shelf#product-outdoor\": {\n \"blocks\": [\n \"product-summary.shelf\"\n ],\n \"props\": {\n \"titleText\": \"QUEM VIU, VIU TAMBÉM\",\n \"maxItems\": \"4\",\n \"paginationDotsVisibility\": \"hidden\", \n \"collection\": \"137\",\n \"showTitle\": true \n }\n },\n\n \"stack-layout#product-outdoor\": {\n \"children\": [\n \"flex-layout.row#product-logo\",\n \"flex-layout.row#product-first-layer\",\n \"flex-layout.row#product-second-layer\"\n ],\n \"props\": {\n \"fullWidth\": true,\n \"blockClass\": \"product-outdoor\"\n }\n },\n\n \"flex-layout.row#product-logo\": {\n \"children\": [\n \"flex-layout.col#product-logo\"\n ],\n \"props\": {\n \"fullWidth\": true,\n \"blockClass\": \"product-outdoor-relative\"\n }\n },\n\n \"flex-layout.col#product-logo\": {\n \"children\": [\n \"image#product-logo\"\n ],\n \"props\": {\n \"horizontalAlign\": \"center\",\n \"verticalAlign\": \"top\"\n }\n },\n\n \"image#product-logo\": {\n \"props\": {\n \"src\": \"https://uploaddeimagens.com.br/images/002/472/113/original/LOGO_BVRANCO_GRANDE_STAGE.png?1572618601\",\n \"blockClass\": \"product-logo\",\n \"maxWidth\": \"100%\"\n }\n },\n\n \"flex-layout.row#product-first-layer\": {\n \"children\": [\n \"flex-layout.col#product-first-layer\"\n ],\n \"props\": {\n \"fullWidth\": true\n }\n },\n\n \"flex-layout.col#product-first-layer\": {\n \"children\": [\n \"image#product-first-layer\"\n ],\n \"props\": {\n \"horizontalAlign\": \"center\",\n \"verticalAlign\": \"bottom\",\n \"width\": \"100%\"\n }\n },\n\n \"image#product-first-layer\": {\n \"props\": {\n \"src\": \"https://uploaddeimagens.com.br/images/002/471/981/original/montanhas002.png?1572616488\",\n \"blockClass\": \"product-first-layer\",\n \"maxWidth\": \"100%\"\n }\n },\n\n \"flex-layout.row#product-second-layer\": {\n \"children\": [\n \"flex-layout.col#product-second-layer\"\n ],\n \"props\": {\n \"fullWidth\": true\n }\n },\n\n \"flex-layout.col#product-second-layer\": {\n \"children\": [\n \"image#product-second-layer\"\n ],\n \"props\": {\n \"horizontalAlign\": \"center\",\n \"verticalAlign\": \"bottom\",\n \"width\": \"100%\"\n }\n },\n\n \"image#product-second-layer\": {\n \"props\": {\n \"src\": \"https://uploaddeimagens.com.br/images/002/471/980/original/cavaleiro002.png?1572616466\",\n \"blockClass\": \"product-first-layer\",\n \"maxWidth\": \"100%\"\n }\n },\n\n\n \"flex-layout.row#product-main\": {\n \"props\": {\n \"colGap\": 7,\n \"rowGap\": 7,\n \"blockClass\": \"product-main\",\n \"marginBottom\": 7,\n \"paddingTop\": 7,\n \"paddingBottom\": 9\n },\n \"children\": [\"flex-layout.col#stack\", \"flex-layout.col#right-col\"]\n },\n\n \"stack-layout\": {\n \"children\": [\n \"flex-layout.row#product-image\",\n \"product-specification-badges\"\n ]\n },\n\n \"product-specification-badges\": {\n \"props\": {\n \"specificationGroupName\": \"Group\",\n \"specificationName\": \"On Sale\",\n \"visibleWhen\": \"True\",\n \"displayValue\": \"SPECIFICATION_NAME\"\n }\n },\n\n \"flex-layout.col#stack\": {\n \"children\": [\"stack-layout\"],\n \"props\": {\n \"width\": \"60%\",\n \"rowGap\": 0\n }\n },\n \"flex-layout.row#product-image\": {\n \"children\": [\"product-images\"]\n },\n \"product-images\": {\n \"props\": {\n \"displayThumbnailsArrows\": true\n }\n },\n \"flex-layout.col#right-col\": {\n \"props\": {\n \"preventVerticalStretch\": true,\n \"rowGap\": 0\n },\n \"children\": [\n \"product-name\",\n \"product-description\",\n \"product-rating-summary\",\n \"product-identifier.product\",\n \"sku-selector\",\n \"product-assembly-options\",\n \"product-price#product-details\",\n \"flex-layout.row#buy-button\",\n \"availability-subscriber\",\n \"product-separator\",\n \"share#default\"\n ]\n },\n\n \"product-price#product-details\": {\n \"props\": {\n \"showInstallments\": true,\n \"showSavings\": true\n }\n },\n\n \"flex-layout.row#buy-button\": {\n \"props\": {\n \"marginTop\": 4,\n \"marginBottom\": 7\n },\n \"children\": [\"buy-button\"]\n },\n\n \"share#default\": {\n \"props\": {\n \"social\": {\n \"Facebook\": true,\n \"WhatsApp\": true,\n \"Twitter\": false,\n \"Pinterest\": true\n }\n }\n }\n}\n\n```" } ]
code_iodas-bookstore-theme_81c5ec7c
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks/header/header.json from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"header\": {\n \"blocks\": [\n \"header-layout.desktop\",\n \"header-layout.mobile\"\n ]\n },\n \"header.full\": {\n \"blocks\": [\n \"header-layout.desktop\",\n \"header-layout.mobile\"\n ]\n },\n \"header-layout.desktop\": {\n \"children\": [\n \"header-row#1-desktop\",\n \"header-row#2-desktop\",\n \"header-row#3-desktop\"\n ]\n },\n\n \"header-row#1-desktop\": {\n \"children\": [\n \"telemarketing\"\n ],\n \"props\": {\n \"fullWidth\": true\n }\n },\n\n \"header-row#2-desktop\": {\n \"children\": [\n \"notification.bar#home\"\n ],\n \"props\": {\n \"fullWidth\": \"true\"\n }\n },\n \"notification.bar#home\": {\n \"props\": {\n \"content\": \"<strong>FRETE GRÁTIS</strong> para compras a partir de R$ 99,90\"\n }\n },\n \"header-row#3-desktop\": {\n \"children\": [\n \"logo#desktop\",\n \"menu#header-main2\",\n \"header-spacer\",\n \"search-bar\",\n \"login\",\n \"minicart\"\n ],\n \"props\": {\n \"blockClass\": \"main-header\",\n \"inverted\": \"true\",\n \"sticky\": true\n }\n },\n \"logo#desktop\": {\n \"props\": {\n \"title\": \"Logo\",\n \"href\": \"/\",\n \"url\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/LOGO_THEBOOKSTORE___fc0ce51f3ffa0ffc16f9d4e5402096e5.png\",\n \"width\": \"180\"\n }\n },\n\n \"minicart\": {\n \"blocks\": [\n \"product-summary\"\n ],\n \"props\": {\n \"type\": \"popup\",\n \"showRemoveButton\": true,\n \"showDiscount\": true,\n \"showSku\": true,\n \"labelMiniCartEmpty\": \"\",\n \"labelButtonFinishShopping\": \"Go to checkout\",\n \"enableQuantitySelector\": true,\n \"maxQuantity\": 10,\n \"labelClasses\": \"gray\"\n }\n },\n\n \"login\": {\n \"props\": {\n \"emailAndPasswordTitle\": \"LOG-IN\",\n \"accessCodeTitle\": \"Acess Code LOG-IN\",\n \"emailPraceholder\": \"e-mail\",\n \"passwordPlaceholder\": \"password\",\n \"showPasswordVerificationIntoTooltip\": true\n }\n },\n\n \"header-layout.mobile\": {\n \"children\": [\n \"header-row#1-mobile\",\n \"header-row#2-mobile\"\n ]\n },\n \"header-row#1-mobile\": {\n \"children\": [\n \"drawer\",\n \"logo#mobile\",\n \"header-spacer\",\n \"login\",\n \"minicart\"\n ],\n \"props\": {\n \"sticky\": true,\n \"blockClass\": \"main-header-mobile\"\n }\n },\n \"drawer\": {\n \"children\": [\n \"menu#drawer\"\n ]\n },\n\n \"menu#drawer\": {\n \"children\": [\n \"menu-item#livros-mobile\",\n \"menu-item#papelaria-mobile\",\n \"menu-item#ebooks-mobile\",\n \"menu-item#eletronicos-mobile\",\n \"menu-item#blog\",\n \"menu-item#black-friday\"\n ],\n \"props\": {\n \"orientation\": \"vertical\"\n }\n },\n\n \"logo#mobile\": {\n \"props\": {\n \"title\": \"Logo\",\n \"href\": \"/\",\n \"url\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/LOGO_THEBOOKSTORE___fc0ce51f3ffa0ffc16f9d4e5402096e5.png\",\n \"width\": \"180\"\n }\n },\n \"header-row#2-mobile\": {\n \"children\": [\n \"search-bar\"\n ]\n }\n}\n\n```" } ]
code_iodas-bookstore-theme_0ca72926
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iodas-bookstore-theme/store/blocks/header/category-menu.json from the iodas-bookstore-theme VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"menu-item#livros-mobile\": {\n \"blocks\": [\n \"submenu.accordion#livros\"\n ],\n \"props\": {\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/books/d\",\n \"tagTitle\": \"Livros\",\n \"text\": \"Livros\"\n }\n }\n },\n \"menu-item#papelaria-mobile\": {\n \"blocks\": [\n \"submenu.accordion#papelaria\"\n ],\n \"props\": {\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/office-supplies/d\",\n \"tagTitle\": \"Papelaria\",\n \"text\": \"Papelaria\"\n }\n }\n },\n \"menu-item#ebooks-mobile\": {\n \"blocks\": [\n \"submenu.accordion#ebooks\"\n ],\n \"props\": {\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/ebooks/d\",\n \"tagTitle\": \"Ebooks\",\n \"text\": \"Ebooks\"\n }\n }\n },\n \"menu-item#eletronicos-mobile\": {\n \"blocks\": [\n \"submenu.accordion#eletronicos\"\n ],\n \"props\": {\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/notebooks---pens/d\",\n \"tagTitle\": \"Eletrônicos\",\n \"text\": \"Eletrônicos\"\n }\n }\n },\n \"submenu.accordion#livros\": {\n \"children\": [\n \"menu#sub-livros-mobile\"\n ]\n },\n \"menu#sub-livros-mobile\": {\n \"children\": [\n \"menu-item#comics\",\n \"menu-item#travel\",\n \"menu-item#fiction\"\n ],\n \"props\": {\n \"orientation\": \"vertical\"\n }\n },\n \"menu-item#comics\": {\n \"props\": {\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/livros/comics\",\n \"tagTitle\": \"Quadrinhos\",\n \"text\": \"Quadrinhos\"\n }\n }\n },\n \"menu-item#travel\": {\n \"props\": {\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/livros/travel\",\n \"tagTitle\": \"Viagem\",\n \"text\": \"Viagem\"\n }\n }\n },\n \"menu-item#fiction\": {\n \"props\": {\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/livros/fiction\",\n \"tagTitle\": \"Ficção\",\n \"text\": \"Ficção\"\n }\n }\n },\n \"submenu.accordion#papelaria\": {\n \"children\": [\n \"menu#sub-papelaria-mobile\"\n ]\n },\n \"menu#sub-papelaria-mobile\": {\n \"children\": [\n \"menu-item#staplers\",\n \"menu-item#papers\",\n \"menu-item#clips\"\n ],\n \"props\": {\n \"orientation\": \"vertical\"\n }\n },\n \"menu-item#staplers\": {\n \"props\": {\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/office-supplies/fiction\",\n \"tagTitle\": \"Materias de Escritório\",\n \"text\": \"Materias de Escritório\"\n }\n }\n },\n \"menu-item#papers\": {\n \"props\": {\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/office-supplies/papers\",\n \"tagTitle\": \"Papéis\",\n \"text\": \"Papéis\"\n }\n }\n },\n \"menu-item#clips\": {\n \"props\": {\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/office-supplies/clips---fasteners\",\n \"tagTitle\": \"Materias de Escola\",\n \"text\": \"Materias de Escola\"\n }\n }\n },\n \"submenu.accordion#ebooks\": {\n \"children\": [\n \"menu#sub-ebooks-mobile\"\n ]\n },\n \"menu#sub-ebooks-mobile\": {\n \"children\": [\n \"menu-item#see-more\"\n ],\n \"props\": {\n \"orientation\": \"vertical\"\n }\n },\n \"menu-item#see-more\": {\n \"props\": {\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"tagTitle\": \"Ver todos\",\n \"text\": \"Ver todos\"\n }\n }\n },\n \"submenu.accordion#eletronicos\": {\n \"children\": [\n \"menu#sub-eletronicos-mobile\"\n ]\n },\n \"menu#sub-eletronicos-mobile\": {\n \"children\": [\n \"menu-item#notebooks\",\n \"menu-item#pencil\",\n \"menu-item#pens\"\n ],\n \"props\": {\n \"orientation\": \"vertical\"\n }\n },\n \"menu-item#notebooks\": {\n \"props\": {\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/notebooks--pens/notebooks\",\n \"tagTitle\": \"Notebooks\",\n \"text\": \"Notebooks\"\n }\n }\n },\n \"menu-item#pencil\": {\n \"props\": {\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/notebooks--pens/pencil-cases\",\n \"tagTitle\": \"Estojos\",\n \"text\": \"Estojos\"\n }\n }\n },\n \"menu-item#pens\": {\n \"props\": {\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/notebooks--pens/pens\",\n \"tagTitle\": \"Canetas\",\n \"text\": \"Canetas\"\n }\n }\n }\n}\n\n```" } ]