id
stringlengths
12
68
messages
listlengths
3
7
code_butik_726a4367
[ { "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": "system" }, { "content": "Show me the implementation of butik/react/SKUSelector.js from butik.", "role": "user" }, { "content": "Here's the source code:\n\n```javascript\nimport SKUSelector from './components/SKUSelector'\n\nexport default SKUSelector\n\n```", "role": "assistant" } ]
doc_bccb31f2
[ { "content": "You are a VTEX documentation expert. You provide accurate, detailed information about VTEX platform, APIs, apps, and Store Framework development.", "role": "system" }, { "content": "How do I use store components 3.178.5 ProductDescription?", "role": "user" }, { "content": "Documentation\n\n[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)\n\n[GuidesLearn how to use our APIs and extend the VTEX platform.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides)\n\n[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/api-reference)\n\n[App DevelopmentLearn how to build cloud-based apps and integrations.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/app-development)\n\n[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/storefront-development)\n\n[VTEX IO AppsFind pre-built solutions to grow your business.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/vtex-io-apps)\n\n[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/troubleshooting)\n\n[Release NotesStay up to date with our latest releases and bug fixes.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/updates/release-notes)\n\nVTEX IO Apps\n\n[Basic components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/basic-components)\n\n---\n\n[Store Components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/store-components)\n\n---\n\n[Advanced components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/advanced-components)\n\n---\n\n[B2B components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/b2b-components)\n\n---\n\n[B2B Suite](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/apps/vtex.b2b-suite)\n\n---\n\n[Functional Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/functional-apps)\n\n---\n\n[Layout Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/layout-apps)\n\n---\n\n[Pixel Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/pixel-apps)\n\n---\n\n[My Account - StoreV2 version](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/apps/vtex.my-account)\n\n---\n\n[VTEX IO deprecated apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/vtex-io-deprecated-apps)\n\n---\n\n[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides)\n\n[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/api-reference)\n\n[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/app-development)\n\n[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/storefront-development)\n\n[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/vtex-io-apps)\n\n[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/troubleshooting)\n\n---\n\n[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/updates/release-notes)\n\nVTEX IO Apps\n\n[Basic components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/basic-components)\n\n---\n\n[Store Components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/store-components)\n\n---\n\n[Advanced components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/advanced-components)\n\n---\n\n[B2B components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/b2b-components)\n\n---\n\n[B2B Suite](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/apps/vtex.b2b-suite)\n\n---\n\n[Functional Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/functional-apps)\n\n---\n\n[Layout Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/layout-apps)\n\n---\n\n[Pixel Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/pixel-apps)\n\n---\n\n[My Account - StoreV2 version](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/apps/vtex.my-account)\n\n---\n\n[VTEX IO deprecated apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/guides/vtex-io-deprecated-apps)\n\n---\n\n[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/vtex-io-apps)\n\nProduct Description\n\n[vtex.store-components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtex.store-components)\n\nVersion: 3.178.5\n\nLatest version: 3.178.5\n\nThe `product-description` block displays the description of a product. This Component can be imported and used by any VTEX App.\n\n![{\"base64\":\" \",\"img\":{\"width\":1839,\"height\":691,\"type\":\"png\",\"mime\":\"image/png\",\"wUnits\":\"px\",\"hUnits\":\"px\",\"length\":122179,\"url\":\"https://user-images.githubusercontent.com/67270558/147771999-64d529ab-ef49-4cb3-a592-8f54bcbbeac2.png\"}}](https://read.calvincode.net/reader?url=https://user-images.githubusercontent.com/67270558/147771999-64d529ab-ef49-4cb3-a592-8f54bcbbeac2.png)\n\n## Configuration\n\n1. Import the `vtex.store-components` app to your theme's dependencies in the `manifest.json` file as in the following example:\n\n`1\n\n \"dependencies\": { \n\n2\n\n \"vtex.store-components\": \"2.x\" \n\n3\n\n } \n\n`\n\n1. Add the `product-description` block to any child of the `store.product` template (Product Details Page template). For example:\n\n`1\n\n \"store.product\": { \n\n2\n\n \"children\": [ \n\n3\n\n \"flex-layout.row#product\", \n\n4\n\n ] \n\n5\n\n }, \n\n6\n\n \"flex-layout.row#product\": { \n\n7\n\n \"children\": [ \n\n8\n\n+ \"product-description\" \n\n9\n\n ] \n\n10\n\n } \n\n`\n\n1. Then, declare the `product-description` block using the props stated in the [Props](#props) table.\n\n### Props\n\n| Prop name | Type | Description | Default |\n| --------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------- |\n| classes | CustomCSSClasses | Overrides default CSS handles. To better understand how this prop works, check [this document](https://read.calvincode.net/reader?url=https://github.com/vtex-apps/css-handles%23usecustomclasses). Note that this is only helpful if you're using this block as a React component. | undefined |\n| collapseContent | Boolean | If true, whenever the product description is too big, it will collapse and show a \"Show More\" button. When false, it will never collapse and will always show the whole description. | true |\n| showTitle | boolean | Define whether or not to show the title. | true |\n| title | string | Defines a custom title for the description section. | undefined |\n\n## Customization\n\nTo apply CSS customizations in this and other blocks, follow the [Using CSS handles for store customization](https://read.calvincode.net/reader?url=https://developers.vtex.com/vtex-developer-docs/docs/vtex-io-documentation-using-css-handles-for-store-customization) guide.\n\n| CSS Handles |\n| --------------------------- |\n| productDescriptionContainer |\n| productDescriptionText |\n| productDescriptionTitle |\n\nSee also\n\n[Vtex.store ComponentsVTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/apps/vtex.store-components)[VTEX App StoreVTEX IO Apps](https://read.calvincode.net/reader?url=https://apps.vtex.com/)\n\nON THIS PAGE\n\n[Configuration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/apps/[email protected]/ProductDescription%23configuration)\n\n[Props](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/apps/[email protected]/ProductDescription%23props)\n\n[Customization](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/[email protected]/ProductDescription/docs/apps/[email protected]/ProductDescription%23customization)\n\nWas this helpful?\n\n[Github](https://read.calvincode.net/reader?url=https://github.com/vtex-apps)[Help Center](https://read.calvincode.net/reader?url=https://help.vtex.com/)[Community](https://read.calvincode.net/reader?url=https://community.vtex.com/?%5Fga=2.198523433.743584735.1647618303-1974737580.1645714642)[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)", "role": "assistant" } ]
synthetic_similar-products-variants_25_a14b4984
[ { "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. You provide detailed, accurate answers with working code examples.", "role": "system" }, { "content": "Why is similar-products-variants not rendering? Common causes and fixes.", "role": "user" }, { "content": "Here are the most common issues and their solutions:\n\n**Issue 1: No Similar Products Configured**\n\nThe component renders nothing if no similar products exist.\n\n**Solution:** Configure similar products in Admin > Catalog > Products and SKU > Similar (Alternative Products)\n\n**Issue 2: App Not Installed**\n\n**Check:**\n```bash\nvtex list | grep similar\n```\n\n**Solution:**\n```bash\nvtex install vtex.similar-products-variants\n```\n\n**Issue 3: Missing Dependency in manifest.json**\n\n**Check your manifest.json:**\n```jsonc\n{\n \"dependencies\": {\n \"vtex.similar-products-variants\": \"0.x\" // Must be present\n }\n}\n```\n\n**Issue 4: Block Not in ProductContext**\n\nThe component must be within a `store.product` template or similar context.\n\n**Wrong:**\n```jsonc\n{\n \"store.home\": {\n \"children\": [\n \"similar-products-variants\" // Won't work - no product context\n ]\n }\n}\n```\n\n**Correct:**\n```jsonc\n{\n \"store.product\": {\n \"children\": [\n \"similar-products-variants\" // Works - has product context\n ]\n }\n}\n```\n\n**Issue 5: imageLabel Not Found**\n\nIf specified `imageLabel` doesn't exist on similar products, first image is used. But if there are no images at all:\n\n**Debug:**\n1. Check Admin > Catalog > SKU > Images\n2. Verify the Label field matches exactly (case-sensitive)\n3. Ensure all similar products have the labeled image\n\n**Issue 6: GraphQL Errors**\n\n**Debug with console:**\n```typescript\nconst { data, loading, error } = useQuery(query, { ... })\nconsole.log({ data, loading, error })\n```\n\nCheck browser network tab for GraphQL errors.\n\n**Issue 7: CSS Hiding the Component**\n\n**Check:**\n```css\n/* Accidental hiding */\n.variants {\n display: none !important; /* Remove this */\n visibility: hidden; /* Remove this */\n}\n```\n\n---", "role": "assistant" } ]
code_modal_cb0e93d5
[ { "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": "system" }, { "content": "How do I implement the Modal Context component in my VTEX store?", "role": "user" }, { "content": "Here's the implementation:\n\n```tsx\nimport React, { createContext, useContext } from 'react'\n\nconst ModalContext = createContext<ModalContext>({ closeModal: () => {} })\n\ninterface ModalContext {\n closeModal: () => void\n}\n\nconst withModal = <P extends object>(\n WrappedComponent: React.ComponentType<P>\n ): React.FC<P & ModalContext> => \n (props: P) => (\n <ModalContext.Consumer>\n {context => <WrappedComponent {...props} {...context} />}\n </ModalContext.Consumer>\n)\n\nconst useModal = () => useContext(ModalContext)\n\nexport default { useModal, withModal, Provider: ModalContext.Provider }\n\n```", "role": "assistant" } ]
code_service-course_8ea0d39e
[ { "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": "system" }, { "content": "Show me the backend implementation from service-course.", "role": "user" }, { "content": "The implementation is:\n\n```typescript\nimport { IOClients } from '@vtex/api'\n\n\n// Extend the default IOClients implementation with our own custom clients.\nexport class Clients extends IOClients {\n\n}\n\n```", "role": "assistant" } ]
code_product-identifier_761b7539
[ { "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": "system" }, { "content": "Show me the implementation of product-identifier/react/typings/vtex.product-summary-context.d.ts from product-identifier.", "role": "user" }, { "content": "Here's the source code:\n\n```typescript\ndeclare module 'vtex.product-summary-context/ProductSummaryContext' {\n interface ProductSummaryContext {\n product: {\n productId: string\n productReference: string\n items: Item[]\n sku: Item\n }\n }\n\n interface Item {\n itemId: string\n referenceId: Reference\n }\n\n interface Reference {\n Value: string\n }\n\n export const useProductSummary = () => ProductSummaryContext\n}\n\n```", "role": "assistant" } ]
synthetic_sandbox_27_59f26a3e
[ { "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. You provide detailed, accurate answers with working code examples.", "role": "system" }, { "content": "How do I debug Sandbox component issues?", "role": "user" }, { "content": "Debugging Sandbox issues requires checking multiple layers: the block configuration, the iframe rendering, and the JavaScript execution inside the iframe.\n\n**Code Example:**\n\n```jsonc\n// store/blocks/sandbox-debug.jsonc\n{\n // Debug sandbox with comprehensive logging\n \"sandbox#debug-mode\": {\n \"props\": {\n \"width\": \"100%\",\n \"height\": \"auto\",\n \"allowCookies\": true,\n \"initialContent\": \"<style>.debug-panel { font-family: monospace; font-size: 12px; background: #1e1e1e; color: #d4d4d4; padding: 15px; border-radius: 8px; max-height: 400px; overflow: auto; } .debug-section { margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #333; } .debug-title { color: #569cd6; margin-bottom: 8px; font-weight: bold; } .debug-success { color: #4ec9b0; } .debug-warning { color: #dcdcaa; } .debug-error { color: #f14c4c; } pre { white-space: pre-wrap; word-break: break-all; margin: 5px 0; }</style><div class='debug-panel'><div class='debug-section'><div class='debug-title'>🔍 Sandbox Debug Panel</div><div id='init-status'></div></div><div class='debug-section'><div class='debug-title'>📦 Props Available</div><div id='props-display'></div></div><div class='debug-section'><div class='debug-title'>🍪 Cookies</div><div id='cookies-display'></div></div><div class='debug-section'><div class='debug-title'>📡 Messages Received</div><div id='messages-log'></div></div></div><script>console.log('[Sandbox Debug] Initializing...'); document.getElementById('init-status').innerHTML = '<span class=\\\"debug-success\\\">✓ Sandbox initialized at ' + new Date().toISOString() + '</span>'; function updatePropsDisplay() { var propsEl = document.getElementById('props-display'); if (window.props) { var keys = Object.keys(window.props); propsEl.innerHTML = '<span class=\\\"debug-success\\\">✓ Props available: ' + keys.join(', ') + '</span><pre>' + JSON.stringify(window.props, null, 2).substring(0, 1000) + '...</pre>'; } else { propsEl.innerHTML = '<span class=\\\"debug-warning\\\">⚠ window.props not yet available</span>'; } } function updateCookiesDisplay() { var cookiesEl = document.getElementById('cookies-display'); var cookies = document.cookie; if (cookies) { cookiesEl.innerHTML = '<span class=\\\"debug-success\\\">✓ Cookies accessible</span><pre>' + cookies + '</pre>'; } else { cookiesEl.innerHTML = '<span class=\\\"debug-warning\\\">⚠ No cookies available (allowCookies may be false)</span>'; } } var messageCount = 0; var messagesLog = document.getElementById('messages-log'); window.addEventListener('message', function(e) { messageCount++; var logEntry = '<div>[' + messageCount + '] ' + new Date().toLocaleTimeString() + ' - Type: ' + (e.data && e.data.type ? e.data.type : 'unknown') + '</div>'; messagesLog.innerHTML = logEntry + messagesLog.innerHTML; updatePropsDisplay(); console.log('[Sandbox Debug] Message received:', e.data); }); updatePropsDisplay(); updateCookiesDisplay(); console.log('[Sandbox Debug] Setup complete');</script>\"\n }\n },\n \n // Minimal test sandbox\n \"sandbox#test-minimal\": {\n \"props\": {\n \"width\": \"200px\",\n \"height\": \"100px\",\n \"initialContent\": \"<div style='background: green; color: white; padding: 20px; text-align: center;'>✓ Sandbox Working</div>\"\n }\n }\n}\n```\n\n**Debugging Steps:**\n\n1. **Check if iframe exists**: Right-click and inspect the page, look for `<iframe class=\"vtex-sandbox-iframe\">`\n\n2. **View iframe source**: In browser dev tools, look at the iframe's `src` attribute (it will be a data URL)\n\n3. **Access iframe console**: In Chrome DevTools, use the dropdown at the top of the Console panel to select the iframe context\n\n4. **Check for JavaScript errors**: Look for red errors in both parent and iframe consoles\n\n5. **Verify props are received**: Add `console.log(window.props)` to your sandbox script\n\n6. **Test incrementally**: Start with the simplest possible sandbox and add complexity gradually\n\n---", "role": "assistant" } ]
code_wordpress-integration-qa-theme_7ea02efc
[ { "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": "system" }, { "content": "What are the key features of wordpress-integration-qa-theme?", "role": "user" }, { "content": "This is the code:\n\n```markdown\n# Store theme\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\nOur boilerplate theme to create stores in the VTEX IO platform.\n\n## Preview\n![store-theme-default](https://user-images.githubusercontent.com/1354492/63937047-e8d81c80-ca37-11e9-86fc-61e88847bbfb.png)\n\n## Tutorial\nTo understand how things work check our tutorial [Build a store using VTEX IO](https://vtex.io/docs/getting-started/build-stores-with-store-framework/1/)\n\n## Dependencies\nAll store components that you see on this document are open source too. Production ready, you can found those apps in this GitHub organization.\n\nStore framework is the baseline to create any store using _VTEX IO Web Framework_.\n- [Store](https://github.com/vtex-apps/store/blob/master/README.md)\n\nStore GraphQL is a middleware to access all VTEX APIs.\n- [Store GraphQL](https://github.com/vtex-apps/store-graphql/blob/master/docs/README.md)\n\n### Store Component Apps\n- [Header](https://github.com/vtex-apps/store-header/blob/master/docs/README.md)\n- [Footer](https://github.com/vtex-apps/store-footer/blob/master/docs/README.md)\n- [Slider Layout](https://github.com/vtex-apps/slider-layout/blob/master/docs/README.md)\n- [Shelf](https://github.com/vtex-apps/shelf/blob/master/docs/README.md)\n- [Telemarketing](https://github.com/vtex-apps/telemarketing/blob/master/docs/README.md)\n- [Menu](https://github.com/vtex-apps/menu/blob/master/docs/README.md)\n- [Login](https://github.com/vtex-apps/login/blob/master/docs/README.md)\n- [Minicart](https://github.com/vtex-apps/minicart/blob/master/docs/README.md)\n- [Category Menu](https://github.com/vtex-apps/category-menu/blob/master/docs/README.md)\n- [Product Summary](https://github.com/vtex-apps/product-summary/blob/master/docs/README.md)\n- [Breadcrumb](https://github.com/vtex-apps/breadcrumb/blob/master/docs/README.md)\n- [Search Result](https://github.com/vtex-apps/search-result/blob/master/docs/README.md)\n- [Product Details](https://github.com/vtex-apps/product-details/blob/master/docs/README.md)\n- [Store Components](https://github.com/vtex-apps/store-components/blob/master/docs/README.md)\n- [Order Placed](https://github.com/vtex-apps/order-placed/blob/master/docs/README.md) \n\n### Store Pixel Apps\n\n - [Facebook Pixel](https://github.com/vtex-apps/facebook-pixel/blob/master/docs/README.md)\n - [Google Tag Manager](https://github.com/vtex-apps/google-tag-manager/blob/master/docs/README.md)\n\n## Contributing\n\nCheck it out [how to contribute](https://github.com/vtex-apps/awesome-io#contributing) with this project.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n <tr>\n <td align=\"center\"><a href=\"http://www.hugoccosta.com\"><img src=\"https://avatars2.githubusercontent.com/u/20212776?v=4\" width=\"100px;\" alt=\"\"/><br /><sub><b>Hugo Costa</b></sub></a><br /><a href=\"https://github.com/vtex-apps/store-theme/commits?author=hugocostadev\" title=\"Documentation\">📖</a></td>\n </tr>\n</table>\n\n<!-- markdownlint-enable -->\n<!-- prettier-ignore-end -->\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n```", "role": "assistant" } ]
code_tawk-to_abe96200
[ { "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": "system" }, { "content": "Show me the implementation of tawk-to/public/metadata/messages/pt-BR.json from tawk-to.", "role": "user" }, { "content": "```json\n{\n \"name\": \"Tawk.to\",\n \"headline\": \"Tawk.to é um app de mensagens gratuito que as empresas usam para criar melhores relacionamentos com seus clientes.\",\n \"overview\": \"Este aplicativo permite a integração com o serviço gratuito oferecido pelo Google de coleta de avaliações e comentários dos clientes que compraram na sua loja.\\nAs informações coletadas podem ser úteis para monitorar, por meio do Google Merchant Center, como estão sendo as experiências dos clientes, também para anúncios do Google AdWords e para apresentação de produtos no Google Shopping.\",\n \"features\": [\n \"Monitoramento em tempo real\",\n \"Gatilhos automatizados\",\n \"Widgets personalizáveis\",\n \"27 idiomas\",\n \"Notificações por e-mail\"\n ],\n \"websiteURL\": \"https://vtex.com/\",\n \"support\": {\n \"url\": \"https://support.vtex.com/hc/requests\"\n }\n}\n\n```", "role": "assistant" } ]
doc_f9c11174
[ { "content": "You are a VTEX documentation expert. You provide accurate, detailed information about VTEX platform, APIs, apps, and Store Framework development.", "role": "system" }, { "content": "Provide a guide on guides consult store search terms information in VTEX.", "role": "user" }, { "content": "Documentation\n\n[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)\n\n[GuidesLearn how to use our APIs and extend the VTEX platform.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides)\n\n[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/api-reference)\n\n[App DevelopmentLearn how to build cloud-based apps and integrations.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/app-development)\n\n[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/storefront-development)\n\n[VTEX IO AppsFind pre-built solutions to grow your business.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/vtex-io-apps)\n\n[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/troubleshooting)\n\n[Release NotesStay up to date with our latest releases and bug fixes.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/updates/release-notes)\n\nGuides\n\n[VTEX Platform Overview](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/vtex-platform-overview)\n\n---\n\n[API usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/api-usage)\n\n---\n\n[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/getting-started)\n\n---\n\nIntegration Guides\n\n---\n\n[Catalog](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/catalog-integration)\n\n---\n\n[Checkout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/checkout-api-overview)\n\n---\n\n[Master Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/master-data)\n\n---\n\nPayments\n\n---\n\nOrders\n\n---\n\nLogistics\n\n---\n\nB2B Suite\n\n---\n\nVTEX Sales App\n\n---\n\nUI Customization\n\n---\n\nMessage Center\n\n---\n\nPricing\n\n---\n\nPromotions\n\n---\n\nInfrastructure\n\n---\n\nSearch\n\n[How search parameters work](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/how-search-parameters-work)\n\n[Search Control – fulltextSearchBox](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/search-control-fulltextsearchbox)\n\n[Consult store search terms information](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/consult-store-search-terms-information)\n\n[Consult product search information](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/consult-product-search-information)\n\n[Get banner list for a specific search](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/get-banner-list-for-a-specific-search)\n\n[Get a list of the possible facets for a specific search](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/get-a-list-of-the-possible-facets-for-a-specific-search)\n\n[Segmenting the search result](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/vtex-io-documentation-segmenting-the-search-result)\n\n[Access Control List](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/access-control-list)\n\n[Delivery promise for headless stores (Beta)](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/delivery-promise-for-headless-stores)\n\n---\n\nStorefront Permissions\n\n---\n\n[VTEX Activity Flow](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/activity-flow)\n\n---\n\n[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/vtex-ads)\n\n---\n\nVTEX Session\n\n---\n\nVTEX Shield\n\n---\n\n[Data Protection Plus](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/data-protection-plus)\n\n---\n\nWeni by VTEX\n\n---\n\n[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides)\n\n[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/api-reference)\n\n[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/app-development)\n\n[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/storefront-development)\n\n[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/vtex-io-apps)\n\n[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/troubleshooting)\n\n---\n\n[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/updates/release-notes)\n\nGuides\n\n[VTEX Platform Overview](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/vtex-platform-overview)\n\n---\n\n[API usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/api-usage)\n\n---\n\n[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/getting-started)\n\n---\n\nIntegration Guides\n\n---\n\n[Catalog](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/catalog-integration)\n\n---\n\n[Checkout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/checkout-api-overview)\n\n---\n\n[Master Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/master-data)\n\n---\n\nPayments\n\n---\n\nOrders\n\n---\n\nLogistics\n\n---\n\nB2B Suite\n\n---\n\nVTEX Sales App\n\n---\n\nUI Customization\n\n---\n\nMessage Center\n\n---\n\nPricing\n\n---\n\nPromotions\n\n---\n\nInfrastructure\n\n---\n\nSearch\n\n[How search parameters work](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/how-search-parameters-work)\n\n[Search Control – fulltextSearchBox](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/search-control-fulltextsearchbox)\n\n[Consult store search terms information](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/consult-store-search-terms-information)\n\n[Consult product search information](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/consult-product-search-information)\n\n[Get banner list for a specific search](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/get-banner-list-for-a-specific-search)\n\n[Get a list of the possible facets for a specific search](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/get-a-list-of-the-possible-facets-for-a-specific-search)\n\n[Segmenting the search result](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/vtex-io-documentation-segmenting-the-search-result)\n\n[Access Control List](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/access-control-list)\n\n[Delivery promise for headless stores (Beta)](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/delivery-promise-for-headless-stores)\n\n---\n\nStorefront Permissions\n\n---\n\n[VTEX Activity Flow](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/activity-flow)\n\n---\n\n[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/vtex-ads)\n\n---\n\nVTEX Session\n\n---\n\nVTEX Shield\n\n---\n\n[Data Protection Plus](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/data-protection-plus)\n\n---\n\nWeni by VTEX\n\n---\n\n[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides)\n\nSearch\n\n[Consult store search terms information](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/consult-store-search-terms-information)\n\nImproving product discovery with autocomplete suggestions and search insights\n\nTo deliver relevant search results to your store's shoppers, it's essential to understand how they search for products in your store. The [Intelligent Search API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/intelligent-search-api%23overview) offers powerful insights into [popular search terms](#get-the-most-searched-terms) and [autocomplete suggestions](#get-autocomplete-suggested-terms-and-similar-attributes). The sections below outline how to use these tools to optimize your store's search experience.\n\n## Retrieving the most searched terms\n\nTo get your customers' most searched terms, use the [Get list of the 10 most searched terms](https://read.calvincode.net/reader?url=https://developers.vtex.com/vtex-rest-api/reference/get%5Ftop-searches) endpoint. This endpoint allows you to filter results by specifying a `locale` in the query parameters.\n\nThe response will return the most searched terms in order of popularity along with the number of searches:\n\n![{\"base64\":\" \",\"img\":{\"width\":1342,\"height\":640,\"type\":\"png\",\"mime\":\"image/png\",\"wUnits\":\"px\",\"hUnits\":\"px\",\"length\":188854,\"url\":\"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/consult-store-search-terms-information-0.png\"}}](https://read.calvincode.net/reader?url=https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/consult-store-search-terms-information-0.png)\n\n### Response body example\n\n`1\n\n{ \n\n2\n\n \"searches\": [ \n\n3\n\n { \n\n4\n\n \"term\": \"home\", \n\n5\n\n \"count\": 14 \n\n6\n\n }, \n\n7\n\n { \n\n8\n\n \"term\": \"shirt\", \n\n9\n\n \"count\": 10 \n\n10\n\n }, \n\n11\n\n { \n\n12\n\n \"term\": \"top\", \n\n13\n\n \"count\": 9 \n\n14\n\n }, \n\n15\n\n { \n\n16\n\n \"term\": \"tops\", \n\n17\n\n \"count\": 6 \n\n18\n\n }, \n\n19\n\n { \n\n20\n\n \"term\": \"camera\", \n\n21\n\n \"count\": 5 \n\n22\n\n }, \n\n23\n\n { \n\n24\n\n \"term\": \"kit\", \n\n25\n\n \"count\": 5 \n\n26\n\n }, \n\n27\n\n { \n\n28\n\n \"term\": \"work shirt\", \n\n29\n\n \"count\": 2 \n\n30\n\n }, \n\n31\n\n { \n\n32\n\n \"term\": \"shirts\", \n\n33\n\n \"count\": 2 \n\n34\n\n }, \n\n35\n\n { \n\n36\n\n \"term\": \"clothing\", \n\n37\n\n \"count\": 2 \n\n38\n\n }, \n\n39\n\n { \n\n40\n\n \"term\": \"classic shoes\", \n\n41\n\n \"count\": 1 \n\n42\n\n } \n\n43\n\n ] \n\n44\n\n} \n\n`\n\n## Retrieving autocomplete suggested terms and similar attributes\n\nTo gather data on [autocomplete suggestions](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/vtex-search-autocomplete) and similar attributes, use the [Get list of suggested terms and attributes similar to the search term](https://read.calvincode.net/reader?url=https://developers.vtex.com/vtex-rest-api/reference/get%5Fautocomplete-suggestions) endpoint. You can refine the response by defining the `locale` and `query` parameters.\n\nThe response will return the searched terms by popularity order and the corresponding autocomplete suggestions for each term.\n\n![{\"base64\":\" \",\"img\":{\"width\":1358,\"height\":692,\"type\":\"png\",\"mime\":\"image/png\",\"wUnits\":\"px\",\"hUnits\":\"px\",\"length\":340366,\"url\":\"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/consult-store-search-terms-information-1.png\"}}](https://read.calvincode.net/reader?url=https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/consult-store-search-terms-information-1.png)\n\n### Response body example\n\n`1\n\n{ \n\n2\n\n \"searches\": [ \n\n3\n\n { \n\n4\n\n \"term\": \"tv\", \n\n5\n\n \"count\": 28861, \n\n6\n\n \"attributes\": [ \n\n7\n\n { \n\n8\n\n \"key\": \"departamento\", \n\n9\n\n \"value\": \"tvs-e-video\", \n\n10\n\n \"labelKey\": \"Departamento\", \n\n11\n\n \"labelValue\": \"TVs e Vídeo\" \n\n12\n\n }, \n\n13\n\n { \n\n14\n\n \"key\": \"categoria\", \n\n15\n\n \"value\": \"tvs\", \n\n16\n\n \"labelKey\": \"Categoria\", \n\n17\n\n \"labelValue\": \"TVs\" \n\n18\n\n }, \n\n19\n\n { \n\n20\n\n \"key\": \"subcategoria\", \n\n21\n\n \"value\": \"receptor-de-controle-de-acesso\", \n\n22\n\n \"labelKey\": \"Subcategoria\", \n\n23\n\n \"labelValue\": \"Receptor de Controle de Acesso\" \n\n24\n\n } \n\n25\n\n ] \n\n26\n\n }, \n\n27\n\n { \n\n28\n\n \"term\": \"smarth tv\", \n\n29\n\n \"count\": 2308 \n\n30\n\n }, \n\n31\n\n { \n\n32\n\n \"term\": \"painel para tv\", \n\n33\n\n \"count\": 975 \n\n34\n\n }, \n\n35\n\n { \n\n36\n\n \"term\": \"rack tv\", \n\n37\n\n \"count\": 589 \n\n38\n\n } \n\n39\n\n ] \n\n40\n\n} \n\n`\n\nContributors\n\n1\n\n[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F60782333%3Fv%3D4%26w=64%26q=75)](https://github.com/carolinamenezes)\n\nWas this helpful?\n\nYes\n\nNo\n\n[Suggest Edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/Search/consult-store-search-terms-information.md)\n\n[Search Control – fulltextSearchBox« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information//docs/guides/search-control-fulltextsearchbox)[Consult product search informationNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information//docs/guides/consult-product-search-information)\n\nContributors\n\n1\n\n[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F60782333%3Fv%3D4%26w=64%26q=75)](https://github.com/carolinamenezes)\n\nON THIS PAGE\n\n[Retrieving the most searched terms](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/consult-store-search-terms-information%23retrieving-the-most-searched-terms)\n\n[Response body example](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/consult-store-search-terms-information%23response-body-example)\n\n[Retrieving autocomplete suggested terms and similar attributes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/consult-store-search-terms-information%23retrieving-autocomplete-suggested-terms-and-similar-attributes)\n\n[Response body example](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/consult-store-search-terms-information%23response-body-example)\n\nWas this helpful?\n\n Send feedback\n\n[Suggest edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/Search/consult-store-search-terms-information.md)\n\nCopy page\n\nOn this page\n\nON THIS PAGE\n\n[Retrieving the most searched terms](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/consult-store-search-terms-information%23retrieving-the-most-searched-terms)\n\n[Response body example](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/consult-store-search-terms-information%23response-body-example)\n\n[Retrieving autocomplete suggested terms and similar attributes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/consult-store-search-terms-information%23retrieving-autocomplete-suggested-terms-and-similar-attributes)\n\n[Response body example](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/consult-store-search-terms-information/docs/guides/consult-store-search-terms-information%23response-body-example)\n\nOn this page\n\n[Github](https://read.calvincode.net/reader?url=https://github.com/vtex-apps)[Help Center](https://read.calvincode.net/reader?url=https://help.vtex.com/)[Community](https://read.calvincode.net/reader?url=https://community.vtex.com/?%5Fga=2.198523433.743584735.1647618303-1974737580.1645714642)[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)", "role": "assistant" } ]
code_datadog-rum-pixel_6c20e0e7
[ { "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": "system" }, { "content": "What are the key features of datadog-rum-pixel?", "role": "user" }, { "content": "Here's how it works:\n\n```markdown\n📢 Use this project, [contribute](https://github.com/vtex-apps/datadog-rum-pixel) to it or open issues to help evolve it using [Store Discussion](https://github.com/vtex-apps/store-discussion).\n\n# Datadog RUM\n\nThe VTEX Datadog RUM app is a first party integration to the [Datadog Real User Monitoring (RUM)](https://www.datadoghq.com/product/real-user-monitoring/).\n\n## Installation and configuration\n\n### Step 1 - Installing Datadog RUM app\n\nInstall `vtex.datadog-rum-pixel` in your account.\n\n vtex install vtex.datadog-rum-pixel\n\n> ℹ️ **Info**\n>\n> Access the [Datadog RUM](https://www.datadoghq.com/product/real-user-monitoring/)</a> and login to your account in order to find out what is your account **Datadog RUM ID**. You will need your application ID and client token to set up the app.\n\nFollow the instructions provided by the Datadog RUM App in the `Admin` > `Account Settings` > `Apps` > `My Apps` > `Datadog RUM Pixel App`\n\n### Step 2 - Setup Datadog RUM\n\nTo set up Datadog RUM in your store, you must create and set up all necessary configurations.\n\n#### Configuring Datadog RUM\n\n1. Log in to your [Datadog account](https://www.datadoghq.com/) and navigate to the RUM section.\n\n2. Obtain your application ID, client token, site and service from the Datadog RUM settings.\n\n3. In your VTEX store, go to the Datadog RUM app settings and enter the application ID, client token, site and service.\n\n4. Configure additional settings as required, such as session sample rate, session replay sample rate, track user interactions, track resources, track long tasks, and default privacy level.\n\n#### Checking received data\n\nNow, let's check the received data from your website.\n\n1. Enter in the Datadog RUM dashboard and navigate to the `Real User Monitoring` section.\n\n2. You will see the data from your website, such as page views, user sessions, and more.\n\n> ℹ️ **Info**\n>\n> If you are not able to see any data, go to your browser's Developer Tools, check the console for any errors, and ensure that the Datadog RUM script is correctly set up.\n\n```", "role": "assistant" } ]
code_community_733d6a2e
[ { "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": "system" }, { "content": "Show me the implementation of community/agapito-store/src/Components/Header/Menu/Mobile/index.js from community.", "role": "user" }, { "content": "The implementation is:\n\n```javascript\nimport { useState } from \"react\";\nimport ContentMobile from \"./Content/Content\";\nimport Button from \"../ButtonMobile\";\nimport Minicart from \"../../../MiniCart\";\n\nfunction Menu2(props) {\n const [open, setOpen] = useState(false);\n return (\n <>\n <div className={open === true ? \"mobile menu-open-father\" : \"mobile menu-close-father\"}>\n <Button onClick={() => {\n setOpen(!open)\n document.querySelector(\".mobile\").classList.toggle('fixed');\n }} state={open} />\n <div className={open === true ? \"menu-open\" : \"menu-close\"}>\n <ContentMobile api={props.api} />\n </div>\n </div>\n <Minicart />\n </>\n );\n}\n\nexport default Menu2;\n\n```", "role": "assistant" } ]
code_collections_06a03147
[ { "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": "system" }, { "content": "Show me the CSS/SCSS implementation from collections.", "role": "user" }, { "content": "Here's how it works:\n\n```css\n.spinner {\n animation: rotator 1.4s linear infinite;\n}\n\n@keyframes rotator {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(270deg);\n }\n}\n\n.path {\n stroke-dasharray: 187;\n stroke-dashoffset: 0;\n transform-origin: center;\n animation: dash 1.4s ease-in-out infinite;\n}\n\n@keyframes dash {\n 0% {\n stroke-dashoffset: 187;\n }\n 50% {\n stroke-dashoffset: 47.75;\n transform: rotate(135deg);\n }\n 100% {\n stroke-dashoffset: 187;\n transform: rotate(450deg);\n }\n}\n\n```", "role": "assistant" } ]
code_sms-link_dfd33302
[ { "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": "system" }, { "content": "How do I use sms-link?", "role": "user" }, { "content": "This is the code:\n\n```markdown\n## sms-link\n\n\nThis app and all affiliated services are provided “as is”, without warranty of any kind, either express or implied. Neither the publisher nor its partners, affiliates, employees, or contractors guarantee that this app will meet your requirements, provide uninterrupted use, or operate without delay or without error. Neither the publisher nor its partners, affiliates, employees, or contractors assume any responsibility for any errors and malfunctions within the app and will not provide support or maintenance of any kind.\n \n\nAll provisions and warranties of any kind, express or implied, including but not limited to any guarantees of performance, process integrity, or particular functionalities, are hereby disclaimed and excluded unless otherwise prohibited or restricted by applicable law.\n\n_Developed under EE FPA._\n```", "role": "assistant" } ]
code_awin_efda97d2
[ { "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": "system" }, { "content": "How do I use awin?", "role": "user" }, { "content": "Here's the implementation:\n\n```markdown\n# Awin\n\nOpen the VTEX APP Store and install the app on your store.\n\nor\n\nRun the following command:\n\n```sh\nvtex install [email protected]\n```\n\nNext, open the app settings on your admin and fill the form with <FIELDS>.\n\n```", "role": "assistant" } ]
code_easy-setup_0950f682
[ { "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": "system" }, { "content": "Show me the backend implementation from easy-setup.", "role": "user" }, { "content": "Here's the node service:\n\n```typescript\nimport type { InstanceOptions, IOContext, IOResponse } from '@vtex/api'\nimport { ExternalClient } from '@vtex/api'\n\nimport type { SpecificationField } from '../../dataSources/fieldsData'\nimport type { IGroupResponse } from '../../dataSources/groupData'\nimport { returnDataIfConflictOrThrow } from '../../utils/errors'\nimport type {\n AssociateSKUAttachmentData,\n AssociateSKUAttachmentResponse,\n CreateAttachmentData,\n CreateAttachmentResponse,\n CreateProductData,\n CreateProductResponse,\n CreateSKUFileData,\n CreateSKUFileResponse,\n IBrand,\n ICollectionPayload,\n ICollectionResponse,\n ISKUPayload,\n ISubCollectionPayload,\n ISubCollectionResponse,\n} from './types'\n\nexport default class CatalogClient extends ExternalClient {\n constructor(context: IOContext, options?: InstanceOptions) {\n super(`http://${context.account}.vtexcommercestable.com.br`, context, {\n ...options,\n headers: {\n Accept: 'application/json',\n 'Cache-Control': 'no-cache',\n 'Content-Type': 'application/json',\n VtexIdclientAutcookie: context.adminUserAuthToken as string,\n 'X-Vtex-Use-Https': 'true',\n },\n })\n }\n\n public async createBrand(BrandPayload: IBrand): Promise<IOResponse<IBrand>> {\n try {\n return await this.http.post('/api/catalog/pvt/brand', BrandPayload)\n } catch (error) {\n const {\n response: { data, status },\n headers,\n } = error\n\n return {\n data,\n headers,\n status,\n }\n }\n }\n\n public createCollection(\n collectionPayload: ICollectionPayload\n ): Promise<IOResponse<ICollectionResponse>> {\n return this.http.post('/api/catalog/pvt/collection', collectionPayload)\n }\n\n public createSubCollection(\n subCollectionPayload: ISubCollectionPayload\n ): Promise<IOResponse<ISubCollectionResponse>> {\n return this.http.post(\n '/api/catalog/pvt/subcollection',\n subCollectionPayload\n )\n }\n\n public setBrandSubCollection(\n subCollectionId: number,\n BrandSubCollectionData: any\n ): Promise<IOResponse<ISubCollectionResponse>> {\n return this.http.post(\n `/api/catalog/pvt/subcollection/${subCollectionId}/brand`,\n BrandSubCollectionData\n )\n }\n\n public async createCategory(categoryPayload: any): Promise<IOResponse<any>> {\n try {\n return await this.http.post(`/api/catalog/pvt/category`, categoryPayload)\n } catch (error) {\n const {\n response: { data, status },\n headers,\n } = error\n\n return {\n data,\n headers,\n status,\n }\n }\n }\n\n public createSkuSpecificationGroup = (groupData: any) =>\n this.post<IGroupResponse>(\n 'api/catalog_system/pvt/specification/group',\n groupData\n )\n\n public createSkuSpecificationField = (\n specificationField: SpecificationField\n ) =>\n this.post('/api/catalog_system/pvt/specification/field', specificationField)\n\n public createSkuSpecificationFieldValue = (fieldValue: any) =>\n this.post('/api/catalog_system/pvt/specification/fieldValue', fieldValue)\n\n public createProduct = (\n data: CreateProductData\n ): Promise<CreateProductResponse> =>\n this.post<CreateProductResponse>('/api/catalog/pvt/product', data)\n\n /* public createSKU = (\n data: ISKUPayload\n ): Promise<ISKUPayload> =>\n this.post<ISKUPayload>('/api/catalog/pvt/stockkeepingunit', data)\n */\n\n public async createSKU(\n skuPayLoad: ISKUPayload\n ): Promise<IOResponse<ISKUPayload>> {\n try {\n return await this.http.post(\n `/api/catalog/pvt/stockkeepingunit`,\n skuPayLoad\n )\n } catch (error) {\n const {\n response: { data, status },\n headers,\n } = error\n\n console.log(\n `${skuPayLoad.Id}-RefId:${skuPayLoad.RefId}-ProductId:${skuPayLoad.ProductId}`\n )\n console.log(error)\n\n return {\n data,\n headers,\n status,\n }\n }\n }\n\n public createSKUFile = (skuId: string | number, data: CreateSKUFileData) =>\n this.post<CreateSKUFileResponse>(\n `/api/catalog/pvt/stockkeepingunit/${skuId}/file`,\n data\n )\n\n public setSkuSubscription = (data: AssociateSKUAttachmentData) =>\n this.post<AssociateSKUAttachmentResponse>(\n '/api/catalog/pvt/skuattachment',\n data\n )\n\n public createAttachment = (data: CreateAttachmentData) =>\n this.post<CreateAttachmentResponse>(`/api/catalog/pvt/attachment`, data)\n\n private post = <T = any>(url: string, data: any) =>\n this.http.post<T>(url, data).catch<T>(returnDataIfConflictOrThrow(data))\n}\n\n```", "role": "assistant" } ]
code_cross-device-cart_6dd69eaa
[ { "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": "system" }, { "content": "Show me the implementation of cross-device-cart/dangerfile.js from cross-device-cart.", "role": "user" }, { "content": "The implementation is:\n\n```javascript\n// dangerfile.js\nconst { verify } = require('@vtex/danger')\n\nconst config = {\n // Set to true to enforce keepachangelog rules.\n keepachangelog: {\n changeVersion: false,\n },\n rules: {\n description: ['fail', { minLength: 20 }],\n assignee: 'fail',\n reviewers: 'fail',\n pr_size: ['warn', { additionLimit: 800, deletionLimit: -1 }],\n lock_file: 'warn',\n no_ignored_test: ['fail', { pattern: /test|spec/i }],\n no_debugger: ['fail', { pattern: /\\.[tj]sx?$/i }],\n enforce_graphql_provider: 'off',\n },\n}\n\nverify(config)\n\n```", "role": "assistant" } ]
synthetic_product-highlight-by-segment_18_29841d4e
[ { "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. You provide detailed, accurate answers with working code examples.", "role": "system" }, { "content": "How does product-highlight-by-vtex-segment interact with product-context?", "role": "user" }, { "content": "The component requires `vtex.product-context` to access product data, specifically the `productClusters` (collections) array.\n\n**How It Works:**\n\n```typescript\n// From ProductHighlight.tsx\nimport { useProduct } from 'vtex.product-context'\n\nconst ProductHighlight = () => {\n const { product } = useProduct()\n\n if (!product) {\n return null // No product context available\n }\n\n // Access product collections\n const collections: Collection[] = product.productClusters\n \n // Check if product belongs to seller collection\n sellerIds?.forEach((seller: string) => {\n productFromCollection.push(\n collections.some(\n (collection: Collection) =>\n collection.name.trim() === `${seller}-${defaultNameCollection}`\n )\n )\n })\n}\n```\n\n**Product Context Data Structure:**\n\n```typescript\ninterface Product {\n productId: string\n productName: string\n productClusters: Collection[] // Used by this component\n // ... other properties\n}\n\ninterface Collection {\n id: string\n name: string\n}\n```\n\n**Valid Product Context Locations:**\n\nThe component works in any block that provides product context:\n\n```jsonc\n// These templates provide product context:\n{\n // Product Details Page\n \"store.product\": {\n \"children\": [\"product-highlight-by-vtex-segment\"]\n },\n \n // Product Summary (Shelf/Gallery)\n \"product-summary.shelf\": {\n \"children\": [\"product-highlight-by-vtex-segment\"]\n },\n \n // Search Results\n \"search-result-layout.desktop\": {\n \"children\": [\n \"gallery\", // Contains product-summary blocks\n ]\n }\n}\n\n// These will NOT work (no product context):\n{\n \"store.home\": {\n \"children\": [\"product-highlight-by-vtex-segment\"] // Will return null\n }\n}\n```\n\n---", "role": "assistant" } ]
code_io-landing_dc0ab893
[ { "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": "system" }, { "content": "What props does Card Grid accept and how do I configure them?", "role": "user" }, { "content": "Here's the react component:\n\n```tsx\nimport React, { FunctionComponent } from 'react'\n\nimport Card from './Card'\nimport FlowerGround from './icons/FlowerGround'\nimport Video from './icons/Video'\nimport DesignDev from './icons/DesignDev'\nimport RunningShoes from './icons/RunnigShoes'\n\nconst CardGrid: FunctionComponent = () => {\n const cardsConfig = [\n {\n icon: <FlowerGround />,\n titleId: 'io.cards.first.title',\n textId: 'io.cards.first.text',\n link: '/docs/getting-started/what-is-vtex-io/1',\n },\n {\n icon: <Video />,\n titleId: 'io.cards.second.title',\n textId: 'io.cards.second.text',\n link: '#',\n soon: true,\n },\n {\n icon: <DesignDev />,\n titleId: 'io.cards.third.title',\n textId: 'io.cards.third.text',\n link: '/docs/components/all',\n },\n {\n icon: <RunningShoes />,\n titleId: 'io.cards.fourth.title',\n textId: 'io.cards.fourth.text',\n link: '/faq',\n },\n ]\n\n return (\n <section className=\"w-90 center flex justify-center flex-wrap mv7\">\n {cardsConfig.map((card, index) => (\n <Card\n icon={card.icon}\n title={card.titleId}\n text={card.textId}\n index={index}\n key={card.titleId}\n link={card.link}\n soon={card.soon}\n />\n ))}\n </section>\n )\n}\n\nexport default CardGrid\n\n```", "role": "assistant" } ]
doc_0bfeb7eb
[ { "content": "You are a VTEX documentation expert. You provide accurate, detailed information about VTEX platform, APIs, apps, and Store Framework development.", "role": "system" }, { "content": "Provide a guide on guides update an account orderform configuration in VTEX.", "role": "user" }, { "content": "Documentation\n\n[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)\n\n[GuidesLearn how to use our APIs and extend the VTEX platform.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides)\n\n[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/api-reference)\n\n[App DevelopmentLearn how to build cloud-based apps and integrations.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/app-development)\n\n[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/storefront-development)\n\n[VTEX IO AppsFind pre-built solutions to grow your business.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/vtex-io-apps)\n\n[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/troubleshooting)\n\n[Release NotesStay up to date with our latest releases and bug fixes.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/updates/release-notes)\n\nGuides\n\n[VTEX Platform Overview](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/vtex-platform-overview)\n\n---\n\n[API usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/api-usage)\n\n---\n\n[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/getting-started)\n\n---\n\nIntegration Guides\n\n---\n\n[Catalog](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/catalog-integration)\n\n---\n\n[Checkout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/checkout-api-overview)\n\n[Custom Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/custom-data-1)\n\n[Customization](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/customization)\n\n[Discounts](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/discounts)\n\n[Features](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/features)\n\n[Order Placement](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/orders-2)\n\n[Security](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/checkout-security)\n\n[Shopping Cart](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/shopping-cart-section-api-quick-start-guides)\n\n[Cart Attachments](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/cart-attachments-section-api-quick-start-guides)\n\n[Configuration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/configuration-section-api-quick-start-guides)\n\n[Getting an account orderForm configuration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/get-an-account-orderform-configuration)\n\n[Updating an account orderForm configuration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/update-an-account-orderform-configuration)\n\n[Get and update the seller exchange window](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/get-and-update-the-seller-exchange-window)\n\n[Clear orderForm message field from cart](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/clear-orderform-message-field-from-cart)\n\n[Fulfillment](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/fulfillment-checkout-section-api-quick-start-guides)\n\n[Region](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/region-section-api-quick-start-guides)\n\n[Checkout error codes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/checkout-error-codes)\n\n---\n\n[Master Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/master-data)\n\n---\n\nPayments\n\n---\n\nOrders\n\n---\n\nLogistics\n\n---\n\nB2B Suite\n\n---\n\nVTEX Sales App\n\n---\n\nUI Customization\n\n---\n\nMessage Center\n\n---\n\nPricing\n\n---\n\nPromotions\n\n---\n\nInfrastructure\n\n---\n\nSearch\n\n---\n\nStorefront Permissions\n\n---\n\n[VTEX Activity Flow](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/activity-flow)\n\n---\n\n[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/vtex-ads)\n\n---\n\nVTEX Session\n\n---\n\nVTEX Shield\n\n---\n\n[Data Protection Plus](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/data-protection-plus)\n\n---\n\nWeni by VTEX\n\n---\n\n[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides)\n\n[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/api-reference)\n\n[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/app-development)\n\n[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/storefront-development)\n\n[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/vtex-io-apps)\n\n[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/troubleshooting)\n\n---\n\n[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/updates/release-notes)\n\nGuides\n\n[VTEX Platform Overview](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/vtex-platform-overview)\n\n---\n\n[API usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/api-usage)\n\n---\n\n[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/getting-started)\n\n---\n\nIntegration Guides\n\n---\n\n[Catalog](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/catalog-integration)\n\n---\n\n[Checkout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/checkout-api-overview)\n\n[Custom Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/custom-data-1)\n\n[Customization](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/customization)\n\n[Discounts](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/discounts)\n\n[Features](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/features)\n\n[Order Placement](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/orders-2)\n\n[Security](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/checkout-security)\n\n[Shopping Cart](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/shopping-cart-section-api-quick-start-guides)\n\n[Cart Attachments](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/cart-attachments-section-api-quick-start-guides)\n\n[Configuration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/configuration-section-api-quick-start-guides)\n\n[Getting an account orderForm configuration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/get-an-account-orderform-configuration)\n\n[Updating an account orderForm configuration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/update-an-account-orderform-configuration)\n\n[Get and update the seller exchange window](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/get-and-update-the-seller-exchange-window)\n\n[Clear orderForm message field from cart](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/clear-orderform-message-field-from-cart)\n\n[Fulfillment](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/fulfillment-checkout-section-api-quick-start-guides)\n\n[Region](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/region-section-api-quick-start-guides)\n\n[Checkout error codes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/checkout-error-codes)\n\n---\n\n[Master Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/master-data)\n\n---\n\nPayments\n\n---\n\nOrders\n\n---\n\nLogistics\n\n---\n\nB2B Suite\n\n---\n\nVTEX Sales App\n\n---\n\nUI Customization\n\n---\n\nMessage Center\n\n---\n\nPricing\n\n---\n\nPromotions\n\n---\n\nInfrastructure\n\n---\n\nSearch\n\n---\n\nStorefront Permissions\n\n---\n\n[VTEX Activity Flow](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/activity-flow)\n\n---\n\n[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/vtex-ads)\n\n---\n\nVTEX Session\n\n---\n\nVTEX Shield\n\n---\n\n[Data Protection Plus](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/data-protection-plus)\n\n---\n\nWeni by VTEX\n\n---\n\n[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides)\n\n[Checkout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/checkout-api-overview)\n\n[Configuration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/configuration-section-api-quick-start-guides)\n\n[Updating an account orderForm configuration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/update-an-account-orderform-configuration)\n\nUpdate an account's orderForm configuration\n\nThe orderForm is the main object processed by VTEX checkout, and one of the most important data structures in the architecture of every VTEX store. It stores a lot of contextual information about the order which is important to the processing of the order: order items, client's personal data, delivery address, freight information, etc.\n\nThis guide will describe how to update settings applied currently to every orderForm in a specific account.\n\n> Always retrieve the current orderForm configuration before performing an update to ensure that you are modifying only the properties you want. Otherwise, old values can be overwritten. To get the current orderForm configuration for a specific account, check the [Get orderForm configuration developer's guide](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/api-reference/checkout-api%23get-/api/checkout/pvt/configuration/orderForm).\n\n## Updating an account's orderForm configuration\n\nTo update an account orderForm configuration, you need to use the [Update orderForm configuration](https://read.calvincode.net/reader?url=https://developers.vtex.com/vtex-rest-api/reference/updateorderformconfiguration) endpoint. In this request, you must send the `accountname` through the URL address, as shown by the example below:\n\n`https://{accountName}.{environment.com.br}/api/checkout/pvt/configuration/orderForm`\n\nAdditionally, you can submit the following information to modify your account's orderForm configuration:\n\n* `paymentConfiguration`: payment configuration information. \n * `requiresAuthenticationForPreAuthorizedPaymentOption`: determines whether pre-authorized payments require authentication. This field is mandatory and must be sent in all requests. \n * `allowInstallmentsMerge`: when in a multi-seller purchase scenario, it allows a flexible installment option that considers maximum installments for each seller, according to their respective configuration options. \n * `paymentSystemToCheckFirstInstallment`: option to apply a first installment discount to a particular payment system.\n* `taxConfiguration`: external tax service configuration information. \n * `url`: endpoint URL. \n * `authorizationHeader`: authorization header. \n * `appId`: custom data ID sent to the tax system.\n* `minimumQuantityAccumulatedForItems`: minimum SKU quantity by cart. This field is mandatory and must be sent in all requests.\n* `decimalDigitsPrecision`: number of price digits.\n* `minimumValueAccumulated`: minimum cart value.\n* `apps`: apps configuration information. \n * `fields`: app fields information. \n * `id`: app ID. \n * `major`: app major version.\n* `allowMultipleDeliveries`: allows the selection of items from several delivery channels in the same purchase.\n* `allowManualPrice`: allows the editing of SKU prices directly in the cart.\n* `savePersonalDataAsOptIn`: allows users to select whether they want the store to keep their personal and payment data saved.\n* `maxNumberOfWhiteLabelSellers`: allows the input of a limit of white label sellers involved on the cart.\n* `maskFirstPurchaseData`: allows, on a first purchase, masking client's data. It could be useful when a shared cart is used and the client doesn't want to share its data.\n* `recaptchaValidation`: configures reCAPTCHA validation status for the account.\n* `requiresLoginToPlaceOrder`: indicates whether authentication is required for completing purchases.\n* `minimumPurchaseDowntimeSeconds`: minimum interval (in seconds) between successive purchases.\n* `cartAgeToUseNewCardSeconds`: minimum cart existence period (in seconds) before allowing the use of a new credit card.\n\nSee a request body example below:\n\n`1\n\n{ \n\n2\n\n \"paymentConfiguration\": { \n\n3\n\n \"requiresAuthenticationForPreAuthorizedPaymentOption\": true \n\n4\n\n }, \n\n5\n\n \"recaptchaValidation\": \"vtexCriteria\", \n\n6\n\n \"minimumValueAccumulated\": 5, \n\n7\n\n \"maxNumberOfWhiteLabelSellers\": 2, \n\n8\n\n \"maskFirstPurchaseData\": false, \n\n9\n\n \"decimalDigitsPrecision\": 2, \n\n10\n\n \"minimumQuantityAccumulatedForItems\": 8, \n\n11\n\n \"requiresLoginToPlaceOrder\": true, \n\n12\n\n \"minimumPurchaseDowntimeSeconds\": 90, \n\n13\n\n \"cartAgeToUseNewCardSeconds\": 30, \n\n14\n\n \"apps\": [ \n\n15\n\n { \n\n16\n\n \"fields\": [ \n\n17\n\n \"gender\", \n\n18\n\n \"age\" \n\n19\n\n ], \n\n20\n\n \"id\": \"profile\", \n\n21\n\n \"major\": 1 \n\n22\n\n }, \n\n23\n\n { \n\n24\n\n \"fields\": [ \n\n25\n\n \"address\" \n\n26\n\n ], \n\n27\n\n \"id\": \"address\", \n\n28\n\n \"major\": 1 \n\n29\n\n } \n\n30\n\n ] \n\n31\n\n} \n\n`\n\nAfter sending the request, the endpoint will return `code 204 (No Content)` and an empty response body.\n\nTo confirm that the new orderForm settings have been applied to your account, access the [Get orderForm configuration](https://read.calvincode.net/reader?url=https://developers.vtex.com/vtex-rest-api/reference/getorderformconfiguration) endpoint again.\n\n## Error codes\n\nThe following errors may appear as a message in the response body.\n\n### 401 - Unauthorized\n\n* **Message error example (code ORD062)**: `\"Unauthorized\"`. The credentials (API key and API token) used in this request are incorrect or not authorized to access this type of information.\n\n`1\n\n{ \n\n2\n\n \"fields\": {}, \n\n3\n\n \"error\": { \n\n4\n\n \"code\": \"ORD062\", \n\n5\n\n \"message\": \"Unauthorized\", \n\n6\n\n \"exception\": null \n\n7\n\n }, \n\n8\n\n \"operationId\": \"8ec4b686-435f-42ab-8cfd-89306f888c3c\" \n\n9\n\n} \n\n`\n\n### 404 - Not Found\n\n* **Message error example**: `\"The requested URL was not found on the server\"`: check that the URL data is correct.\n\n`1\n\n<body> \n\n2\n\n <h1>404 Not Found</h1> \n\n3\n\n <p>The requested URL was not found on this server.</p> \n\n4\n\n</body> \n\n`\n\nContributors\n\n4\n\n[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F77292838%3Fv%3D4%26w=64%26q=75)](https://github.com/julia-rabello)\n\n[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F136460310%3Fv%3D4%26w=64%26q=75)](https://github.com/geisecosta)\n\n[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F87548049%3Fv%3D4%26w=64%26q=75)](https://github.com/ricardoaerobr)\n\n[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F60782333%3Fv%3D4%26w=64%26q=75)](https://github.com/carolinamenezes)\n\nWas this helpful?\n\nYes\n\nNo\n\n[Suggest Edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/Checkout/white-label-sellers-selection-algorithm/update-an-account-orderform-configuration.md)\n\n[Getting an account orderForm configuration« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration//docs/guides/get-an-account-orderform-configuration)[Get and update the seller exchange windowNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration//docs/guides/get-and-update-the-seller-exchange-window)\n\nContributors\n\n4\n\n[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F77292838%3Fv%3D4%26w=64%26q=75)](https://github.com/julia-rabello)\n\n[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F136460310%3Fv%3D4%26w=64%26q=75)](https://github.com/geisecosta)\n\n[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F87548049%3Fv%3D4%26w=64%26q=75)](https://github.com/ricardoaerobr)\n\n[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F60782333%3Fv%3D4%26w=64%26q=75)](https://github.com/carolinamenezes)\n\nON THIS PAGE\n\n[Updating an account's orderForm configuration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/update-an-account-orderform-configuration%23updating-an-accounts-orderform-configuration)\n\n[Error codes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/update-an-account-orderform-configuration%23error-codes)\n\n[401 - Unauthorized](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/update-an-account-orderform-configuration%23401-unauthorized)[404 - Not Found](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/update-an-account-orderform-configuration%23404-not-found)\n\nWas this helpful?\n\n Send feedback\n\n[Suggest edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/Checkout/white-label-sellers-selection-algorithm/update-an-account-orderform-configuration.md)\n\nCopy page\n\nOn this page\n\nON THIS PAGE\n\n[Updating an account's orderForm configuration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/update-an-account-orderform-configuration%23updating-an-accounts-orderform-configuration)\n\n[Error codes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/update-an-account-orderform-configuration%23error-codes)\n\n[401 - Unauthorized](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/update-an-account-orderform-configuration%23401-unauthorized)[404 - Not Found](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/update-an-account-orderform-configuration/docs/guides/update-an-account-orderform-configuration%23404-not-found)\n\nOn this page\n\n[Github](https://read.calvincode.net/reader?url=https://github.com/vtex-apps)[Help Center](https://read.calvincode.net/reader?url=https://help.vtex.com/)[Community](https://read.calvincode.net/reader?url=https://community.vtex.com/?%5Fga=2.198523433.743584735.1647618303-1974737580.1645714642)[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)", "role": "assistant" } ]
doc_f5a05d6c
[ { "content": "You are a VTEX documentation expert. You provide accurate, detailed information about VTEX platform, APIs, apps, and Store Framework development.", "role": "system" }, { "content": "How do I use apps vtexarg.speech to text?", "role": "user" }, { "content": "Documentation\n\n[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)\n\n[GuidesLearn how to use our APIs and extend the VTEX platform.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides)\n\n[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/api-reference)\n\n[App DevelopmentLearn how to build cloud-based apps and integrations.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/app-development)\n\n[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/storefront-development)\n\n[VTEX IO AppsFind pre-built solutions to grow your business.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/vtex-io-apps)\n\n[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/troubleshooting)\n\n[Release NotesStay up to date with our latest releases and bug fixes.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/updates/release-notes)\n\nVTEX IO Apps\n\n[Basic components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/basic-components)\n\n---\n\n[Store Components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/store-components)\n\n---\n\n[Advanced components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/advanced-components)\n\n---\n\n[B2B components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/b2b-components)\n\n---\n\n[B2B Suite](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/apps/vtex.b2b-suite)\n\n---\n\n[Functional Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/functional-apps)\n\n---\n\n[Layout Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/layout-apps)\n\n---\n\n[Pixel Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/pixel-apps)\n\n---\n\n[My Account - StoreV2 version](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/apps/vtex.my-account)\n\n---\n\n[VTEX IO deprecated apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/vtex-io-deprecated-apps)\n\n---\n\n[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides)\n\n[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/api-reference)\n\n[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/app-development)\n\n[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/storefront-development)\n\n[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/vtex-io-apps)\n\n[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/troubleshooting)\n\n---\n\n[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/updates/release-notes)\n\nVTEX IO Apps\n\n[Basic components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/basic-components)\n\n---\n\n[Store Components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/store-components)\n\n---\n\n[Advanced components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/advanced-components)\n\n---\n\n[B2B components](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/b2b-components)\n\n---\n\n[B2B Suite](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/apps/vtex.b2b-suite)\n\n---\n\n[Functional Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/functional-apps)\n\n---\n\n[Layout Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/layout-apps)\n\n---\n\n[Pixel Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/pixel-apps)\n\n---\n\n[My Account - StoreV2 version](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/apps/vtex.my-account)\n\n---\n\n[VTEX IO deprecated apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/guides/vtex-io-deprecated-apps)\n\n---\n\n[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/vtex-io-apps)\n\nSpeech to Text Search\n\nOfficial extension\n\nVersion: 1.0.10\n\nLatest version: 1.0.10\n\n[![{\"base64\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAIAAAB2XpiaAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAFUlEQVR4nGPg4+Mz1Nfjl5T7f2c+AAzxA3lptuDWAAAAAElFTkSuQmCC\",\"img\":{\"src\":\"https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square\",\"width\":110,\"height\":20,\"type\":\"svg\"}}](https://read.calvincode.net/reader?url=https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors-)\n\nThe `speech-to-text` app uses Google Chrome language processing to listen to the user's microphone and convert speech-to-text. The recognized text is then used to redirect the user to the corresponding search page.\n\n![{\"base64\":\" \",\"img\":{\"width\":640,\"height\":308,\"type\":\"gif\",\"mime\":\"image/gif\",\"wUnits\":\"px\",\"hUnits\":\"px\",\"length\":3758010,\"url\":\"https://user-images.githubusercontent.com/23383993/127346535-62a7546b-accd-468b-adfa-3495cabe64b9.gif\"}}](https://read.calvincode.net/reader?url=https://user-images.githubusercontent.com/23383993/127346535-62a7546b-accd-468b-adfa-3495cabe64b9.gif)\n\n## Configuration\n\n1. Add the `vtexarg.speech-to-text` app to your theme's **peer dependency** in the `manifest.json` file.\n2. Add the `text-speech` block to the desired theme template or inside another block. For example:\n\n`1\n\n \"flex-layout.col#text-speech\": \\{ \n\n2\n\n \"children\": [ \n\n3\n\n \"speech-to-text\" \n\n4\n\n ] \n\n5\n\n \\}, \n\n`\n\n1. Then, declare the `speech-to-text` block using the props stated in the [Props](#props) table. For example\n\n`1\n\n \"speech-to-text\": { \n\n2\n\n \"props\": { \n\n3\n\n \"lang\": \"es-ES\", \n\n4\n\n \"iconHeight\": \"20px\", \n\n5\n\n \"iconWidth\": \"20px\", \n\n6\n\n \"imgSrc\": \"https://upload.wikimedia.org/wikipedia/commons/a/a7/Font_Awesome_5_solid_microphone.svg\" \n\n7\n\n } \n\n8\n\n } \n\n`\n\n## Props\n\n| Prop name | Type | Description | Default value |\n| ---------- | ------ | ------------------------------------------- | ------------- |\n| lang | enum | Language used by the Google Chrome NLP API. | en-EN |\n| iconHeight | string | Icon height in px. | 20px |\n| iconWidth | string | Icon width in px. | 20px |\n| imgSrc | string | URL of the source image. | none |\n\n## Customization\n\nTo apply CSS customizations in this and other blocks, follow the [Using CSS handles for store customization](https://read.calvincode.net/reader?url=https://developers.vtex.com/vtex-developer-docs/docs/vtex-io-documentation-using-css-handles-for-store-customization) guide.\n\n| CSS Handles |\n| ---------------------------- |\n| audioSearchContainer |\n| audioSearchImg |\n| audioSearchImgRecordingState |\n\nSee also\n\n[VTEX App StoreVTEX IO Apps](https://read.calvincode.net/reader?url=https://apps.vtex.com/)\n\nON THIS PAGE\n\n[Configuration](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/apps/vtexarg.speech-to-text%23configuration)\n\n[Props](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/apps/vtexarg.speech-to-text%23props)\n\n[Customization](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/apps/vtexarg.speech-to-text/docs/apps/vtexarg.speech-to-text%23customization)\n\nWas this helpful?\n\n[Github](https://read.calvincode.net/reader?url=https://github.com/vtex-apps)[Help Center](https://read.calvincode.net/reader?url=https://help.vtex.com/)[Community](https://read.calvincode.net/reader?url=https://community.vtex.com/?%5Fga=2.198523433.743584735.1647618303-1974737580.1645714642)[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)", "role": "assistant" } ]
synthetic_store-icons_24_daeeb4fa
[ { "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. You provide detailed, accurate answers with working code examples.", "role": "system" }, { "content": "How do I use store-icons in a custom page template?", "role": "user" }, { "content": "Custom page templates use icons the same way as other pages—declare them in your page's blocks and reference them in the template.\n\n**Code Example:**\n\n```jsonc\n// store/blocks/custom-page.jsonc\n{\n \"store.custom#contact\": {\n \"blocks\": [\"contact-page-content\"]\n },\n \n \"contact-page-content\": {\n \"children\": [\n \"rich-text#contact-title\",\n \"flex-layout.row#contact-methods\"\n ]\n },\n \n \"flex-layout.row#contact-methods\": {\n \"children\": [\n \"flex-layout.col#phone\",\n \"flex-layout.col#email\",\n \"flex-layout.col#location\"\n ],\n \"props\": {\n \"colGap\": 8,\n \"horizontalAlign\": \"center\"\n }\n },\n \n \"flex-layout.col#phone\": {\n \"children\": [\n \"icon#phone\",\n \"rich-text#phone-label\",\n \"rich-text#phone-number\"\n ],\n \"props\": {\n \"horizontalAlign\": \"center\",\n \"rowGap\": 2\n }\n },\n \n \"icon#phone\": {\n \"props\": {\n \"id\": \"hpa-telemarketing\",\n \"size\": 48,\n \"blockClass\": \"contact-icon\"\n }\n },\n \n \"flex-layout.col#email\": {\n \"children\": [\n \"icon#email\",\n \"rich-text#email-label\"\n ],\n \"props\": {\n \"horizontalAlign\": \"center\",\n \"rowGap\": 2\n }\n },\n \n \"icon#email\": {\n \"props\": {\n \"id\": \"mpa-external-link--outline\",\n \"size\": 48,\n \"blockClass\": \"contact-icon\"\n }\n },\n \n \"flex-layout.col#location\": {\n \"children\": [\n \"icon-location-marker#contact\",\n \"rich-text#location-label\"\n ],\n \"props\": {\n \"horizontalAlign\": \"center\",\n \"rowGap\": 2\n }\n },\n \n \"icon-location-marker#contact\": {\n \"props\": {\n \"size\": 48,\n \"blockClass\": \"contact-icon\"\n }\n }\n}\n```\n\n```json\n// store/routes.json\n{\n \"store.custom#contact\": {\n \"path\": \"/contact\"\n }\n}\n```\n\n---", "role": "assistant" } ]
code_sku-list_0a5b62b6
[ { "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": "system" }, { "content": "Explain the code in sku-list/react/utils/generateImageConfig.ts.", "role": "user" }, { "content": "```typescript\nimport { changeImageUrlSize } from './generateUrl'\nimport { Image } from '../typings'\n\nconst thumbnailSize = 160\n\nexport default function generateImageConfig(image: Image) {\n return {\n imageUrl: image.imageUrl,\n thumbnailUrl: changeImageUrlSize(image.imageUrl, thumbnailSize),\n imageText: image.imageText,\n imageLabel: image.imageLabel,\n }\n}\n\n```", "role": "assistant" } ]
code_mycheckout-store-framework_469aa375
[ { "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": "system" }, { "content": "Explain the code in mycheckout-store-framework/react/admin/component/StyleSettings/utils.ts.", "role": "user" }, { "content": "The implementation is:\n\n```typescript\nimport type { AddButonStyleArgs } from './interfaces'\n\nexport const setStyles = (\n element: Element,\n styles: Array<{ name: string; value: string }>\n) => {\n let stylesToString = ''\n\n const lastStyles = element\n .getAttribute('style')\n ?.split(';')\n .map((elementStyle) => {\n const [name, value] = elementStyle?.split(':')\n\n return {\n name,\n value,\n }\n })\n\n styles.forEach(({ name, value }) => (stylesToString += `${name}:${value};`))\n\n lastStyles?.forEach(({ name, value }) => {\n const exist = !!styles?.find((style) => style.name === name)?.name\n\n if (!exist && name) {\n stylesToString += `${name}:${value};`\n }\n })\n\n element.setAttribute('style', stylesToString)\n}\n\nexport const setStylesButton = (\n element: Element,\n styles: AddButonStyleArgs\n) => {\n const {\n backgroundColor,\n borderRadius,\n outlineColor,\n textColor,\n font,\n width,\n } = styles\n\n const stylesArgs = [\n { name: 'background-color', value: backgroundColor },\n { name: 'border-radius', value: `${borderRadius}px` },\n { name: 'border', value: `solid 1px ${outlineColor}` },\n { name: 'color', value: textColor },\n { name: 'width', value: `${width}%` },\n ]\n\n if (font) stylesArgs.push({ name: 'font-family', value: font })\n if (borderRadius) {\n stylesArgs.push({\n name: 'border-radius',\n value: `${borderRadius}px`,\n })\n }\n\n setStyles(element, stylesArgs)\n}\n\nexport const addButtonEvent = (\n event: string,\n element: Element,\n styles: AddButonStyleArgs\n) => element.addEventListener(event, () => setStylesButton(element, styles))\n\n```", "role": "assistant" } ]
code_mycheckout-payments-service_0e1e1031
[ { "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": "system" }, { "content": "Show me the implementation of mycheckout-payments-service/nest-cli.json from mycheckout-payments-service.", "role": "user" }, { "content": "The implementation is:\n\n```json\n{\n \"collection\": \"@nestjs/schematics\",\n \"sourceRoot\": \"src\",\n \"compilerOptions\": {\n \"plugins\": [\"@nestjs/swagger\"]\n }\n}\n\n```", "role": "assistant" } ]
code_store-graphql_e0a02a43
[ { "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": "system" }, { "content": "Show me the resolver implementation for store-graphql.", "role": "user" }, { "content": "Here's how it works:\n\n```typescript\nimport { partition, propEq } from 'ramda'\n\nimport { getPositionInOrderForm } from './attachmentsHelper'\n\ninterface Params extends OrderFormItem {\n assemblyOptionsData: {\n childs: OrderFormItem[]\n index: number\n assemblyOptionsMap: Record<string, AssemblyOption[]>\n orderForm: OrderForm\n }\n}\n\nconst getPriceForItem = (\n children: OrderFormItem[],\n fatherIndex: number,\n fatherItem: OrderFormItem,\n orderForm: OrderForm\n): number => {\n const [itemChildren, others] = partition(\n propEq('parentItemIndex', fatherIndex),\n children\n )\n\n return itemChildren.reduce(\n (sum, currentChildren) =>\n sum +\n getPriceForItem(\n others,\n getPositionInOrderForm(orderForm, currentChildren),\n currentChildren,\n orderForm\n ),\n fatherItem.sellingPrice * fatherItem.quantity\n )\n}\n\nexport const resolvers = {\n OrderFormItem: {\n assemblyOptions: ({\n assemblyOptionsData: { childs, index, orderForm, assemblyOptionsMap },\n ...item\n }: Params) => ({ item, childs, index, orderForm, assemblyOptionsMap }),\n cartIndex: ({ assemblyOptionsData: { index } }: Params) => index,\n canHaveAttachment: ({ attachmentOfferings }: OrderFormItem) => {\n return attachmentOfferings && attachmentOfferings.length > 0\n },\n imageUrl: ({ imageUrl }: Params) =>\n imageUrl?.replace('http://', 'https://'),\n listPrice: ({ listPrice }: Params) => listPrice / 100,\n price: ({ price }: Params) => price / 100,\n sellingPrice: ({ sellingPrice }: Params) => sellingPrice / 100,\n sellingPriceWithAssemblies: ({\n assemblyOptionsData: { childs, index, orderForm },\n ...item\n }: Params) => {\n if (childs.length === 0) {\n return item.sellingPrice / 100\n }\n\n return (\n getPriceForItem(childs, index, item, orderForm) / item.quantity / 100\n )\n },\n },\n}\n\n```", "role": "assistant" } ]
code_facebook-pixel_8b2df5ef
[ { "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": "system" }, { "content": "Explain the code in facebook-pixel/react/typings/vtex.render-runtime.d.ts.", "role": "user" }, { "content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.render-runtime' {\n export const canUseDOM: boolean\n}\n\n```", "role": "assistant" } ]
code_store-on-localhost_515c0aae
[ { "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": "system" }, { "content": "Show me the implementation of store-on-localhost/src/monobloco/components/new/Footer/typings/css.d.ts from store-on-localhost.", "role": "user" }, { "content": "Here's the implementation:\n\n```typescript\ndeclare module '*.css' {\n const css: any\n export default css\n}\n\n```", "role": "assistant" } ]
code_minicart_96be97b7
[ { "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": "system" }, { "content": "How do I style components in minicart?", "role": "user" }, { "content": "The implementation is:\n\n```css\n.container {\n}\n.label {\n}\n.itemImage {\n}\n.item {\n}\n.itemContainer {\n}\n.itemDeleteIcon {\n}\n.itemDeleteIcon {\n}\n.itemDeleteIconLoader {\n}\n.content {\n}\n.contentDiscount {\n}\n.contentPrice {\n}\n.itemName {\n}\n.itemNameLarge {\n}\n.itemFooter {\n}\n.imgContainer {\n}\n.itemRemoveBtn {\n}\n.sidebarScrim {\n}\n.sidebarHeader {\n}\n\n.contentSmall {\n max-height: 383px;\n}\n\n.contentLarge {\n max-height: stretch;\n}\n\n.badge {\n top: -0.7rem;\n right: -0.8rem;\n}\n\n.arrowUp {\n right: 7px;\n}\n\n.box {\n width: 364px;\n top: 100%;\n}\n\n.itemImageLoader {\n width: 100%;\n height: 100%;\n}\n\n.contentFooter {\n}\n\n.footerSpacer {\n}\n\n.footerShippingPriceContainer {\n}\n\n.footerShippingPriceLabelContainer {\n}\n\n.popupContentContainer {\n}\n\n.popupChildrenContainer {\n}\n\n.sidebarRightCaretContainer {\n}\n\n.sidebarItemQuantityContainer {\n}\n\n.labelDiscountText{\n}\n\n@media only screen and (max-width: 40rem) {\n body.sidebarOpen {\n overflow: hidden;\n }\n}\n\n@media only screen and (min-width: 40em) {\n .sidebar {\n width: 340px;\n }\n}\n\n```", "role": "assistant" } ]
code_add-to-cart-button_2989c615
[ { "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": "system" }, { "content": "Show me the implementation of add-to-cart-button/store/contentSchemas.json from add-to-cart-button.", "role": "user" }, { "content": "Here's how it works:\n\n```json\n{\n \"definitions\": {\n \"AddToCardButton\": {\n \"title\": \"admin/editor.add-to-cart.title\",\n \"properties\": {\n \"text\": {\n \"title\": \"admin/editor.add-to-cart.text.title\",\n \"description\": \"admin/editor.add-to-cart.text.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\"\n },\n \"unavailableText\": {\n \"title\": \"admin/editor.add-to-cart.text-unavailable.title\",\n \"description\": \"admin/editor.add-to-cart.text-unavailable.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\"\n }\n }\n }\n }\n}\n\n```", "role": "assistant" } ]
code_b2cstoreqa.theme_9cfa7b9e
[ { "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": "system" }, { "content": "Explain the code in b2cstoreqa.theme/store/blocks/pages/landing-pages/gift-cards.jsonc.", "role": "user" }, { "content": "This is the code:\n\n```jsonc\n{\n \"store.custom#gift-cards\": {\n \"blocks\": [\n \"flex-layout.row#institutional--gift-cards\",\n \"flex-layout.row#newsletter\"\n ]\n },\n\n \"flex-layout.row#institutional--gift-cards\": {\n \"children\": [\"flex-layout.col#text--gift-cards\", \"image#mobile-phone\"]\n },\n\n \"flex-layout.col#text--gift-cards\": {\n \"children\": [\n \"rich-text#title--gift-cards\",\n \"rich-text#institutional-placeholder\"\n ],\n \"props\": {\n \"blockclass\": \"textColumn\",\n \"preventVerticalStretch\": true\n }\n },\n\n \"rich-text#title--gift-cards\": {\n \"props\": {\n \"text\": \"# Gift Cards\",\n \"blockClass\": \"title\"\n }\n }\n}\n\n```", "role": "assistant" } ]
code_breadcrumb_5994e953
[ { "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": "system" }, { "content": "Explain the code in breadcrumb/react/typings/css.d.ts.", "role": "user" }, { "content": "Here's how it works:\n\n```typescript\ndeclare module '*.css' {\n const css: any\n export default css\n}\n\n```", "role": "assistant" } ]
code_seller-financial-commission_756d6b6c
[ { "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": "system" }, { "content": "What GraphQL queries are available in seller-financial-commission?", "role": "user" }, { "content": "Here's the implementation:\n\n```graphql\nquery GET_TEMPLATE($variables: String) {\n getTemplate\n}\n\n```", "role": "assistant" } ]
code_training-week-demo_843cf729
[ { "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": "system" }, { "content": "Show me the CSS/SCSS implementation from training-week-demo.", "role": "user" }, { "content": "The implementation is:\n\n```css\nhtml,\nbody,\n#render-container,\n#render-provider,\n.render-container,\n.render-provider {\n height: 100%;\n}\n\n```", "role": "assistant" } ]
code_community_5fb2e64f
[ { "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": "system" }, { "content": "Show me the implementation of community/node-vtex-api/src/service/metrics/client.ts from community.", "role": "user" }, { "content": "Here's the implementation:\n\n```typescript\nimport { Types } from \"@vtex/diagnostics-nodejs\";\nimport { initializeTelemetry } from '../telemetry';\n\nclass MetricClientSingleton {\n private static instance: MetricClientSingleton | undefined;\n private client: Types.MetricClient | undefined;\n private initPromise: Promise<Types.MetricClient> | undefined;\n\n private constructor() {}\n\n public static getInstance(): MetricClientSingleton {\n if (!MetricClientSingleton.instance) {\n MetricClientSingleton.instance = new MetricClientSingleton();\n }\n return MetricClientSingleton.instance;\n }\n\n public async getClient(): Promise<Types.MetricClient> {\n if (this.client) {\n return this.client;\n }\n\n if (this.initPromise) {\n return this.initPromise;\n }\n\n this.initPromise = this.initializeClient();\n\n return this.initPromise;\n }\n\n private async initializeClient(): Promise<Types.MetricClient> {\n try {\n const { metricsClient } = await initializeTelemetry();\n this.client = metricsClient;\n this.initPromise = undefined;\n return metricsClient;\n } catch (error) {\n console.error('Failed to initialize metrics client:', error);\n this.initPromise = undefined;\n throw error;\n }\n }\n}\n\nexport const getMetricClient = () => MetricClientSingleton.getInstance().getClient();\n\n```", "role": "assistant" } ]
code_order-placed_4b631eae
[ { "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": "system" }, { "content": "What props does Order Number.Test accept and how do I configure them?", "role": "user" }, { "content": "The implementation is:\n\n```tsx\nimport React from 'react'\n\nimport { orderGroupQuery as oneDelivery } from '../mocks/oneDeliverySimple'\nimport { renderWithOrder } from '../utils/testUtils'\nimport OrderNumber from '../OrderNumber'\n\ntest('should render correct order number', () => {\n const { getByText } = renderWithOrder(oneDelivery.orderGroup, <OrderNumber />)\n\n const orderId = 'Order #905691102273-01'\n\n expect(getByText(orderId)).toBeTruthy()\n})\n\n```", "role": "assistant" } ]
code_affirm-components_4cc48b40
[ { "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": "system" }, { "content": "What npm dependencies does affirm-components use?", "role": "user" }, { "content": "Here's the package config:\n\n```json\n{\n \"name\": \"affirm-components\",\n \"version\": \"0.0.9\",\n \"description\": \"\",\n \"scripts\": {\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n },\n \"author\": \"VTEX\",\n \"license\": \"UNLICENSED\",\n \"dependencies\": {\n \"apollo-cache\": \"^1.3.4\",\n \"apollo-client\": \"^2.6.8\",\n \"apollo-link\": \"^1.2.13\",\n \"apollo-utilities\": \"^1.3.3\",\n \"graphql\": \"^14.0.2\",\n \"ramda\": \"^0.27.0\",\n \"react\": \"^16.8.6\",\n \"react-apollo\": \"^3.1.3\",\n \"react-dom\": \"^16.8.5\"\n },\n \"devDependencies\": {\n \"@types/bootstrap\": \"^4.3.0\",\n \"@types/graphql\": \"^14.0.5\",\n \"@types/jquery\": \"^3.3.34\",\n \"@types/node\": \"^10.14.4\",\n \"@types/ramda\": \"^0.27.0\",\n \"@types/react\": \"^16.8.8\",\n \"@types/react-dom\": \"^16.8.3\",\n \"vtex.affirm-components\": \"https://betocheckout--sandboxusdev.myvtex.com/_v/private/typings/linked/v1/[email protected]+build1644630177/public/@types/vtex.affirm-components\",\n \"vtex.affirm-payment\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.affirm-payment\",\n \"vtex.css-handles\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.css-handles\",\n \"vtex.product-context\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.product-context\",\n \"vtex.product-summary-context\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.product-summary-context\",\n \"vtex.product-teaser-interfaces\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/_types/react\",\n \"vtex.render-runtime\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.render-runtime\",\n \"vtex.store\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.store\"\n }\n}\n\n```", "role": "assistant" } ]
code_shipping-option-components_429629fc
[ { "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": "system" }, { "content": "What props does Pickup Modal accept and how do I configure them?", "role": "user" }, { "content": "```tsx\nimport React from 'react'\nimport { useIntl } from 'react-intl'\n\nimport Modal from './Modal'\nimport messages from '../messages'\nimport PickupSelection from './PickupSelection'\n\ninterface Props {\n isOpen: boolean\n onClose: () => void\n pickupProps: React.ComponentProps<typeof PickupSelection>\n}\n\nconst PickupModal = ({ isOpen, onClose, pickupProps }: Props) => {\n const intl = useIntl()\n\n const {\n onSelectPickup,\n onSubmit,\n pickups,\n inputErrorMessage,\n selectedPickup,\n selectedZipcode,\n isLoading,\n } = pickupProps\n\n return (\n <Modal\n showArrowBack={false}\n isTopCloseButton={false}\n title={intl.formatMessage(messages.deliverToButtonPlaceholder)}\n isOpen={isOpen}\n onClose={onClose}\n >\n <PickupSelection\n onSelectPickup={onSelectPickup}\n onSubmit={onSubmit}\n pickups={pickups}\n inputErrorMessage={inputErrorMessage}\n selectedPickup={selectedPickup}\n selectedZipcode={selectedZipcode}\n isLoading={isLoading}\n />\n </Modal>\n )\n}\n\nexport default PickupModal\n\n```", "role": "assistant" } ]
code_admin-pages_0b8652ac
[ { "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": "system" }, { "content": "Show me the implementation of admin-pages/react/utils/conditions/typings.d.ts from admin-pages.", "role": "user" }, { "content": "Here's the implementation:\n\n```typescript\nexport interface DateInfo {\n date?: Date\n from?: Date\n to?: Date\n}\n\nexport type DateVerbOptions = 'between' | 'from' | 'is' | 'to'\n\n```", "role": "assistant" } ]
code_2performant_a5de99b2
[ { "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": "system" }, { "content": "Explain the code in 2performant/public/metadata/messages/es-AR.json.", "role": "user" }, { "content": "Here's the implementation:\n\n```json\n{\n\"name\": \"2Performant Tracking Code\",\n\"headline\": \"Integración de la plataforma de afiliación de marketing 2Performant\",\n\"overview\": \"2Performant es la principal plataforma de marketing de afiliados e influencers de Rumanía y una de las mayores plataformas de este tipo en Europa del Este. Al usar esta plataforma, las empresas pueden conectarse con socios, afiliados y personas influyentes para promocionar sus productos y promociones a un público más amplio. Esta aplicación de píxeles le permite agregar el código de seguimiento 2Performant a su tienda.\",\n\"features\": [\n\"Permite la integración del código de seguimiento 2Performant con su tienda VTEX\",\n\"Facilita el seguimiento de tus campañas de marketing de afiliación\",\n\"Junto con la aplicación Export Feeds, facilita el listado de sus productos en la plataforma 2Performant\"\n],\n\"additionalInformation\": \"Esta aplicación requiere una cuenta www.2performant.com válida.\\\\n\\\\nTenga en cuenta que la aplicación de píxeles de 2Performant no exportará su feed de productos a la plataforma de 2Performant. Para hacer eso, debe usar la aplicación Export Feeds.\",\n\"websiteURL\": \"https://www.2performant.com\",\n\"support\": {\n\"url\": \"https://support.vtex.com/hc/requests\"\n}\n}\n```", "role": "assistant" } ]
code_community_daa774d3
[ { "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": "system" }, { "content": "How do I use community?", "role": "user" }, { "content": "This is the code:\n\n```markdown\n## Aprenda a construir apps administrativas usando o Admin Framework\n\nNeste curso vamos aprender como construir aplicações para extender o admin nativo da VTEX para enriquecer a operação de uma loja. Com ele você verá como construir criar a extensão, enriquecer a navegação, manter a identidade visual e, por fim, conectar a aplicação a um serviço.\n\n \n```", "role": "assistant" } ]
code_shopper-location-theme_77560976
[ { "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": "system" }, { "content": "Explain the code in shopper-location-theme/store/blocks/product-summary/product-summary-list.jsonc.", "role": "user" }, { "content": "Here's how it works:\n\n```jsonc\n{\n \"product-summary.shelf#listLayout\": {\n \"props\": {\n \"blockClass\": \"listLayout\"\n },\n \"children\": [\n \"responsive-layout.desktop#productSummaryList\",\n \"responsive-layout.mobile#productSummaryList\"\n ]\n },\n \"responsive-layout.desktop#productSummaryList\": {\n \"children\": [\n \"flex-layout.row#summaryListDesktop\"\n ]\n },\n \"responsive-layout.mobile#productSummaryList\": {\n \"children\": [\n \"flex-layout.row#summaryListMobile\"\n ]\n },\n \"product-price-savings#summaryPercentage\": {\n \"props\": {\n \"message\": \"{savingsPercentage}\",\n \"blockClass\": \"summaryPercentage\"\n }\n },\n \"flex-layout.row#savingsSummaryListDesktop\": {\n \"props\": {\n \"colSizing\": \"auto\",\n \"colGap\": 3,\n \"blockClass\": \"savingsSummaryListDesktop\"\n },\n \"children\": [\n \"product-price-savings#summaryPercentage\",\n \"product-price-savings#summary\"\n ]\n },\n \"flex-layout.row#summaryListDesktop\": {\n \"props\":{\n \"fullWidth\": true,\n \"colSizing\": \"auto\",\n \"blockClass\": \"summaryListDesktop\"\n },\n \"children\": [\n \"flex-layout.row#summaryLeftListDesktop\",\n \"flex-layout.col#summaryRightListDesktop\"\n ]\n },\n \"flex-layout.row#summaryLeftListDesktop\": {\n \"props\": {\n \"blockClass\": \"summaryLeftListDesktop\",\n \"colSizing\": \"auto\",\n \"colGap\": 7\n },\n \"children\": [\n \"stack-layout#summaryListDesktop\",\n \"flex-layout.col#summaryDetailsListDesktop\"\n ]\n },\n \"flex-layout.col#summaryDetailsListDesktop\": {\n \"props\": {\n \"preventVerticalStretch\": true\n },\n \"children\": [\n \"vtex.store-components:product-brand#summaryListDesktop\",\n \"product-summary-name#summaryListDesktop\",\n \"flex-layout.col#productRating\",\n \"flex-layout.row#productSpecifications\"\n ]\n },\n \"flex-layout.row#productSpecifications\": {\n \"children\": [\n \"product-specification-group#summary\"\n ]\n },\n \"product-summary-name#summaryListDesktop\": {\n \"props\": {\n \"blockClass\": \"summaryListDesktop\"\n }\n },\n \"vtex.store-components:product-brand#summaryListDesktop\": {\n \"props\": {\n \"displayMode\": \"text\",\n \"blockClass\": \"summaryListDesktop\"\n }\n },\n \"flex-layout.col#summaryRightListDesktop\": {\n \"props\": {\n \"blockClass\": \"summaryRightListDesktop\",\n \"preventVerticalStretch\": true\n },\n \"children\": [\n \"flex-layout.row#savingsSummaryListDesktop\",\n \"flex-layout.col#priceSummaryListDesktop\",\n \"flex-layout.row#buyButtonsSummaryListDesktop\"\n ]\n },\n \"flex-layout.row#buyButtonsSummaryListDesktop\": {\n \"props\": {\n \"colSizing\": \"auto\",\n \"colGap\": 5\n },\n \"children\": [\n \"add-to-cart-button\",\n \"flex-layout.row#buyNowButton\"\n ]\n },\n \"flex-layout.row#buyNowButton\": {\n \"props\": {\n \"blockClass\": \"buyNowButton\"\n },\n \"children\": [\n \"add-to-cart-button#buyNow\"\n ]\n },\n\n \"add-to-cart-button#buyNow\": {\n \"props\": {\n \"text\": \"BUY NOW\",\n \"isOneClickBuy\": true,\n \"onClickEventPropagation\": \"enabled\",\n \"blockClass\": \"buyNow\"\n }\n },\n \"flex-layout.col#priceSummaryListDesktop\": {\n \"children\": [\n \"product-selling-price#summary\",\n \"product-list-price#summary\"\n ]\n },\n \"stack-layout#summaryListDesktop\": {\n \"children\": [\n \"product-summary-image#summaryListDesktop\",\n \"[email protected]:product-highlights#collection\",\n \"modal-trigger#quickview\" // Check quickview.jsonc\n ]\n },\n \"product-summary-image#summaryListDesktop\": {\n \"props\": {\n \"showBadge\": false,\n \"aspectRatio\": \"1:1\",\n \"maxHeight\": 180,\n \"blockClass\": \"summaryListDesktop\"\n }\n },\n \"flex-layout.row#summaryListMobile\": {\n \"props\":{\n \"preserveLayoutOnMobile\": true,\n \"colSizing\": \"auto\",\n \"blockClass\": \"summaryListMobile\",\n \"colGap\": 5\n },\n \"children\": [\n \"stack-layout#summaryListMobile\",\n \"flex-layout.col#summaryDetailsListMobile\"\n ]\n },\n \"stack-layout#summaryListMobile\": {\n \"children\": [\n \"product-summary-image#summaryListMobile\",\n \"[email protected]:product-highlights#collection\",\n \"modal-trigger#quickview\" // Check quickview.jsonc\n ]\n },\n \"product-summary-image#summaryListMobile\": {\n \"props\": {\n \"showBadge\": false,\n \"aspectRatio\": \"1:1\",\n \"maxHeight\": 220,\n \"blockClass\": \"summaryListMobile\"\n }\n },\n \"flex-layout.col#summaryDetailsListMobile\": {\n \"props\": {\n \"preventVerticalStretch\": true,\n \"width\": \"grow\",\n \"blockClass\": \"summaryDetailsListMobile\"\n },\n \"children\": [\n \"flex-layout.col#summaryUpDetailsListMobile\",\n \"flex-layout.col#summaryDownDetailsListMobile\"\n ]\n },\n \"flex-layout.col#summaryUpDetailsListMobile\": {\n \"props\": {\n \"preventVerticalStretch\": true,\n \"blockClass\": \"summaryUpDetailsListMobile\"\n },\n \"children\": [\n \"vtex.store-components:product-brand#summaryListMobile\",\n \"product-summary-name#summaryListMobile\",\n \"product-rating-inline\"\n ]\n },\n \"flex-layout.col#summaryDownDetailsListMobile\": {\n \"props\": {\n \"preventVerticalStretch\": true\n },\n \"children\": [\n \"product-selling-price#summary\",\n \"product-installments#summary\"\n ]\n },\n \"vtex.store-components:product-brand#summaryListMobile\": {\n \"props\": {\n \"displayMode\": \"text\",\n \"blockClass\": \"summaryListMobile\"\n }\n },\n \"product-summary-name#summaryListMobile\": {\n \"props\": {\n \"tag\": \"div\",\n \"blockClass\": \"summaryListMobile\"\n }\n }\n}\n\n```", "role": "assistant" } ]
code_admin-pages_482aae40
[ { "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": "system" }, { "content": "How do I implement the Multi Select component in my VTEX store?", "role": "user" }, { "content": "```tsx\nimport React, { Fragment } from 'react'\nimport ReactSelect, { Option } from 'react-select'\n\ninterface Props {\n disabled?: boolean\n id?: string\n label?: string\n onChange: (newValue: string[]) => void\n options: {\n enumOptions: Option[]\n }\n placeholder: string\n schema?: {\n disabled?: boolean\n title: string\n }\n value: string[]\n}\n\nconst MultiSelect: React.FunctionComponent<Props> = ({\n disabled,\n id,\n label,\n onChange,\n options: { enumOptions },\n placeholder,\n schema,\n value,\n}) => (\n <Fragment>\n {(label || (schema && schema.title)) && (\n <label htmlFor={id}>\n <span className=\"dib mb3 w-100\">\n <span>{label || (schema && schema.title)}</span>\n </span>\n </label>\n )}\n <ReactSelect\n disabled={\n disabled || (schema && schema.disabled) || enumOptions.length === 0\n }\n id={id}\n multi\n onChange={optionValues => {\n const formattedValue = (optionValues as Option[]).map(\n (item: Option) => item.value as string\n )\n onChange(formattedValue)\n }}\n options={enumOptions}\n placeholder={placeholder}\n value={value}\n />\n </Fragment>\n)\n\nMultiSelect.defaultProps = {\n disabled: false,\n placeholder: '',\n value: [],\n}\n\nexport default MultiSelect\n\n```", "role": "assistant" } ]
code_cross-device-cart_24a46ec4
[ { "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": "system" }, { "content": "How do I implement a Node.js service in VTEX IO like cross-device-cart?", "role": "user" }, { "content": "The implementation is:\n\n```typescript\nimport type { InstanceOptions, IOContext, RequestConfig } from '@vtex/api'\nimport { JanusClient } from '@vtex/api'\n\nimport { statusToError } from '../utils'\n\nexport default class RequestHub extends JanusClient {\n constructor(context: IOContext, options?: InstanceOptions) {\n super(context, {\n ...options,\n headers: {\n ...options?.headers,\n VtexIdclientAutCookie:\n context.storeUserAuthToken ?? context.adminUserAuthToken ?? '',\n },\n })\n }\n\n /**\n * This request removes all items from a given cart, leaving it empty\n *\n * @func clearCart\n * @public\n * @param {string} orderFormId OrderForm ID\n * @see {@link https://developers.vtex.com/vtex-rest-api/reference/shopping-cart#removeallitems-1}\n */\n public clearCart = (orderFormId: string) =>\n this.post(this.routes.clearCart(orderFormId), {})\n\n protected get = <T>(url: string, config: RequestConfig = {}) => {\n config.headers = {\n ...config.headers,\n }\n\n return this.http\n .get<T>(url, config)\n .catch((err) => statusToError(err)) as Promise<T>\n }\n\n protected post = async <T>(\n url: string,\n data?: any,\n config: RequestConfig = {}\n ) => {\n config.headers = {\n ...config.headers,\n }\n\n return this.http\n .post<T>(url, data, config)\n .catch((err) => statusToError(err)) as Promise<T>\n }\n\n private get routes() {\n return {\n clearCart: (orderFormId: string) =>\n `/api/checkout/pub/orderForm/${orderFormId}/items/removeAll`,\n }\n }\n}\n\n```", "role": "assistant" } ]
code_order-details_6cfdd656
[ { "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": "system" }, { "content": "What props does Info accept and how do I configure them?", "role": "user" }, { "content": "```tsx\nimport React, { FunctionComponent } from 'react'\n\nimport { baseClassname } from './utils'\n\nconst InfoIcon: FunctionComponent<{ colorToken: string }> = ({\n colorToken,\n}) => (\n <svg\n className={`${baseClassname('info')} ${colorToken ? colorToken : ''}`}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M8 0C3.6 0 0 3.6 0 8C0 12.4 3.6 16 8 16C12.4 16 16 12.4 16 8C16 3.6 12.4 0 8 0ZM9 12H7V7H9V12ZM8 6C7.4 6 7 5.6 7 5C7 4.4 7.4 4 8 4C8.6 4 9 4.4 9 5C9 5.6 8.6 6 8 6Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nexport default InfoIcon\n\n```", "role": "assistant" } ]
code_shelf_f35f8186
[ { "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": "system" }, { "content": "Show me the implementation of shelf/react/Shelf.js from shelf.", "role": "user" }, { "content": "```javascript\nimport PropTypes from 'prop-types'\nimport React, { useMemo } from 'react'\nimport { graphql } from 'react-apollo'\nimport { Loading, useTreePath } from 'vtex.render-runtime'\nimport { useDevice } from 'vtex.device-detector'\nimport { useCssHandles } from 'vtex.css-handles'\nimport { ProductListContext } from 'vtex.product-list-context'\n\nimport OrdenationTypes, { getOrdenationValues } from './utils/OrdenationTypes'\nimport ProductList from './components/ProductList'\nimport {\n productListSchemaPropTypes,\n shelfContentPropTypes,\n} from './utils/propTypes'\nimport productsQuery from './queries/productsQuery.gql'\nimport { normalizeBuyable } from './utils/normalize'\n\nconst CSS_HANDLES = ['container']\n\nconst { ProductListProvider } = ProductListContext\n\n/**\n * Shelf Component. Queries a list of products and shows them.\n */\nconst Shelf = props => {\n const {\n data,\n paginationDotsVisibility = 'visible',\n maxItems,\n productList = ProductList.defaultProps,\n } = props\n let { trackingId } = props\n const treePath = useTreePath()\n const handles = useCssHandles(CSS_HANDLES)\n const { isMobile } = useDevice()\n const { loading, error, products } = data || {}\n if (!trackingId) {\n // Taking the block name to pass to listName if no trackingId is passed\n const treePathList =\n (typeof treePath === 'string' && treePath.split()) || []\n trackingId = treePathList[treePathList.length - 1] || 'List of products'\n }\n\n const filteredProducts = useMemo(() => {\n return products && products.map(normalizeBuyable).filter(Boolean)\n }, [products])\n\n const productListProps = {\n ...productList,\n maxItems,\n isMobile,\n loading,\n paginationDotsVisibility,\n products: filteredProducts,\n trackingId,\n }\n\n if (loading) {\n return <Loading />\n }\n\n if (error) {\n return null\n }\n\n return (\n <div className={`${handles.container} pv4 pb9`}>\n <ProductListProvider listName={trackingId}>\n <ProductList {...productListProps} />\n </ProductListProvider>\n </div>\n )\n}\n\nShelf.propTypes = {\n /** Graphql data response. */\n data: PropTypes.shape({\n products: shelfContentPropTypes.products,\n }),\n /** Category Id. */\n category: PropTypes.string,\n /** Collection Id. */\n collection: PropTypes.string,\n /** Ordenation Type. */\n orderBy: PropTypes.oneOf(getOrdenationValues()),\n /** Hide unavailable items */\n hideUnavailableItems: PropTypes.bool,\n /** Should display navigation dots below the Shelf */\n paginationDotsVisibility: PropTypes.oneOf([\n 'visible',\n 'hidden',\n 'mobileOnly',\n 'desktopOnly',\n ]),\n /** ProductList schema configuration */\n productList: PropTypes.shape(productListSchemaPropTypes),\n trackingId: PropTypes.string,\n maxItems: PropTypes.number,\n}\n\nconst parseFilters = ({ id, value }) => `specificationFilter_${id}:${value}`\n\nconst toBoolean = x => (typeof x === 'boolean' ? x : x === 'true')\n\nconst options = {\n options: ({\n category,\n collection,\n hideUnavailableItems,\n orderBy = OrdenationTypes.ORDER_BY_TOP_SALE_DESC.value,\n specificationFilters = [],\n maxItems = ProductList.defaultProps.maxItems,\n skusFilter,\n }) => ({\n ssr: true,\n variables: {\n ...(category && { category: category.toString() }),\n ...(collection && { collection: collection.toString() }),\n specificationFilters: specificationFilters.map(parseFilters),\n orderBy,\n from: 0,\n to: maxItems - 1,\n hideUnavailableItems: toBoolean(hideUnavailableItems),\n skusFilter,\n },\n }),\n}\n\nconst EnhancedShelf = graphql(productsQuery, options)(Shelf)\n\nEnhancedShelf.schema = {\n title: 'admin/editor.shelf.title',\n}\n\nexport default EnhancedShelf\n\n```", "role": "assistant" } ]
code_tab-layout_6c44ed91
[ { "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": "system" }, { "content": "Explain the code in tab-layout/messages/pt.json.", "role": "user" }, { "content": "Here's the source code:\n\n```json\n{\n \"admin/editor.tabLayout.title\": \"Tab Layout\",\n \"admin/editor.tabLayout.description\": \"Container for tabbed layout structure\",\n \"admin/editor.tabList.title\": \"Tab List\",\n \"admin/editor.tabList.description\": \"Container for tab buttons\",\n \"admin/editor.tabListItem.title\": \"Tab List Item\",\n \"admin/editor.tabListItem.label\": \"Título da aba\",\n \"admin/editor.tabListItem.description\": \"Button with a tabId and label to control visibility of a matching Tab Content Item\",\n \"admin/editor.tabContent.title\": \"Tab Content\",\n \"admin/editor.tabContent.description\": \"Container for the tab panes\",\n \"admin/editor.tabContentItem.title\": \"Tab Content Item\",\n \"admin/editor.tabContentItem.description\": \"A content area which will be shown or hidden depending on which tab is active\"\n}\n```", "role": "assistant" } ]
code_b2b-supplier_c80d092d
[ { "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": "system" }, { "content": "Show me the implementation of b2b-supplier/messages/ko.json from b2b-supplier.", "role": "user" }, { "content": "Here's how it works:\n\n```json\n{\n \"store/b2b-approved-message.message\": \"귀하의 조직은 현재 이 스토어에서 주문하도록 승인되지 않았습니다. 한동안 이러다가 실수라고 생각되시면 연락주세요.\",\n \"store/b2b-auth.signup\": \"등록\",\n \"store/b2b-supplier.creating-buyer-org\": \"공급자에서 구매자 조직 생성\"\n}\n\n```", "role": "assistant" } ]
code_product-comparison_5c0e14d5
[ { "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": "system" }, { "content": "Explain the code in product-comparison/react/components/utils/fieldUtils.ts.", "role": "user" }, { "content": "This is the code:\n\n```typescript\nimport { split, trim, without } from 'ramda'\n\nexport const splitString = (text?: string) => {\n if (!(text && text.length > 0)) {\n return []\n }\n\n return split(',', text)\n .filter((str) => str !== null && str !== '')\n .map((str) => trim(str))\n}\n\nexport const getProductSpecificationFields = (\n existing: string[],\n fieldsToHide?: string\n) => {\n const removeList = splitString(fieldsToHide)\n\n return without(removeList, existing)\n}\n\nexport const getSkuSpecificationFields = (\n existing: string[],\n fieldsToHide?: string\n) => {\n const removeList = splitString(fieldsToHide)\n\n return without(removeList, existing)\n}\n\nexport const getProductFields = (fieldsToHide?: string) => {\n const fieldNames = ['productName', 'brand', 'description', 'productReference']\n const removeList = splitString(fieldsToHide)\n const fieldsSelected = without(removeList, fieldNames)\n\n const fields = fieldsSelected.map((fieldName) => {\n let value = {}\n\n switch (fieldName) {\n case 'productName':\n value = {\n fieldType: 'ProductField',\n name: 'productName',\n displayValue: 'Product Name',\n showOnSite: true,\n }\n break\n\n case 'brand':\n value = {\n fieldType: 'ProductField',\n name: 'brand',\n displayValue: 'Brand',\n showOnSite: true,\n }\n break\n\n case 'description':\n value = {\n fieldType: 'ProductField',\n name: 'description',\n displayValue: 'Product Description',\n showOnSite: true,\n }\n break\n\n case 'productReference':\n value = {\n fieldType: 'ProductField',\n name: 'productReference',\n displayValue: 'Product Reference',\n showOnSite: true,\n }\n break\n\n default:\n value = {\n fieldType: '',\n name: '',\n displayValue: '',\n showOnSite: false,\n }\n break\n }\n\n return value as ComparisonField\n })\n\n return fields\n}\n\nexport const getSkuFields = (fieldsToHide?: string) => {\n const fieldNames = ['name', 'ean']\n const removeList = splitString(fieldsToHide)\n const fieldsSelected = without(removeList, fieldNames)\n\n const fields = fieldsSelected.map((fieldName) => {\n let value = {}\n\n switch (fieldName) {\n case 'name':\n value = {\n fieldType: 'SkuField',\n name: 'name',\n displayValue: 'Sku Name',\n showOnSite: true,\n }\n break\n\n case 'ean':\n value = {\n fieldType: 'SkuField',\n name: 'ean',\n displayValue: 'Ean',\n showOnSite: true,\n }\n break\n\n default:\n value = {\n fieldType: '',\n name: '',\n displayValue: '',\n showOnSite: false,\n }\n break\n }\n\n return value as ComparisonField\n })\n\n return fields\n}\n\n```", "role": "assistant" } ]
code_product-availability_6bdf5347
[ { "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": "system" }, { "content": "How do I implement the High Stock component in my VTEX store?", "role": "user" }, { "content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\n\nimport { useContextCssHandles } from './CssHandlesContext'\n\ninterface Props {\n text: string\n}\n\nfunction HighStock({ text }: Props) {\n const { handles } = useContextCssHandles()\n\n return (\n <span className={`${handles.highStockText} c-muted-2 t-body`}>{text}</span>\n )\n}\n\nexport default HighStock\n\n```", "role": "assistant" } ]
code_store-on-localhost_3e010bdc
[ { "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": "system" }, { "content": "Explain the code in store-on-localhost/src/monobloco/components/new/Styleguide/components/icon/Failure/index.js.", "role": "user" }, { "content": "This is the code:\n\n```javascript\nimport React, { PureComponent } from 'react'\nimport PropTypes from 'prop-types'\n\nimport { Svg } from '../IconBase'\nimport { calcIconSize } from '../utils'\n\nconst iconBase = {\n width: 16,\n height: 16,\n}\n\nclass Failure extends PureComponent {\n render() {\n const { color, size, solid, block } = this.props\n const newSize = calcIconSize(iconBase, size)\n\n return (\n <Svg\n name=\"failure\"\n variation={solid ? 'solid' : null}\n size={newSize}\n block={block}>\n {solid ? (\n <path\n d=\"M8 0C3.6 0 0 3.6 0 8C0 12.4 3.6 16 8 16C12.4 16 16 12.4 16 8C16 3.6 12.4 0 8 0ZM11.5 10.1L10.1 11.5L8 9.4L5.9 11.5L4.5 10.1L6.6 8L4.5 5.9L5.9 4.5L8 6.6L10.1 4.5L11.5 5.9L9.4 8L11.5 10.1Z\"\n fill={color}\n />\n ) : (\n <>\n <path\n d=\"M5.6 0L3.5 2.1L1.4 0L0 1.4L2.1 3.5L0 5.6L1.4 7L3.5 4.9L5.6 7L7 5.6L4.9 3.5L7 1.4L5.6 0Z\"\n transform=\"translate(4.5 4.5)\"\n fill={color}\n />\n <path\n d=\"M8 0C3.6 0 0 3.6 0 8C0 12.4 3.6 16 8 16C12.4 16 16 12.4 16 8C16 3.6 12.4 0 8 0ZM8 14C4.7 14 2 11.3 2 8C2 4.7 4.7 2 8 2C11.3 2 14 4.7 14 8C14 11.3 11.3 14 8 14Z\"\n fill={color}\n />\n </>\n )}\n </Svg>\n )\n }\n}\n\nFailure.defaultProps = {\n color: 'currentColor',\n size: 16,\n solid: false,\n block: false,\n}\n\nFailure.propTypes = {\n color: PropTypes.string,\n size: PropTypes.number,\n solid: PropTypes.bool,\n block: PropTypes.bool,\n}\n\nexport default Failure\n\n```", "role": "assistant" } ]
code_shipment-tracker_4bd1eb45
[ { "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": "system" }, { "content": "How do I implement a Node.js service in VTEX IO like shipment-tracker?", "role": "user" }, { "content": "Here's how it works:\n\n```typescript\ninterface CreateSchedulerArgs {\n id: string\n scheduler: { expression: string; endDate: string }\n request: {\n uri: string\n method: string\n }\n}\n\ninterface ViewSchedulerResponse {\n id: string\n expression: string\n NextExecution: string\n endDate: string\n lastInteractionIn: string\n request: {\n uri: string\n method: string\n }\n}\n\ninterface ViewSchedulerGraphQL {\n nextExecution: string\n lastInteractionIn: string\n}\n\ninterface ViewSchedule {\n id: string\n expression: string\n NextExecution: string\n endDate: string\n lastInteractionIn: string\n}\n\ninterface CreateSchedulerResponse {\n endpoint: string\n nextExecution: string\n}\n\n```", "role": "assistant" } ]
code_my-account_5a39e643
[ { "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": "system" }, { "content": "What props does Profile Edit accept and how do I configure them?", "role": "user" }, { "content": "```tsx\nimport React, { Component } from 'react'\nimport { graphql } from 'react-apollo'\nimport { compose, branch, renderComponent, withProps } from 'recompose'\nimport { withRouter } from 'vtex.my-account-commons/Router'\n\nimport { withContentWrapper } from '../shared/withContentWrapper'\nimport ProfileEditLoading from '../loaders/ProfileEditLoading'\nimport ProfileFormBox from '../Profile/ProfileFormBox'\nimport GET_PROFILE from '../../graphql/getProfile.gql'\n\nexport const headerConfig = {\n titleId: '[email protected]::pages.profileEdit',\n backButton: {\n titleId: '[email protected]::pages.profile',\n path: '/profile',\n },\n}\n\nclass ProfileEdit extends Component<Props> {\n private handleGoBack = () => {\n this.props.history.push('/profile?success=true')\n }\n\n public render() {\n const { profile, handleError, blockDocument } = this.props\n\n return (\n <ProfileFormBox\n profile={profile}\n onDataSave={this.handleGoBack}\n onError={handleError}\n blockDocument={blockDocument}\n />\n )\n }\n}\n\ninterface Props extends InjectedContentWrapperProps {\n data: { profile: Profile }\n profile: Profile\n history: any\n blockDocument?: boolean\n}\n\nconst enhance = compose<Props, { blockDocument?: boolean }>(\n graphql(GET_PROFILE),\n branch<Props>(\n ({ data }) => data.profile == null,\n renderComponent(ProfileEditLoading)\n ),\n withProps(({ data }: Props) => {\n return { profile: data.profile }\n }),\n withRouter,\n withContentWrapper({\n headerConfig,\n handle: { configHandle: 'profileEdit', contentHandle: '' },\n })\n)\n\nexport default enhance(ProfileEdit)\n\n```", "role": "assistant" } ]
doc_3dc75665
[ { "content": "You are a VTEX documentation expert. You provide accurate, detailed information about VTEX platform, APIs, apps, and Store Framework development.", "role": "system" }, { "content": "Provide a guide on guides synchronizing the catalog with vtex ads in VTEX.", "role": "user" }, { "content": "Documentation\n\n[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)\n\n[GuidesLearn how to use our APIs and extend the VTEX platform.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides)\n\n[API ReferenceExplore detailed information about our endpoints.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/api-reference)\n\n[App DevelopmentLearn how to build cloud-based apps and integrations.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/app-development)\n\n[Storefront DevelopmentExpress your brand identity creating unique storefronts.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/storefront-development)\n\n[VTEX IO AppsFind pre-built solutions to grow your business.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/vtex-io-apps)\n\n[TroubleshootingFind practical solutions to common development issues.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/troubleshooting)\n\n[Release NotesStay up to date with our latest releases and bug fixes.](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/updates/release-notes)\n\nGuides\n\n[VTEX Platform Overview](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/vtex-platform-overview)\n\n---\n\n[API usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/api-usage)\n\n---\n\n[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/getting-started)\n\n---\n\nIntegration Guides\n\n---\n\n[Catalog](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/catalog-integration)\n\n---\n\n[Checkout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/checkout-api-overview)\n\n---\n\n[Master Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/master-data)\n\n---\n\nPayments\n\n---\n\nOrders\n\n---\n\nLogistics\n\n---\n\nB2B Suite\n\n---\n\nVTEX Sales App\n\n---\n\nUI Customization\n\n---\n\nMessage Center\n\n---\n\nPricing\n\n---\n\nPromotions\n\n---\n\nInfrastructure\n\n---\n\nSearch\n\n---\n\nStorefront Permissions\n\n---\n\n[VTEX Activity Flow](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/activity-flow)\n\n---\n\n[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/vtex-ads)\n\n[Getting started with VTEX Ads API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/getting-started-with-vtex-ads-api)\n\n[Synchronizing the catalog with VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/synchronizing-the-catalog-with-vtex-ads)\n\n[Synchronizing product information](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/synchronizing-product-information)\n\n[Synchronizing inventory information](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/synchronizing-inventory-information)\n\n[Retrieving ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/retrieving-ads)\n\n[Ads events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/ads-events)\n\n---\n\nVTEX Session\n\n---\n\nVTEX Shield\n\n---\n\n[Data Protection Plus](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/data-protection-plus)\n\n---\n\nWeni by VTEX\n\n---\n\n[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides)\n\n[API Reference](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/api-reference)\n\n[App Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/app-development)\n\n[Storefront Development](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/storefront-development)\n\n[VTEX IO Apps](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/vtex-io-apps)\n\n[Troubleshooting](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/troubleshooting)\n\n---\n\n[Release Notes](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/updates/release-notes)\n\nGuides\n\n[VTEX Platform Overview](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/vtex-platform-overview)\n\n---\n\n[API usage](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/api-usage)\n\n---\n\n[Getting started](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/getting-started)\n\n---\n\nIntegration Guides\n\n---\n\n[Catalog](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/catalog-integration)\n\n---\n\n[Checkout](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/checkout-api-overview)\n\n---\n\n[Master Data](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/master-data)\n\n---\n\nPayments\n\n---\n\nOrders\n\n---\n\nLogistics\n\n---\n\nB2B Suite\n\n---\n\nVTEX Sales App\n\n---\n\nUI Customization\n\n---\n\nMessage Center\n\n---\n\nPricing\n\n---\n\nPromotions\n\n---\n\nInfrastructure\n\n---\n\nSearch\n\n---\n\nStorefront Permissions\n\n---\n\n[VTEX Activity Flow](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/activity-flow)\n\n---\n\n[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/vtex-ads)\n\n[Getting started with VTEX Ads API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/getting-started-with-vtex-ads-api)\n\n[Synchronizing the catalog with VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/synchronizing-the-catalog-with-vtex-ads)\n\n[Synchronizing product information](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/synchronizing-product-information)\n\n[Synchronizing inventory information](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/synchronizing-inventory-information)\n\n[Retrieving ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/retrieving-ads)\n\n[Ads events](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/ads-events)\n\n---\n\nVTEX Session\n\n---\n\nVTEX Shield\n\n---\n\n[Data Protection Plus](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/data-protection-plus)\n\n---\n\nWeni by VTEX\n\n---\n\n[Guides](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides)\n\n[VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/vtex-ads)\n\n[Getting started with VTEX Ads API](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/getting-started-with-vtex-ads-api)\n\n[Synchronizing the catalog with VTEX Ads](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/docs/guides/synchronizing-the-catalog-with-vtex-ads)\n\nSynchronizing the catalog with VTEX Ads\n\nSynchronize your product catalog with VTEX Ads to keep product information and inventory data up to date.\n\nTo activate your VTEX Ads integration, the first step is to synchronize your product catalog. This ensures that product and inventory data is available for campaign creation and conversion tracking.\n\nCatalog data is essential for:\n\n* Enabling advertisers to select products for **Product Ads** campaigns.\n* Supporting conversion attribution for both **Product Ads** and **Banner Ads**.\n\nCatalog synchronization is divided into two stages:\n\n1. [Product information](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-product-information) \nSend relevant product attributes such as name, image, brand, and price to VTEX Ads so they can be accurately represented in ads and used for targeting and reporting.\n2. [Inventory information](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-inventory-information) \nKeep stock levels updated to ensure ads are only shown for available products and campaigns reflect real-time inventory.\n\nContributors\n\n1\n\n[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F77292838%3Fv%3D4%26w=64%26q=75)](https://github.com/julia-rabello)\n\nWas this helpful?\n\nYes\n\nNo\n\n[Suggest Edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/VTEX Ads/getting-started-with-vtex-ads-api/synchronizing-the-catalog-with-vtex-ads.md)\n\n[Getting started with VTEX Ads API« Previous](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads//docs/guides/getting-started-with-vtex-ads-api)[Synchronizing product informationNext »](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads//docs/guides/synchronizing-product-information)\n\nContributors\n\n1\n\n[![Photo of the contributor](https://read.calvincode.net/reader?url=https://developers.vtex.com/docs/guides/synchronizing-the-catalog-with-vtex-ads/_next/image?url=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F77292838%3Fv%3D4%26w=64%26q=75)](https://github.com/julia-rabello)\n\nWas this helpful?\n\n Send feedback\n\n[Suggest edits (GitHub)](https://read.calvincode.net/reader?url=https://github.com/vtexdocs/dev-portal-content/edit/main/docs/guides/VTEX Ads/getting-started-with-vtex-ads-api/synchronizing-the-catalog-with-vtex-ads.md)\n\nCopy page\n\nOn this page\n\nOn this page\n\n[Github](https://read.calvincode.net/reader?url=https://github.com/vtex-apps)[Help Center](https://read.calvincode.net/reader?url=https://help.vtex.com/)[Community](https://read.calvincode.net/reader?url=https://community.vtex.com/?%5Fga=2.198523433.743584735.1647618303-1974737580.1645714642)[Feedback](https://read.calvincode.net/reader?url=https://docs.google.com/forms/d/e/1FAIpQLSfmnotPvPjw-SjiE7lt2Nt3RQgNUe10ixXZmuO2v9enOJReoQ/viewform?entry.1972292648=developers.vtex.com%26entry.1799503232=)", "role": "assistant" } ]
code_community_71bff8ca
[ { "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": "system" }, { "content": "Explain the code in community/b2b-newstore-theme-experimental/store/blocks/components/trending.jsonc.", "role": "user" }, { "content": "```jsonc\n{\n \"flex-layout.row#trending\": {\n \"children\": [\n \"flex-layout.col#trending\"\n ],\n \"props\": {\n \"blockClass\": \"trendingSection\"\n }\n },\n \"flex-layout.col#trending\": {\n \"children\": [\n \"flex-layout.row#trendingHead\",\n \"list-context.product-list#trending\"\n ]\n },\n \"flex-layout.row#trendingHead\": {\n \"children\": [\n \"rich-text#trendingTitle\",\n \"link#trending\"\n ],\n \"props\": {\n \"blockClass\": \"trendingHead\",\n \"preventHorizontalStretch\": true,\n \"preserveLayoutOnMobile\": true\n }\n },\n \"rich-text#trendingTitle\": {\n \"props\": {\n \"text\": \"### What's trending\",\n \"blockClass\": \"trendingTitle\"\n }\n },\n \"link#trending\": {\n \"props\": {\n \"label\": \"See all\",\n \"blockClass\": \"trendingLink\",\n \"href\": \"/trending\"\n }\n },\n \"list-context.product-list#trending\": {\n \"blocks\": [\n \"product-summary.shelf#trending\"\n ],\n \"children\": [\n \"slider-layout#trendingProducts\"\n ],\n \"props\": {\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"maxItems\": \"6\"\n }\n },\n \"slider-layout#trendingProducts\": {\n \"props\": {\n \"itemsPerPage\": {\n \"desktop\": 6,\n \"tablet\": 6,\n \"phone\": 6\n },\n \"infinite\": false,\n \"fullWidth\": true,\n \"blockClass\": \"shelfTrending\"\n }\n }\n}\n```", "role": "assistant" } ]
code_b2b-orders-history_6bf67b5a
[ { "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": "system" }, { "content": "Show me the implementation of b2b-orders-history/messages/context.json from b2b-orders-history.", "role": "user" }, { "content": "Here's the source code:\n\n```json\n{\n \"a11y.orderHeader.shippingModal\": \"Open address popup\",\n \"commons.hello\": \"Hello\",\n \"commons.continue\": \"Continue\",\n \"commons.free\": \"Free\",\n \"commons.other\": \"Other\",\n \"commons.reasonOtherExplanation\": \"Please, tell us why you are cancelling this order\",\n \"commons.save\": \"Save\",\n \"commons.close\": \"Close\",\n \"commons.no\": \"No\",\n \"commons.yes\": \"Yes\",\n \"commons.reload\": \"Reload\",\n \"commons.cancel\": \"Cancel\",\n \"myo.commons.back\": \"Back\",\n \"goBackToMyOrders\": \"go back to My Orders\",\n \"order\": \"Order\",\n \"seeOrder\": \"View Order\",\n \"greeting.replaced\": \"Your order #{value} was successfully replaced!\",\n \"greeting.cancelled\": \"The order #{value} has been submitted for cancellation and will be completed soon!\",\n \"greeting.edit\": \"Your subscription was successfully updated!\",\n \"pages.editOrder.greeting\": \"Welcome to self service. Your order is getting ready for delivery. What can we do for you?\",\n \"pages.editOrder.changeUnavailable\": \"This order is not available for product changes.\",\n \"pages.cancelOrder.greeting\": \"Welcome to self service. Why do you want to cancel your order?\",\n \"orders.toggle.ordersThatArentFinished\": \"Ongoing Orders\",\n \"orders.toggle.ordersThatAreFinished\": \"Finished Orders\",\n \"orders.notFound\": \"You haven't ordered anything yet!\",\n \"orders.finishedNotFound\": \"You have no finished orders\",\n \"orders.ongoingNotFound\": \"You have no ongoing orders\",\n \"order.dateIs\": \"Order Date\",\n \"order.shipsTo\": \"Shipping\",\n \"order.total\": \"Total\",\n \"order.moreOptions\": \"More options\",\n \"orders.title\": \"Orders\",\n \"orders.edit\": \"Edit Order #{orderNumber}\",\n \"order.history\": \"Change History\",\n \"order.change.date\": \"{date} at {hour}\",\n \"order.change.quantity\": \"Quantity: {quantity}\",\n \"order.change.originalOrder\": \"Original order\",\n \"order.change.currentOrder\": \"Current order\",\n \"order.viewAllItems\": \"View all items\",\n \"order.printBankInvoice\": \"Print bank invoice\",\n \"order.cancelOrder\": \"Request Cancellation\",\n \"order.changeOrder\": \"Change Order\",\n \"order.orderAgain\": \"Order again\",\n \"order.goToOrderDetails\": \"View order details\",\n \"order.confirmCancellation\": \"Confirm cancellation\",\n \"order.estimatedDeliveryTo\": \"Estimated delivery to\",\n \"order.navigationArrowTitle\": \"Return arrow\",\n \"order.seeInvoice\": \"View invoice\",\n \"order.trackingData.clickHereToGoToExternalPage\": \"See tracking information in carrier's website\",\n \"order.trackingData.shipping\": \"Tracking #{trackingNumber}\",\n \"order.stepsFlow.placed\": \"Order Placed\",\n \"order.stepsFlow.approved\": \"Order Approved\",\n \"order.stepsFlow.sent\": \"Order Sent\",\n \"order.stepsFlow.shipping\": \"Order Shipping\",\n \"order.stepsFlow.finished\": \"Order Finished\",\n \"order.stepsFlow.cancelled\": \"Order Cancelled\",\n \"order.state.unknown\": \"Processing\",\n \"order.state.waiting-for-seller-confirmation\": \"Processing\",\n \"order.state.order-created\": \"Processing\",\n \"order.state.order-completed\": \"Processing\",\n \"order.state.on-order-completed\": \"Processing\",\n \"order.state.payment-pending\": \"Processing Payment\",\n \"order.state.window-to-cancel\": \"Handling Shipping\",\n \"order.state.approve-payment\": \"Handling Shipping\",\n \"order.state.payment-approved\": \"Payment Approved\",\n \"order.state.request-cancel\": \"Cancellation Requested\",\n \"order.state.cancel\": \"Processing Cancellation\",\n \"order.state.canceled\": \"Cancelled\",\n \"order.state.waiting-for-seller-decision\": \"Cancellation Requested\",\n \"order.state.invoice\": \"Shipping\",\n \"order.state.invoiced\": \"Shipped\",\n \"order.state.replaced\": \"Replaced\",\n \"order.state.cancellation-requested\": \"Cancellation Requested\",\n \"order.state.ready-for-handling\": \"Handling Shipping\",\n \"order.state.handling\": \"Handling Shipping\",\n \"order.state.authorize-fullfilment\": \"Processing Payment\",\n \"order.state.release-to-fulfillment\": \"Handling Shipping\",\n \"order.state.delivered\": \"Delivered\",\n \"order.state.ready-for-pickup\": \"Ready for pickup\",\n \"order.state.pickedUp\": \"Picked up\",\n \"order.state.handlingPickup\": \"Handling Order\",\n \"order.progress.pickup\": \"Pickup\",\n \"order.progress.confirmOrder\": \"Place order\",\n \"order.progress.confirmingOrder\": \"Placing order\",\n \"order.progress.orderConfirmed\": \"Order placed\",\n \"order.progress.approvePayment\": \"Approve payment\",\n \"order.progress.approvingPayment\": \"Approving payment\",\n \"order.progress.paymentApproved\": \"Payment approved\",\n \"order.progress.handleShipping\": \"Handle order\",\n \"order.progress.handlingShipping\": \"Handling order\",\n \"order.progress.shippingHandled\": \"Package handled\",\n \"order.progress.deliverToCarrier\": \"Deliver to carrier\",\n \"order.progress.delivering\": \"Delivering to carrier\",\n \"order.progress.delivered\": \"Delivered to carrier\",\n \"order.progress.deliverToPickup\": \"Deliver to pickup point\",\n \"order.progress.deliveringToPickup\": \"Delivering to pickup point\",\n \"order.progress.deliveredToPickup\": \"Delivered to pickup point\",\n \"order.progress.ship\": \"Ship order\",\n \"order.progress.shipping\": \"Shipping order\",\n \"order.progress.shipped\": \"Order shipped\",\n \"package.progress.handleShipping\": \"Handle package\",\n \"package.progress.handlingShipping\": \"Handling package\",\n \"package.progress.shippingHandled\": \"Package handled\",\n \"package.progress.deliverToCarrier\": \"Deliver order\",\n \"package.progress.delivering\": \"Delivering order\",\n \"package.progress.delivered\": \"Order delivered\",\n \"package.progress.ship\": \"Ship package\",\n \"package.progress.shipping\": \"Shipping package\",\n \"package.progress.shipped\": \"Package shipped\",\n \"order.summary.title\": \"Summary\",\n \"order.summary.total\": \"Total\",\n \"order.shippingInfo\": \"Address\",\n \"order.paymentInfo\": \"Payment Info\",\n \"order.package.heading\": \"Package\",\n \"order.package.numbering\": \"of\",\n \"order.package.day\": \"day\",\n \"order.package.product\": \"Product\",\n \"order.package.price\": \"Price\",\n \"order.package.quantity\": \"Quantity\",\n \"order.package.total\": \"Subtotal\",\n \"order.shippingEstimate.bd\": \"{timeAmount, plural, =0 {In the same day} one {Delivery within # business day} other {Delivery within # business days}}\",\n \"order.shippingEstimate.d\": \"{timeAmount, plural, =0 {In the same day} one {Delivery within # day} other {Delivery within # days}}\",\n \"order.shippingEstimate.h\": \"{timeAmount, plural, =0 {Now} one {Delivery within # hour} other {Delivery within # hours}}\",\n \"order.shippingEstimate.m\": \"{timeAmount, plural, =0 {Now} one {Delivery within # minute} other {Delivery within # minutes}}\",\n \"order.shippingEstimate.withTime\": \"Delivery by {date} at {hour}\",\n \"order.shippingEstimate.noTime\": \"Delivery by {date}\",\n \"order.shippingEstimate.window\": \"Delivery {date}, between {startHour} and {endHour}\",\n \"order.shippingEstimate.pickup.withTime\": \"Pickup ready by {date} at {hour}\",\n \"order.shippingEstimate.pickup.noTime\": \"Pickup ready by {date}\",\n \"order.shippingEstimate.pickup.window\": \"Pickup ready by {date}, between {startHour} and {endHour}\",\n \"order.tracking.date\": \"Date\",\n \"order.tracking.time\": \"Time\",\n \"order.tracking.status\": \"Status\",\n \"order.tracking.showMore\": \"Show more\",\n \"paymentData.additionalInfo\": \"Additional Info\",\n \"paymentData.paymentGroup.MercadoPago.name\": \"MercadoPago\",\n \"paymentData.paymentGroup.payPal.name\": \"PayPal\",\n \"paymentData.paymentGroup.stelo.name\": \"Stelo\",\n \"paymentData.paymentGroup.safetypay.name\": \"Online Debit\",\n \"paymentData.paymentGroup.Bcash.name\": \"Bcash\",\n \"paymentData.paymentGroup.giftCard.name\": \"Gift Card\",\n \"paymentData.paymentGroup.debit.name\": \"Online Debit\",\n \"paymentData.paymentGroup.debitCard.name\": \"Debit Card\",\n \"paymentData.paymentGroup.creditDirectSale.name\": \"PIN Pad Payment\",\n \"paymentData.paymentGroup.creditCard.name\": \"Credit Card\",\n \"paymentData.paymentGroup.creditCard.endingIn\": \"ending in\",\n \"paymentData.paymentGroup.bankInvoice.name\": \"Invoice\",\n \"paymentData.paymentGroup.evolucard.name\": \"Evolucard\",\n \"paymentData.paymentGroup.promissory.name\": \"Credit Card\",\n \"paymentData.paymentGroup.alignet.name\": \"Alignet\",\n \"paymentData.paymentGroup.pagSeguro.name\": \"PagSeguro\",\n \"paymentData.paymentGroup.pagosWeb.name\": \"Payment methods\",\n \"paymentData.paymentGroup.peela.name\": \"Peela\",\n \"paymentData.paymentGroup.koin.name\": \"Koin Pós-Pago\",\n \"paymentData.giftCard.loyalty-program.name\": \"Loyalty Program\",\n \"reasons.shipping\": \"Change of shipping data\",\n \"reasons.payment\": \"Change of payment data\",\n \"reasons.profile\": \"Change of personal data\",\n \"reasons.unknown\": \"Reason not specified\",\n \"global.unknownError\": \"An unexpected error ocurred, we are trying to solve it. Try again later\",\n \"global.errorServer\": \"There was an error in our servers. Please try again later.\",\n \"global.loginNeeded\": \"You need to login.\",\n \"global.unauthorized\": \"You are not authorized to access this.\",\n \"global.notFound\": \"Not found\",\n \"order.subscription\": \"Subscription\",\n \"order.subscription.key.frequency\": \"Frequency\",\n \"product.quantity\": \"{qtd, plural, one {# un} other {# un}}\"\n}\n```", "role": "assistant" } ]
code_flex-layout_10490f5e
[ { "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": "system" }, { "content": "How do I test components in flex-layout?", "role": "user" }, { "content": "The implementation is:\n\n```javascript\nimport { parseBorders } from '../modules/valuesParser'\n\ndescribe('parseBorders', () => {\n it('should work with border as array', () => {\n const input = {\n border: ['left', 'bottom', 'right', 'top', 'all'],\n borderWidth: 1,\n borderColor: 'red',\n }\n\n const border = parseBorders(input)\n\n expect(border).toBe('bl bb br bt ba bw1 b--red')\n })\n it('should work with border as string', () => {\n const input = {\n border: 'all',\n borderWidth: 1,\n borderColor: 'red',\n }\n\n const border = parseBorders(input)\n\n expect(border).toBe('ba bw1 b--red')\n })\n})\n\n```", "role": "assistant" } ]
code_community_f9c8827e
[ { "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": "system" }, { "content": "What are the key features of community?", "role": "user" }, { "content": "```markdown\n # Tornando o bloco countdown customizável\n\n## Introdução\nAgora que temos um elemento `h1` renderizado, é possível utilizá-lo para mostrar informações que dependam de uma *prop* do componente. Para isso, alguns conceitos serão apresentados, já que são necessários para desenvolver uma aplicação.\n\n## Alterando o conteúdo renderizado do componente\n\n1. Na interface definida no `Countdown.tsx`, adicione uma *prop* chamada `targetDate`, ela é do tipo *string*. Com isso, estamos definindo uma *prop* do componente que será utilizada para inicializar o contador.\n\n ```diff\n // react/Countdown.tsx\n interface CountdownProps {\n + targetDate: string \n }\n ```\n\n2. Feito isso, é preciso utilizá-la no componente, substituindo o texto de antes, \"Teste Countdown\" por um outro texto, através do *Site Editor*. \n\n >No futuro, esse targetDate será utilizado para definir a data de término para o contador. Porém, por enquanto, esse campo pode ser genérico.\n\n Primeiramente, é preciso alterar o componente para utilizar a *prop* `targetDate` definida anteriormente. Para isso, é preciso adicionar dentro do componente React a variável a ser utilizada no `h1`. Você lembra do bloco de código do componente na etapa anterior? Vamos utilizá-lo novamente para fazer as alterações.\n\n ```tsx\n // react/Countdown.tsx\n const Countdown: StorefrontFunctionComponent<CountdownProps> = ({ targetDate }) => {\n return (\n <div>\n <h1>{ targetDate }</h1>\n </div>\n ) \n }\n ```\n\n3. Além disso, para alterar essa propriedade através do *Site Editor*, é necessário adicionar essa mesma *prop* ao *schema*. Isso é feito através da adição de um objeto com chave `targetDate` dentro do objeto `properties` no *schema*. Ou seja:\n\n ```diff\n // react/Countdown.tsx\n Countdown.schema = {\n title: 'editor.countdown.title',\n description: 'editor.countdown.description',\n type: 'object',\n properties: {\n + targetDate: {\n + title: 'Data final',\n + description: 'Data final utilizada no contador',\n + type: 'string',\n + default: null,\n + },\n },\n }\n ```\n\nPronto! Agora você pode alterar o conteúdo do texto através do *Site Editor*. Vamos ver como ficou? \n\n> Você pode acessar o _Site Editor_ através do seguinte _link_: `{yourWorkspace}--appliancetheme.myvtex.com/admin/cms/site-editor`.\n\nVá até o *Site Editor* e clique em `Countdown` no menu lateral, isso abrirá o menu de edição da *app*, que será como a imagem abaixo.\n\n![image](https://user-images.githubusercontent.com/19495917/80977387-0cd7d300-8dfb-11ea-87e4-35218eab524b.png)\n\nAgora, no campo abaixo do título, digite uma data no formato `AAAA-MM-DD` e veja a alteração, que passará a exibir o texto que você digitou. \n\n![image](https://user-images.githubusercontent.com/19495917/80977331-f6ca1280-8dfa-11ea-81f6-b7b551a8c41f.png)\n\n\n\n\n ### Está com dúvidas?\n\n Confira [aqui o gabarito para esta etapa](https://vtex-enterprise-group.readme.io/learning/docs/course-store-block-step03props-implementation-answersheet) ou peça ajuda a um de nossos monitores\n```", "role": "assistant" } ]
code_store-on-localhost_fb31b869
[ { "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": "system" }, { "content": "Show me the implementation of store-on-localhost/src/monobloco/components/new/StoreComponents/components/InfoCard/SchemaTypes.js from store-on-localhost.", "role": "user" }, { "content": "Here's how it works:\n\n```javascript\nexport const textPostionValues = {\n LEFT: 'left',\n CENTER: 'center',\n RIGHT: 'right',\n}\n\nexport const textAlignmentValues = {\n LEFT: 'left',\n CENTER: 'center',\n RIGHT: 'right',\n}\n\nexport const callActionValues = {\n NONE: 'none',\n BUTTON: 'button',\n LINK: 'link',\n}\n\nexport const textPositionTypes = {\n TEXT_POSITION_LEFT: {\n name: 'admin/editor.info-card.textPosition.left',\n value: textPostionValues.LEFT,\n },\n TEXT_POSITION_CENTER: {\n name: 'admin/editor.info-card.textPosition.center',\n value: textPostionValues.CENTER,\n },\n TEXT_POSITION_RIGHT: {\n name: 'admin/editor.info-card.textPosition.right',\n value: textPostionValues.RIGHT,\n },\n}\n\nexport const textAlignmentTypes = {\n TEXT_ALIGNMENT_LEFT: {\n name: 'admin/editor.info-card.textAlignment.left',\n value: textAlignmentValues.LEFT,\n },\n TEXT_ALIGNMENT_CENTER: {\n name: 'admin/editor.info-card.textAlignment.center',\n value: textAlignmentValues.CENTER,\n },\n TEXT_ALIGNMENT_RIGHT: {\n name: 'admin/editor.info-card.textAlignment.right',\n value: textAlignmentValues.RIGHT,\n },\n}\n\nexport const callToActionModeTypes = {\n CALL_ACTION_NONE: {\n name: 'admin/editor.info-card.callAction.none',\n value: callActionValues.NONE,\n },\n CALL_ACTION_BUTTON: {\n name: 'admin/editor.info-card.callAction.button',\n value: callActionValues.BUTTON,\n },\n CALL_ACTION_LINK: {\n name: 'admin/editor.info-card.callAction.link',\n value: callActionValues.LINK,\n },\n}\n\n```", "role": "assistant" } ]
code_search-resolver_02816c84
[ { "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": "system" }, { "content": "Show me the resolver implementation for search-resolver.", "role": "user" }, { "content": "Here's the graphql resolver:\n\n```typescript\nimport { fetchProduct, buildVtexSegment } from './product'\nimport { createContext } from '../mocks/contextFactory'\n\ndescribe('fetchProduct service', () => {\n const mockProduct = {\n productId: 'test-product',\n productName: 'Test Product',\n brand: 'Test Brand',\n } as SearchProduct\n\n beforeEach(() => {\n jest.clearAllMocks()\n })\n\n it('should build vtex segment correctly', () => {\n const vtexSegment = buildVtexSegment({\n vtexSegment: {\n campaigns: null,\n channel: '1',\n priceTables: null,\n regionId: 'U1cjMQ==',\n utm_campaign: null,\n utm_source: null,\n utmi_campaign: null,\n currencyCode: 'ARS',\n currencySymbol: '$',\n countryCode: 'ARG',\n cultureInfo: 'es-AR',\n admin_cultureInfo: 'es-AR',\n channelPrivacy: 'public',\n },\n salesChannel: '2',\n regionId: '3',\n })\n\n const result = JSON.parse(Buffer.from(vtexSegment, 'base64').toString())\n\n expect(result.regionId).toBe('3')\n expect(result.countryCode).toBe('ARG')\n expect(result.currencySymbol).toBe('$')\n expect(result.currencyCode).toBe('ARS')\n expect(result.channel).toBe('2')\n expect(result.cultureInfo).toBe('es-AR')\n expect(result.admin_cultureInfo).toBe('es-AR')\n expect(result.channelPrivacy).toBe('public')\n expect(result.campaigns).toBeNull()\n expect(result.priceTables).toBeNull()\n expect(result.utm_campaign).toBeNull()\n expect(result.utm_source).toBeNull()\n expect(result.utmi_campaign).toBeNull()\n })\n\n it('should use intsch directly for b2bstoreqa account', async () => {\n const ctx = createContext({\n accountName: 'b2bstoreqa',\n appSettings: {\n shouldUseNewPDPEndpoint: true,\n },\n })\n\n // Mock the intsch client to return a product\n jest\n .spyOn(ctx.clients.intsch, 'fetchProduct')\n .mockImplementation()\n .mockResolvedValue(mockProduct)\n\n const args = {\n identifier: { field: 'id' as const, value: 'test-id' },\n salesChannel: 1,\n }\n\n const result = await fetchProduct(ctx, args)\n\n expect(ctx.clients.intsch.fetchProduct).toHaveBeenCalled()\n expect(result).toEqual([mockProduct])\n })\n\n it('should use intsch directly for biggy account', async () => {\n const ctx = createContext({\n accountName: 'biggy',\n appSettings: {\n shouldUseNewPDPEndpoint: true,\n },\n })\n\n // Mock the intsch client to return a product\n jest\n .spyOn(ctx.clients.intsch, 'fetchProduct')\n .mockImplementation()\n .mockResolvedValue(mockProduct)\n\n const args = {\n identifier: { field: 'id' as const, value: 'test-id' },\n salesChannel: 1,\n }\n\n const result = await fetchProduct(ctx, args)\n\n expect(ctx.clients.intsch.fetchProduct).toHaveBeenCalled()\n expect(result).toEqual([mockProduct])\n })\n})\n\n```", "role": "assistant" } ]
code_store-components_8ec75fde
[ { "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": "system" }, { "content": "Show me the implementation of store-components/react/components/Slider/components/Arrow.js from store-components.", "role": "user" }, { "content": "The implementation is:\n\n```javascript\nimport React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport classNames from 'classnames'\n\n/**\n * Arrow component. It's an overriden component of react-slick that controls\n * the slide transition.\n */\n// eslint-disable-next-line react/prefer-stateless-function\nexport default class Arrow extends Component {\n render() {\n const { className, style, onClick, cssClass, customClasses } = this.props\n const arrowClasses = classNames({\n [`${className}`]: className,\n [`${cssClass}`]: cssClass,\n [`${customClasses}`]: customClasses,\n })\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions\n <div\n className={`${arrowClasses}`}\n style={{ ...style }}\n onClick={onClick}\n />\n )\n }\n}\n\nArrow.propTypes = {\n /** (react-slick prop) Css class of the element. */\n className: PropTypes.string,\n /** (react-slick prop) Custom style of the element. */\n style: PropTypes.object,\n /** (react-slick prop) Function to be called when the arrow is clicked. */\n onClick: PropTypes.func,\n /** Specifies wich css class the arrow will receive. */\n cssClass: PropTypes.string.isRequired,\n /** Custom classes */\n customClasses: PropTypes.string,\n}\n\n```", "role": "assistant" } ]
code_community_1e7c783f
[ { "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": "system" }, { "content": "Show me the implementation of community/agapito-store/src/Components/Header/Menu/Subcategoria/index.js from community.", "role": "user" }, { "content": "This is the code:\n\n```javascript\nfunction index(props) {\n var content = props.content\n return (\n <ul>\n {content.map((item,index) => {\n return (<li key={index} >\n <a href={item.url}>{item.name}</a>\n </li>)\n })}\n </ul>\n );\n}\n\nexport default index;\n```", "role": "assistant" } ]
code_shipment-tracker_6bc1626e
[ { "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": "system" }, { "content": "Show me the GraphQL schema for shipment-tracker.", "role": "user" }, { "content": "This is the code:\n\n```graphql\nquery GetInteractions($shipmentId: String) {\n interactions(shipmentId: $shipmentId) {\n id\n interaction\n delivered\n createdIn\n updatedIn\n }\n}\n\n```", "role": "assistant" } ]
code_product-price_7b4c0a70
[ { "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": "system" }, { "content": "Explain the code in product-price/react/typings/css.d.ts.", "role": "user" }, { "content": "Here's how it works:\n\n```typescript\ndeclare module '*.css' {\n type Styles = {\n [selector: string]: string\n }\n\n const styles: Styles\n\n export default styles\n}\n\n```", "role": "assistant" } ]
code_store-on-localhost_bd40b69f
[ { "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": "system" }, { "content": "Show me the implementation of store-on-localhost/src/monobloco/components/new/Styleguide/ToastConsumer.js from store-on-localhost.", "role": "user" }, { "content": "Here's the source code:\n\n```javascript\nimport { ToastConsumer } from './components/ToastProvider/index'\n\nexport default ToastConsumer\n\n```", "role": "assistant" } ]
code_search-demo-theme_8697f530
[ { "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": "system" }, { "content": "Explain the code in search-demo-theme/store/blocks/faq.jsonc.", "role": "user" }, { "content": "Here's how it works:\n\n```jsonc\n{\n \"store.custom#faq\": {\n \"children\": [\n \"flex-layout.row#faq\"\n ]\n },\n\n \"flex-layout.row#faq\": {\n \"props\": {\n \"blockClass\": \"faq\"\n },\n \"children\": [\n \"flex-layout.col#faq\"\n ]\n },\n\n \"flex-layout.col#faq\": {\n \"children\": [\n \"rich-text#faq\",\n \"disclosure-layout-group#group\"\n ]\n },\n \"rich-text#faq\": {\n \"props\": {\n \"text\": \"## FAQ\"\n }\n },\n\n \"disclosure-layout-group#group\": {\n \"children\": [\n \"disclosure-layout#first\",\n \"disclosure-layout#second\",\n \"disclosure-layout#third\",\n \"disclosure-layout#fourth\"\n ]\n },\n\n \"disclosure-layout#first\": {\n \"props\": {\n \"animated\": true\n },\n \"children\": [\"disclosure-trigger#first\", \"disclosure-content#first\"]\n },\n \"disclosure-trigger#first\": {\n \"props\": {\n \"blockClass\": \"question\",\n \"as\": \"div\"\n },\n \"children\": [\"disclosure-state-indicator\", \"rich-text#question1\"]\n },\n \"disclosure-content#first\": {\n \"props\": {\n \"blockClass\": \"answer\"\n },\n \"children\": [\"rich-text#answer1\"]\n },\n \"rich-text#question1\": {\n \"props\": {\n \"text\": \"How can I change my shipping address?\"\n }\n },\n \"rich-text#answer1\": {\n \"props\": {\n \"text\": \"Call us at the number (212) 1234-1234.\"\n }\n },\n\n \"disclosure-layout#second\": {\n \"props\": {\n \"animated\": true\n },\n \"children\": [\"disclosure-trigger#second\", \"disclosure-content#second\"]\n },\n \"disclosure-trigger#second\": {\n \"props\": {\n \"blockClass\": \"question\",\n \"as\": \"div\"\n },\n \"children\": [\"disclosure-state-indicator\", \"rich-text#question2\"]\n },\n \"disclosure-content#second\": {\n \"props\": {\n \"blockClass\": \"answer\"\n },\n \"children\": [\"rich-text#answer2\"]\n },\n \"rich-text#question2\": {\n \"props\": {\n \"text\": \"How can I track my order?\"\n }\n },\n \"rich-text#answer2\": {\n \"props\": {\n \"text\": \"After logging into your account, you can find this info at the link Orders.\"\n }\n },\n\n\n \"disclosure-layout#third\": {\n \"props\": {\n \"animated\": true\n },\n \"children\": [\"disclosure-trigger#third\", \"disclosure-content#third\"]\n },\n \"disclosure-trigger#third\": {\n \"props\": {\n \"blockClass\": \"question\",\n \"as\": \"div\"\n },\n \"children\": [\"disclosure-state-indicator\", \"rich-text#question3\"]\n },\n \"disclosure-content#third\": {\n \"props\": {\n \"blockClass\": \"answer\"\n },\n \"children\": [\"rich-text#answer3\"]\n },\n \"rich-text#question3\": {\n \"props\": {\n \"text\": \"How can I change my shipping address?\"\n }\n },\n \"rich-text#answer3\": {\n \"props\": {\n \"text\": \"Call us at the number (212) 1234-1234.\"\n }\n },\n\n\n \"disclosure-layout#fourth\": {\n \"props\": {\n \"animated\": true\n },\n \"children\": [\"disclosure-trigger#fourth\", \"disclosure-content#fourth\"]\n },\n \"disclosure-trigger#fourth\": {\n \"props\": {\n \"blockClass\": \"question\",\n \"as\": \"div\"\n },\n \"children\": [\"disclosure-state-indicator\", \"rich-text#question4\"]\n },\n \"disclosure-content#fourth\": {\n \"props\": {\n \"blockClass\": \"answer\"\n },\n \"children\": [\"rich-text#answer2\"]\n },\n \"rich-text#question4\": {\n \"props\": {\n \"text\": \"How can I track my order?\"\n }\n },\n \"rich-text#answer4\": {\n \"props\": {\n \"text\": \"After logging into your account, you can find this info at the link Orders.\"\n }\n },\n\n\n \"disclosure-state-indicator\": {\n \"props\": {\n \"Show\": \"icon-caret#down\",\n \"Hide\": \"icon-caret#up\"\n }\n },\n \"icon-caret#down\": {\n \"props\": {\n \"orientation\": \"down\"\n }\n },\n \"icon-caret#up\": {\n \"props\": {\n \"orientation\": \"up\"\n }\n }\n}\n\n```", "role": "assistant" } ]
code_micro_d1ee1af3
[ { "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": "system" }, { "content": "Explain the code in micro/packages/micro-cli/lib/common/print.ts.", "role": "user" }, { "content": "The implementation is:\n\n```typescript\nimport { inspect } from 'util'\n\nexport const prettyPrint = (obj: any) => {\n console.log(inspect(obj, false, 100, true))\n}\n\n```", "role": "assistant" } ]
multiturn_b2b-organizations_styling_deep_dive_34f116fc
[ { "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. You provide detailed, accurate answers with working code examples.", "role": "system" }, { "content": "What CSS handles are available for b2b-organizations?", "role": "user" }, { "content": "The `vtex.b2b-organizations` app provides several CSS handles that you can use to customize the appearance of B2B organization management components. Here are the main CSS handles available:\n\n**Organization Management Handles:**\n- `organizationContainer` - Main wrapper for the organization section\n- `organizationHeader` - Header area containing title and actions\n- `organizationName` - Organization name display\n- `organizationDetails` - Container for organization details\n- `organizationTable` - Table displaying organization data\n- `organizationTableRow` - Individual table rows\n- `organizationActions` - Action buttons container\n\n**User Management Handles:**\n- `userListContainer` - Wrapper for the user list\n- `userListHeader` - Header of the user list section\n- `userListTable` - Table of organization users\n- `userListTableRow` - Individual user rows\n- `userRoleBadge` - Badge displaying user role\n- `userStatusBadge` - Badge showing user status (active/inactive)\n\n**Cost Center Handles:**\n- `costCenterContainer` - Main cost center wrapper\n- `costCenterCard` - Individual cost center cards\n- `costCenterName` - Cost center name element\n- `costCenterAddress` - Address display within cost center\n\n**Form Handles:**\n- `formContainer` - Form wrapper\n- `formInput` - Input fields\n- `formButton` - Form buttons\n- `formError` - Error message display\n\nTo use these handles, you need to declare them in your CSS module:\n\n```css\n.organizationContainer {\n padding: 20px;\n background-color: #f5f5f5;\n}\n\n.userRoleBadge {\n background-color: #134cd8;\n color: white;\n padding: 4px 8px;\n border-radius: 4px;\n}\n```\n\nYou can import the handles in your store theme using the `blockClass` prop for more specific targeting if needed.", "role": "assistant" }, { "content": "How do I override the default styles?", "role": "user" }, { "content": "To override the default styles for `b2b-organizations`, you have several approaches depending on your needs:\n\n**1. Using CSS Handles in your Store Theme**\n\nCreate a CSS file in your store theme at `styles/css/vtex.b2b-organizations.css`:\n\n```css\n/* styles/css/vtex.b2b-organizations.css */\n\n.organizationContainer {\n max-width: 1200px;\n margin: 0 auto;\n padding: 2rem;\n}\n\n.organizationHeader {\n border-bottom: 2px solid #e3e4e6;\n padding-bottom: 1rem;\n margin-bottom: 2rem;\n}\n\n.userListTable {\n width: 100%;\n border-collapse: collapse;\n}\n\n.userListTableRow:hover {\n background-color: #f0f0f0;\n}\n\n.userRoleBadge--admin {\n background-color: #8bc34a;\n}\n\n.userRoleBadge--buyer {\n background-color: #2196f3;\n}\n```\n\n**2. Using blockClass for Specific Instances**\n\nIn your `blocks.jsonc`, add a `blockClass` to target specific instances:\n\n```json\n{\n \"b2b-organizations\": {\n \"props\": {\n \"blockClass\": \"custom-org-management\"\n }\n }\n}\n```\n\nThen in your CSS:\n\n```css\n.organizationContainer--custom-org-management {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n border-radius: 8px;\n}\n```\n\n**3. Using Tachyons Tokens**\n\nVTEX supports Tachyons utility classes. Override design tokens in `styles/configs/style.json`:\n\n```json\n{\n \"semanticColors\": {\n \"background\": {\n \"base\": \"#ffffff\",\n \"emphasis\": \"#f5f7fa\"\n },\n \"text\": {\n \"action-primary\": \"#134cd8\"\n }\n }\n}\n```\n\n**4. Important Override Tips:**\n\n- Always check specificity - VTEX styles can be specific\n- Use `!important` sparingly and only when necessary\n- Test across different viewport sizes\n- Clear your workspace cache after CSS changes: `vtex workspace reset`\n\nAfter making changes, link your theme with `vtex link` to see updates in real-time.", "role": "assistant" }, { "content": "Can you show me a complete example with custom styling?", "role": "user" }, { "content": "Here's a complete example implementing custom styling for the B2B organizations component:\n\n**1. blocks.jsonc Configuration:**\n\n```json\n{\n \"store.account\": {\n \"children\": [\n \"flex-layout.row#b2b-wrapper\"\n ]\n },\n \"flex-layout.row#b2b-wrapper\": {\n \"props\": {\n \"blockClass\": \"b2b-page-wrapper\",\n \"fullWidth\": true\n },\n \"children\": [\n \"flex-layout.col#b2b-sidebar\",\n \"flex-layout.col#b2b-content\"\n ]\n },\n \"flex-layout.col#b2b-sidebar\": {\n \"props\": {\n \"blockClass\": \"b2b-sidebar\",\n \"width\": \"25%\"\n },\n \"children\": [\n \"b2b-organization-switcher\"\n ]\n },\n \"flex-layout.col#b2b-content\": {\n \"props\": {\n \"blockClass\": \"b2b-main-content\",\n \"width\": \"75%\"\n },\n \"children\": [\n \"b2b-organizations\",\n \"b2b-cost-centers\",\n \"b2b-users-list\"\n ]\n },\n \"b2b-organizations\": {\n \"props\": {\n \"blockClass\": \"corporate-org-panel\"\n }\n },\n \"b2b-cost-centers\": {\n \"props\": {\n \"blockClass\": \"corporate-cost-centers\"\n }\n },\n \"b2b-users-list\": {\n \"props\": {\n \"blockClass\": \"corporate-users\"\n }\n }\n}\n```\n\n**2. CSS File (styles/css/vtex.b2b-organizations.css):**\n\n```css\n/* Main Container Styles */\n.organizationContainer--corporate-org-panel {\n background-color: #ffffff;\n border-radius: 12px;\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n padding: 2rem;\n margin-bottom: 1.5rem;\n}\n\n.organizationHeader--corporate-org-panel {\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 1px solid #e1e4e8;\n padding-bottom: 1rem;\n margin-bottom: 1.5rem;\n}\n\n.organizationName--corporate-org-panel {\n font-size: 1.5rem;\n font-weight: 600;\n color: #1a1a1a;\n}\n\n/* Table Styles */\n.organizationTable--corporate-org-panel {\n width: 100%;\n border-spacing: 0;\n}\n\n.organizationTableRow--corporate-org-panel {\n transition: background-color 0.2s ease;\n}\n\n.organizationTableRow--corporate-org-panel:nth-child(even) {\n background-color: #f9fafb;\n}\n\n.organizationTableRow--corporate-org-panel:hover {\n background-color: #eef2ff;\n}\n\n/* User List Styles */\n.userListContainer--corporate-users {\n background: #ffffff;\n border-radius: 12px;\n padding: 1.5rem;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);\n}\n\n.userRoleBadge--corporate-users {\n display: inline-flex;\n align-items: center;\n padding: 0.25rem 0.75rem;\n border-radius: 9999px;\n font-size: 0.75rem;\n font-weight: 500;\n text-transform: uppercase;\n}\n\n.userStatusBadge--corporate-users[data-status=\"active\"] {\n background-color: #d1fae5;\n color: #065f46;\n}\n\n.userStatusBadge--corporate-users[data-status=\"inactive\"] {\n background-color: #fee2e2;\n color: #991b1b;\n}\n\n/* Cost Center Styles */\n.costCenterContainer--corporate-cost-centers {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n gap: 1rem;\n}\n\n.costCenterCard--corporate-cost-centers {\n background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);\n border-radius: 8px;\n padding: 1.25rem;\n border-left: 4px solid #134cd8;\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n}\n\n.costCenterCard--corporate-cost-centers:hover {\n transform: translateY(-2px);\n box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);\n}\n\n/* Button Styles */\n.formButton--corporate-org-panel {\n background-color: #134cd8;\n color: #ffffff;\n border: none;\n padding: 0.75rem 1.5rem;\n border-radius: 6px;\n font-weight: 500;\n cursor: pointer;\n transition: background-color 0.2s ease;\n}\n\n.formButton--corporate-org-panel:hover {\n background-color: #0e3ba8;\n}\n\n/* Responsive Adjustments */\n@media screen and (max-width: 768px) {\n .organizationContainer--corporate-org-panel {\n padding: 1rem;\n border-radius: 8px;\n }\n \n .costCenterContainer--corporate-cost-centers {\n grid-template-columns: 1fr;\n }\n}\n```\n\n**3. Deploy Steps:**\n\n```bash\n# Link your theme for development\nvtex link\n\n# When ready for production\nvtex publish\nvtex deploy\n```\n\nThis setup provides a polished, professional appearance for your B2B portal with hover effects, responsive layouts, and consistent branding. The `blockClass` approach ensures your styles only affect these specific instances without impacting other components.", "role": "assistant" } ]
code_store-components_ece108bf
[ { "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": "system" }, { "content": "Explain the code in store-components/react/typings/vtex.device-detector.d.ts.", "role": "user" }, { "content": "Here's how it works:\n\n```typescript\ndeclare module 'vtex.device-detector' {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const useDevice: any\n}\n\n```", "role": "assistant" } ]
code_order-placed_139e1fb2
[ { "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": "system" }, { "content": "Explain the code in order-placed/react/mocks/bankInvoiceNotLoggedIn.ts.", "role": "user" }, { "content": "Here's the implementation:\n\n```typescript\nexport const orderGroupQuery = {\n orderGroup: {\n orders: [\n {\n allowCancellation: true,\n orderId: '908791797598-01',\n deliveryParcels: [\n {\n address: {\n addressType: 'residential',\n receiverName: 'Victor Hugo',\n state: 'RJ',\n street: 'Praia de Botafogo',\n number: '300',\n city: 'Rio de Janeiro',\n postalCode: '22250-040',\n neighborhood: 'Botafogo',\n complement: null,\n country: 'BRA',\n },\n price: 500,\n pickupFriendlyName: null,\n seller: '1',\n items: [\n {\n id: '282',\n skuName: 'Tipo 1',\n name: 'Delivery 1 SLA | 1 Tipo 1',\n price: 1200,\n listPrice: 1200,\n isGift: false,\n quantity: 1,\n attachments: [],\n bundleItems: [],\n seller: '1',\n imageUrl:\n 'http://vtexgame1.vteximg.com.br/arquivos/ids/155641-55-55/bola.jpg?v=636626686154400000',\n detailUrl: '/teste-so-delivery/p',\n measurementUnit: 'un',\n unitMultiplier: 1,\n },\n ],\n selectedSla: 'PAC',\n selectedSlaObj: {\n id: 'PAC',\n name: 'PAC',\n shippingEstimate: '8bd',\n deliveryWindow: null,\n price: 500,\n deliveryChannel: 'delivery',\n pickupStoreInfo: {\n additionalInfo: null,\n address: null,\n friendlyName: null,\n isPickupStore: false,\n },\n },\n shippingEstimate: '8bd',\n shippingEstimateDate: null,\n deliveryWindow: null,\n deliveryChannel: 'delivery',\n selectedSlaType: 'delivery',\n },\n ],\n pickUpParcels: [],\n takeAwayParcels: [],\n items: [\n {\n id: '282',\n skuName: 'Tipo 1',\n name: 'Delivery 1 SLA | 1 Tipo 1',\n price: 1200,\n listPrice: 1200,\n isGift: false,\n quantity: 1,\n attachments: [],\n bundleItems: [],\n seller: '1',\n imageUrl:\n 'http://vtexgame1.vteximg.com.br/arquivos/ids/155641-55-55/bola.jpg?v=636626686154400000',\n detailUrl: '/teste-so-delivery/p',\n measurementUnit: 'un',\n unitMultiplier: 1,\n },\n ],\n sellers: [\n {\n id: '1',\n name: 'vtexgame1',\n },\n ],\n totals: [\n {\n id: 'Items',\n name: 'Total dos Itens',\n value: 1200,\n },\n {\n id: 'Discounts',\n name: 'Total dos Descontos',\n value: 0,\n },\n {\n id: 'Shipping',\n name: 'Total do Frete',\n value: 500,\n },\n {\n id: 'Tax',\n name: 'Total da Taxa',\n value: 0,\n },\n ],\n clientProfileData: {\n email: '[email protected]',\n firstName: 'Victor',\n lastName: 'Hugo',\n document: '18430995005',\n documentType: 'cpf',\n phone: '+551112340909',\n },\n paymentData: {\n transactions: [\n {\n transactionId: 'AD0E4AF970E8490A85C5BE29E1066F27',\n payments: [\n {\n id: '39F4569C6A3440FE8CA4453DAC02CDB0',\n paymentSystem: '6',\n paymentSystemName: 'Boleto Bancário',\n value: 1700,\n installments: 1,\n lastDigits: null,\n group: 'bankInvoice',\n dueDate: '2018-12-09',\n url:\n '*t*p*:*/*a*a*k*t*l*c*.*t*x*a*m*n*s*c*m*b*:*4*/*a*k*s*u*d*n*o*c*/*r*n*a*t*o*/*9*C*4*B*0*D*2*8*7*1*3*3*8*6*1*5*P*y*e*t*0*F*5*F*C*7*4*7*A*8*4*6*1*4*9*8*/*n*t*l*m*n*/*I*s*a*l*e*t*',\n bankIssuedInvoiceBarCodePNG: null,\n bankIssuedInvoiceIdentificationNumber: null,\n connectorResponses: null,\n },\n ],\n },\n ],\n },\n storePreferencesData: {\n countryCode: 'BRA',\n currencyCode: 'BRL',\n },\n creationDate: '2019-02-06T15:30:07.5855509Z',\n value: 1700,\n },\n ],\n totalPickUpParcels: [],\n totalDeliveryParcels: [\n {\n address: {\n addressType: 'residential',\n receiverName: 'Victor Hugo',\n state: 'RJ',\n street: 'Praia de Botafogo',\n number: '300',\n city: 'Rio de Janeiro',\n postalCode: '22250-040',\n neighborhood: 'Botafogo',\n complement: null,\n country: 'BRA',\n },\n price: 500,\n pickupFriendlyName: null,\n seller: '1',\n items: [\n {\n id: '282',\n skuName: 'Tipo 1',\n name: 'Delivery 1 SLA | 1 Tipo 1',\n price: 1200,\n listPrice: 1200,\n isGift: false,\n quantity: 1,\n attachments: [],\n bundleItems: [],\n seller: '1',\n imageUrl:\n 'http://vtexgame1.vteximg.com.br/arquivos/ids/155641-55-55/bola.jpg?v=636626686154400000',\n detailUrl: '/teste-so-delivery/p',\n measurementUnit: 'un',\n unitMultiplier: 1,\n },\n ],\n selectedSla: 'PAC',\n selectedSlaObj: {\n id: 'PAC',\n name: 'PAC',\n shippingEstimate: '8bd',\n deliveryWindow: null,\n price: 500,\n deliveryChannel: 'delivery',\n pickupStoreInfo: {\n additionalInfo: null,\n address: null,\n friendlyName: null,\n isPickupStore: false,\n },\n },\n shippingEstimate: '8bd',\n shippingEstimateDate: null,\n deliveryWindow: null,\n deliveryChannel: 'delivery',\n selectedSlaType: 'delivery',\n },\n ],\n totalTakeAwayParcels: [],\n },\n}\n\n```", "role": "assistant" } ]
code_mycheckout-checkout-service_3183c781
[ { "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": "system" }, { "content": "Explain the code in mycheckout-checkout-service/src/shared/responses/old-exceptions.ts.", "role": "user" }, { "content": "Here's the implementation:\n\n```typescript\nimport { HttpException } from '@nestjs/common';\n\nexport class OldException extends HttpException {\n constructor(response: string | Record<string, any>, status: number) {\n super(response, status);\n }\n}\n\n```", "role": "assistant" } ]
code_text-link-fixer_eaf14a6b
[ { "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": "system" }, { "content": "What npm dependencies does text-link-fixer use?", "role": "user" }, { "content": "Here's the package config:\n\n```json\n{\n \"name\": \"test-link-fixer\",\n \"private\": true,\n \"license\": \"UNLICENSED\",\n \"scripts\": {\n \"lint\": \"eslint --ext js,jsx,ts,tsx .\",\n \"format\": \"prettier --write \\\"**/*.{ts,tsx,js,jsx,json}\\\"\"\n },\n \"husky\": {\n \"hooks\": {\n \"pre-commit\": \"lint-staged\"\n }\n },\n \"lint-staged\": {\n \"*.{ts,js,tsx,jsx}\": [\n \"eslint --fix\",\n \"prettier --write\"\n ],\n \"*.{json,graphql,gql}\": [\n \"prettier --write\"\n ]\n },\n \"devDependencies\": {\n \"@types/node\": \"^12.12.21\",\n \"@vtex/prettier-config\": \"^0.3.1\",\n \"@vtex/danger\": \"^0.2.7\",\n \"eslint\": \"^6.8.0\",\n \"eslint-config-vtex\": \"^12.7.0\",\n \"husky\": \"^4.2.0\",\n \"lint-staged\": \"^10.0.2\",\n \"prettier\": \"^2.0.5\",\n \"typescript\": \"^3.9.6\"\n }\n}\n\n```", "role": "assistant" } ]
code_return-app_f938bc27
[ { "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": "system" }, { "content": "What props does Payment Options accept and how do I configure them?", "role": "user" }, { "content": "Here's the implementation:\n\n```tsx\nimport type { ChangeEvent, ComponentPropsWithoutRef } from 'react'\nimport React, { forwardRef } from 'react'\nimport type { IntlShape } from 'react-intl'\nimport { defineMessages, FormattedMessage, useIntl } from 'react-intl'\nimport type { PaymentType } from 'vtex.return-app'\nimport { Toggle, CheckboxGroup } from 'vtex.styleguide'\n\nimport { useSettings } from '../hooks/useSettings'\nimport type { CheckboxProps } from '../RMASettings'\n\nconst messages = defineMessages({\n bank: {\n id: 'admin/return-app.settings.section.payment-options.available-payment-methods.bank',\n },\n card: {\n id: 'admin/return-app.settings.section.payment-options.available-payment-methods.card',\n },\n giftCard: {\n id: 'admin/return-app.settings.section.payment-options.available-payment-methods.gift-card',\n },\n})\n\nconst createOptionsLabel = (\n paymentsTypeOptions: PaymentType,\n intl: IntlShape\n) => {\n if (!paymentsTypeOptions) return null\n\n const paymentTypes = Object.keys(paymentsTypeOptions)\n const createCheckoutOptions = paymentTypes.reduce(\n (checkoutOptions, paymentType) => {\n // This handles the field __typename that comes from the GraphQL query\n if (!messages[paymentType]) return checkoutOptions\n\n return {\n ...checkoutOptions,\n [paymentType]: {\n label: intl.formatMessage(messages[paymentType]),\n checked: paymentsTypeOptions[paymentType],\n name: paymentType,\n },\n }\n },\n {} as { string: CheckboxProps }\n )\n\n return createCheckoutOptions\n}\n\ninterface PaymentOptionsProps extends ComponentPropsWithoutRef<'div'> {\n handleOptionSelection: (options: { string: CheckboxProps }) => void\n hasError: boolean\n}\n\nexport const PaymentOptions = forwardRef<HTMLDivElement, PaymentOptionsProps>(\n ({ handleOptionSelection, hasError }, ref) => {\n const {\n appSettings,\n actions: { dispatch },\n } = useSettings()\n\n const intl = useIntl()\n\n const optionsLabel = createOptionsLabel(\n appSettings?.paymentOptions?.allowedPaymentTypes,\n intl\n )\n\n const handleEnablePaymentMethodSelection = (\n e: ChangeEvent<HTMLInputElement>\n ) => {\n const { checked } = e.target\n\n dispatch({\n type: 'updatePaymentOptions',\n payload: {\n ...appSettings?.paymentOptions,\n enablePaymentMethodSelection: checked,\n allowedPaymentTypes: appSettings.paymentOptions.allowedPaymentTypes,\n // Always return to the default state when use checks / unchecks the checkbox. This way we avaiod a confusing state where buttons is disable but set to on.\n automaticallyRefundPaymentMethod: false,\n },\n })\n }\n\n const handleAutomaticallyRefundOption = (\n e: ChangeEvent<HTMLInputElement>\n ) => {\n const { checked } = e.target\n\n dispatch({\n type: 'updatePaymentOptions',\n payload: {\n ...appSettings?.paymentOptions,\n automaticallyRefundPaymentMethod: checked,\n },\n })\n }\n\n const { enablePaymentMethodSelection, automaticallyRefundPaymentMethod } =\n appSettings.paymentOptions ?? {}\n\n return (\n <section>\n <h3>\n <FormattedMessage id=\"admin/return-app.settings.section.return-payment-options.header\" />\n </h3>\n <div className=\"mb4 mh4\">\n <div className=\"mb4\">\n <Toggle\n label={\n enablePaymentMethodSelection ? (\n <FormattedMessage id=\"admin/return-app.settings.section.payment-options.enable-payment-method-selection.label.check\" />\n ) : (\n <FormattedMessage id=\"admin/return-app.settings.section.payment-options.enable-payment-method-selection.label.uncheck\" />\n )\n }\n checked={enablePaymentMethodSelection}\n semantic\n onChange={handleEnablePaymentMethodSelection}\n helpText={\n <FormattedMessage id=\"admin/return-app.settings.section.payment-options.enable-payment-method-selection.description\" />\n }\n />\n </div>\n <div className=\"mb4\">\n <Toggle\n label={\n <FormattedMessage id=\"admin/return-app.settings.section.payment-options.refund-method-strategy.checkbox.label\" />\n }\n checked={automaticallyRefundPaymentMethod}\n semantic\n helpText={\n <FormattedMessage id=\"admin/return-app.settings.section.payment-options.refund-method-strategy.checkbox.description\" />\n }\n onChange={handleAutomaticallyRefundOption}\n disabled={enablePaymentMethodSelection}\n />\n </div>\n {enablePaymentMethodSelection && optionsLabel ? (\n <div ref={ref}>\n <h4>\n <FormattedMessage id=\"admin/return-app.settings.section.payment-options.available-payment-methods.header\" />\n </h4>\n <CheckboxGroup\n name=\"paymentMethods\"\n label={\n <FormattedMessage id=\"admin/return-app.settings.section.payment-options.available-payment-methods.label\" />\n }\n checkedMap={optionsLabel}\n onGroupChange={handleOptionSelection}\n />\n {!hasError ? null : (\n <p className=\"c-danger i t-small mt3 lh-title\">\n <FormattedMessage id=\"admin/return-app.settings.section.payment-options.enable-payment-method-selection.error\" />\n </p>\n )}\n </div>\n ) : null}\n </div>\n </section>\n )\n }\n)\n\n```", "role": "assistant" } ]
code_return-app_e6b0cc21
[ { "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": "system" }, { "content": "What npm dependencies does return-app use?", "role": "user" }, { "content": "Here's the package config:\n\n```json\n{\n \"dependencies\": {\n \"@vtex/api\": \"6.48.0\",\n \"@vtex/clients\": \"^2.21.0\",\n \"co-body\": \"^6.0.0\",\n \"graphql\": \"^14.0.0\",\n \"graphql-tools\": \"^4.0.0\",\n \"html-template-tag\": \"^4.0.1\"\n },\n \"devDependencies\": {\n \"@types/co-body\": \"^0.0.3\",\n \"@types/jest\": \"^24.0.18\",\n \"@types/node\": \"^12.0.0\",\n \"@vtex/api\": \"6.48.0\",\n \"@vtex/test-tools\": \"^1.0.0\",\n \"@vtex/tsconfig\": \"^0.6.0\",\n \"tslint\": \"^6.1.3\",\n \"tslint-config-vtex\": \"^2.1.0\",\n \"vtex.catalog-graphql\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.catalog-graphql\",\n \"vtex.css-handles\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.css-handles\",\n \"vtex.easypost\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.easypost\",\n \"vtex.format-currency\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.format-currency\",\n \"vtex.my-account\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.my-account\",\n \"vtex.my-account-commons\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.my-account-commons\",\n \"vtex.render-runtime\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.render-runtime\",\n \"vtex.return-app\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.return-app\",\n \"vtex.styleguide\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.styleguide\",\n \"vtex.tenant-graphql\": \"http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.tenant-graphql\"\n },\n \"scripts\": {\n \"lint\": \"tsc --noEmit --pretty && tslint -c tslint.json --fix './**/*.ts'\"\n },\n \"version\": \"3.11.0\"\n}\n\n```", "role": "assistant" } ]
code_KI-739693_1519dcb2
[ { "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": "system" }, { "content": "Show me the implementation of KI-739693/dangerfile.js from KI-739693.", "role": "user" }, { "content": "Here's the source code:\n\n```javascript\n// dangerfile.js\nconst { verify } = require('@vtex/danger')\n\nconst config = {\n // Set to true to enforce keepachangelog rules.\n keepachangelog: {\n changeVersion: false,\n },\n rules: {\n description: ['fail', { minLength: 20 }],\n assignee: 'fail',\n reviewers: 'fail',\n pr_size: ['warn', { additionLimit: 800, deletionLimit: -1 }],\n lock_file: 'warn',\n no_ignored_test: ['fail', { pattern: /test|spec/i }],\n no_debugger: ['fail', { pattern: /\\.[tj]sx?$/i }],\n enforce_graphql_provider: 'off',\n },\n}\n\nverify(config)\n\n```", "role": "assistant" } ]
code_mycheckout-checkout-service_df099dce
[ { "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": "system" }, { "content": "Show me the implementation of mycheckout-checkout-service/src/app.module.ts from mycheckout-checkout-service.", "role": "user" }, { "content": "The implementation is:\n\n```typescript\nimport i18nConfig from 'src/config/i18n';\nimport { Module } from '@nestjs/common';\nimport { I18nModule } from 'nestjs-i18n';\nimport { APP_FILTER, APP_INTERCEPTOR } from '@nestjs/core';\nimport { ConfigModule } from '@nestjs/config';\nimport { HealthController } from './app/health/health.controller';\nimport { AccountsModule } from './app/accounts/accounts.module';\nimport { UsersModule } from './app/users/users.module';\nimport { MastersModule } from './app/masters/masters.module';\nimport { OrdersModule } from './app/orders/orders.module';\nimport { VtexModule } from './app/vtex/vtex.module';\nimport { PaymentProvidersModule } from './app/payment-providers/payment-providers.module';\nimport { CommonModule } from './app/common/common.module';\nimport { ChannelsModule } from './app/channels/channels.module';\nimport { OmsModule } from './app/oms/oms.module';\nimport configuration from './config/configuration';\nimport { AllResponsesInterceptor } from './shared/responses/all-responses.interceptor';\nimport { AllExceptionsFilter } from './shared/responses/all-exceptions.filter';\nimport { ExistsRule } from './shared/validation/rules/exists.rule';\nimport dynamodbConfig from './config/dynamodb';\nimport { CustomDynamooseModule } from './shared/utils/dynamoose-module';\n\nexport const environment = process.env.NODE_ENV\n ? process.env.NODE_ENV\n : 'development';\n\nexport const isContainer = process.env.CONTAINER == 'docker';\n\n@Module({\n imports: [\n /*General Modules*/\n CustomDynamooseModule.forRootAsync(dynamodbConfig()),\n ConfigModule.forRoot({\n ...(isContainer\n ? {\n envFilePath: ['/config/.env'],\n load: [configuration],\n }\n : {\n envFilePath: ['.env.local'],\n }),\n isGlobal: true,\n }),\n I18nModule.forRoot(i18nConfig()),\n /*Internal Modules*/\n OrdersModule,\n VtexModule,\n AccountsModule,\n UsersModule,\n MastersModule,\n PaymentProvidersModule,\n CommonModule,\n ChannelsModule,\n OmsModule,\n ],\n providers: [\n {\n provide: APP_INTERCEPTOR,\n useClass: AllResponsesInterceptor,\n },\n {\n provide: APP_FILTER,\n useClass: AllExceptionsFilter,\n },\n ExistsRule,\n ],\n controllers: [HealthController],\n})\nexport class AppModule {}\n\n```", "role": "assistant" } ]
code_mycheckout-store-framework_e0cafff3
[ { "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": "system" }, { "content": "Show me the backend implementation from mycheckout-store-framework.", "role": "user" }, { "content": "Here's how it works:\n\n```typescript\ninterface PaginatedCountriesResponse {\n count: number\n total: number\n current: number\n prev: number\n next: number\n data: Countries[]\n}\n\ninterface Countries {\n id: string\n country: string\n iso: string\n phone: string\n postal_code_regex: string\n states: States[]\n}\n\ninterface States {\n state: string\n cities: Cities[]\n}\n\ninterface Cities {\n city_id: string\n city: string\n}\n\ninterface CountriesServiceImpl {\n getCountries(): unknown\n getCountry(id: string): unknown\n getStateCities(country: string, state: string): unknown\n}\n\n```", "role": "assistant" } ]
code_b2cstoreqa.theme_39185db9
[ { "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": "system" }, { "content": "Show me the CSS/SCSS implementation from b2cstoreqa.theme.", "role": "user" }, { "content": "The implementation is:\n\n```css\n.drawerContainer {\n z-index: 6;\n}\n\n.productSelectorContainer {\n opacity: 0;\n transition: all 0.3s ease;\n}\n\n.productSelectorContainer :global(.vtex-checkbox__line-container) {\n justify-content: center;\n}\n\n.productSelectorContainer :global(.vtex-checkbox__label) {\n width: auto;\n}\n\n.productSelectorContainer :global(.vtex-checkbox__inner-container) {\n width: 20px;\n height: 20px;\n border-width: 1px;\n}\n\n.productSelectorContainer :global(.vtex-checkbox__container),\n.productSelectorContainer :global(.vtex-checkbox__input) {\n width: 20px;\n height: 20px;\n}\n\n.imageElement--paymentImage {\n margin: 0px auto;\n}\n.showDifferencesContainer :global(.vtex-checkbox__inner-container),\n.productSelectorContainer :global(.vtex-checkbox__inner-container) {\n border-color: #a3afbc;\n}\n\n.productSelectorContainer :global(.vtex-checkbox__box-wrapper) {\n width: 20px;\n height: 20px;\n}\n\n.productSelectorContainer :global(.vtex__icon-check) {\n width: 16px;\n height: 16px;\n}\n\n```", "role": "assistant" } ]
code_fanplayr_fc46d8ee
[ { "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": "system" }, { "content": "What npm dependencies does fanplayr use?", "role": "user" }, { "content": "Here's the package config:\n\n```json\n{\n \"scripts\": {\n \"test\": \"vtex-test-tools test\"\n },\n \"dependencies\": {\n \"ramda\": \"^0.26.1\"\n },\n \"devDependencies\": {\n \"@apollo/react-testing\": \"^3.1.3\",\n \"@types/graphql\": \"^14.5.0\",\n \"@types/jest\": \"^24.9.0\",\n \"@types/node\": \"^13.1.8\",\n \"@types/ramda\": \"^0.26.5\",\n \"@types/react\": \"^16.9.19\",\n \"@types/react-intl\": \"^3.0.0\",\n \"@vtex/test-tools\": \"^3.0.1\",\n \"apollo-cache-inmemory\": \"^1.6.5\",\n \"apollo-client\": \"^2.6.8\",\n \"eslint\": \"^5.16.0\",\n \"eslint-config-vtex-react\": \"^4.1.0\",\n \"graphql\": \"^14.5.4\",\n \"prettier\": \"^1.18.2\",\n \"react-intl\": \"^3.11.0\",\n \"tslint-eslint-rules\": \"^5.4.0\",\n \"typescript\": \"3.5.2\"\n }\n}\n\n```", "role": "assistant" } ]
code_store-on-localhost_66f8594f
[ { "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": "system" }, { "content": "Explain the code in store-on-localhost/src/monobloco/components/new/VtexId/utils/constants.js.", "role": "user" }, { "content": "Here's the implementation:\n\n```javascript\nconst TEN_MINUTES = 600000\n\nconst constants = {\n OAuthCallbackUrl: '/api/vtexid/oauth/finish?popup=false',\n OAuthPopupCallbackUrl:\n '/api/vtexid/pub/authentication/finish?sessionRedirect=false',\n ReCAPTCHA: {\n SiteKey: '6LejYzMUAAAAADEaWZnPjOBiyqxE7cvnKpC8kz5F',\n Size: 'invisible',\n },\n SessionDuration: TEN_MINUTES,\n Scopes: {\n ADMIN: 'ADMIN',\n STORE: 'STORE',\n },\n ApiAuthStatus: {\n Success: 'Success',\n WrongCredentials: 'WrongCredentials',\n InativeUser: 'InativeUser',\n BlockedUser: 'BlockedUser',\n MultipleAccount: 'MultipleAccount',\n Pending: 'Pending',\n CanceledKey: 'CanceledKey',\n InvalidToken: 'InvalidToken',\n Error: 'Error',\n CanceledByUser: 'CanceledByUser',\n WeakPassword: 'WeakPassword',\n RequiresMFA: 'RequiresMFA',\n RequiresPhoneRegistration: 'RequiresPhoneRegistration',\n InvalidMFAToken: 'InvalidMFAToken',\n MissingPhoneNumber: 'MissingPhoneNumber',\n InvalidMFAState: 'InvalidMFAState',\n CanRegisterPhoneNumber: 'CanRegisterPhoneNumber',\n InvalidPhoneNumber: 'InvalidPhoneNumber',\n RequiresMFAAuthenticator: 'RequiresMFAAuthenticator',\n PasswordAlreadyUsed: 'PasswordAlreadyUsed',\n ExpiredPassword: 'ExpiredPassword',\n InvalidEmail: 'InvalidEmail',\n InvalidRecaptcha: 'InvalidRecaptcha',\n },\n}\n\nexport default constants\n\n```", "role": "assistant" } ]
code_store-on-localhost_afbc8702
[ { "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": "system" }, { "content": "Explain the code in store-on-localhost/src/monobloco/components/new/LocaleSwitcher/typings/vtex.styleguide.d.ts.", "role": "user" }, { "content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.styleguide' {\n import { ComponentType } from 'react'\n\n export const Input: ComponentType<InputProps>\n\n interface InputProps {\n [key: string]: any\n }\n}\n\n```", "role": "assistant" } ]
code_shelf-components_5c056d40
[ { "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": "system" }, { "content": "What are the key features of shelf-components?", "role": "user" }, { "content": "```markdown\n📢 Use this project, [contribute](https://github.com/vtex-apps/shelf-components) to it or open issues to help evolve it. \n\n# Shelf Components\n\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n\nVTEX Shelf Components is a collection of components that can be used to create shelves in your store, which are responsible for displaying a list of products.\n\n:loudspeaker: **Disclaimer:** Don't fork this project; use, contribute, or open issue with your feature request.\n\n## Table of Contents\n\n- [Usage](#usage)\n - [Styles API](#styles-api)\n- [Components Specs](#components-specs)\n- [Troubleshooting](#troubleshooting)\n- [Contributing](#contributing)\n\n## Usage\n\nThis app uses our store builder with the blocks architecture. To know more about Store Builder [click here.](https://help.vtex.com/en/tutorial/understanding-storebuilder-and-stylesbuilder#structuring-and-configuring-our-store-with-object-object)\n\nTo use this app, you need to import in your dependencies on `manifest.json`.\n\n```json\n \"dependencies\": {\n \"vtex.shelf-components\": \"0.x\"\n }\n```\n\n### Styles API\n\nThis app provides some CSS classes as an API for style customization.\n\nTo use this CSS API, you must add the `styles` builder and create an app styling CSS file.\n\n1. Add the `styles` builder to your `manifest.json`:\n\n```json\n \"builders\": {\n \"styles\": \"1.x\"\n }\n```\n\n2. Create a file called `vtex.shelf-components.css` inside the `styles/css` folder. Add your custom styles:\n\n```css\n.container {\n margin-top: 10px;\n}\n```\n\n## Components Specs\n\nBelow we have a README for each component of this project that explains how to use them.\n\n- [Shelf](Shelf.md)\n- [Refresh Shelf](RefreshShelf.md)\n\n## Troubleshooting\n\nYou can check if others are passing through similar issues [here](https://github.com/vtex-apps/shelf-components/issues). Also feel free to [open issues](https://github.com/vtex-apps/shelf-components/issues/new) or contribute with pull requests.\n\n## Contributing\n\nCheck it out [how to contribute](https://github.com/vtex-apps/awesome-io#contributing) with this project.\n\n<!-- DOCS-IGNORE:start -->\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n <tr>\n <td align=\"center\"><a href=\"https://github.com/pgrimaud\"><img src=\"https://avatars1.githubusercontent.com/u/1866496?v=4\" width=\"100px;\" alt=\"\"/><br /><sub><b>Pierre Grimaud</b></sub></a><br /><a href=\"https://github.com/vtex-apps/shelf-components/commits?author=pgrimaud\" title=\"Documentation\">📖</a></td>\n </tr>\n</table>\n\n<!-- markdownlint-enable -->\n<!-- prettier-ignore-end -->\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n<!-- DOCS-IGNORE:end -->\n\n```", "role": "assistant" } ]
code_community_b758d8e5
[ { "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": "system" }, { "content": "Show me the implementation of community/vtex-courses/courses/service-course/steps/05_events-triggers/answersheet/liveUsersUpdate.ts from community.", "role": "user" }, { "content": "Here's the source code:\n\n```typescript\n// node/event/liveUsersUpdate.ts\nimport { Clients } from '../clients/index'\nimport { EventContext } from '@vtex/api'\n\nexport async function updateLiveUsers(ctx: EventContext<Clients>) {\n const liveUsersProducts = await ctx.clients.analytics.getLiveUsers()\n console.log('LIVE USERS: ', liveUsersProducts)\n return true\n}\n\n```", "role": "assistant" } ]
code_biggy-bookstore-theme_51f54dbc
[ { "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": "system" }, { "content": "Explain the code in biggy-bookstore-theme/store/blocks/landing-page.jsonc.", "role": "user" }, { "content": "This is the code:\n\n```jsonc\n{\n \"store.custom#landing-page\": {\n \"blocks\": [\n \"flex-layout.row#banner-lp\",\n \"responsive-layout.phone#lp1\",\n \"flex-layout.row#landing-page1\",\n \"responsive-layout.phone#lp2\",\n \"flex-layout.row#landing-page2\",\n \"responsive-layout.phone#lp3\",\n \"flex-layout.row#landing-page3\"\n ]\n },\n\n \"flex-layout.row#banner-lp\": {\n \"props\": {\n \"fullWidth\": true,\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"image#banner-lp\"\n ]\n },\n\n \"image#banner-lp\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerlp___c4ffc133e9dbf6562aadefc3f7e97f11.png\",\n \"alt\": \"Landing Page Banner\"\n }\n },\n\n \"flex-layout.row#landing-page1\": {\n \"props\": {\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"flex-layout.col#lp1-products\",\n \"responsive-layout.desktop#lp1\"\n ]\n },\n\n \"responsive-layout.desktop#lp1\": {\n \"children\": [\n \"flex-layout.col#lp1-card\"\n ]\n },\n\n \"responsive-layout.phone#lp1\": {\n \"children\": [\n \"flex-layout.row#lp1-card-phone\"\n ]\n },\n\n \"flex-layout.col#lp1-products\": {\n \"props\": {\n \"width\": \"70%\"\n },\n \"children\": [\n \"flex-layout.row#lp1-products\"\n ]\n },\n\n \"flex-layout.row#lp1-products\": {\n \"children\": [\n \"shelf#lp1-products\"\n ]\n },\n\n \"shelf#lp1-products\": {\n \"blocks\": [\n \"product-summary.shelf#sku\"\n ],\n \"props\": {\n \"category\": \"1/9\",\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"productList\": {\n \"maxItems\": 10,\n \"itemsPerPage\": 3,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"showTitle\": false,\n \"hideUnavailableItems\": true,\n \"summary\": {\n \"isOneClickBuy\": false,\n \"showBadge\": true,\n \"badgeText\": \"OFF\",\n \"buyButtonText\": \"Comprar\",\n \"displayBuyButton\": \"displayButtonHover\",\n \"showCollections\": false,\n \"showListPrice\": true,\n \"showLabels\": false,\n \"showInstallments\": true,\n \"showSavings\": true,\n \"name\": {\n \"showBrandName\": false,\n \"showSku\": false,\n \"showProductReference\": false\n }\n }\n }\n }\n },\n\n \"flex-layout.col#lp1-card\": {\n \"props\": {\n \"width\": \"30%\",\n \"verticalAlign\": \"middle\",\n \"horizontalAlign\": \"right\"\n },\n \"children\": [\n \"image#lp1-card\"\n ]\n },\n\n \"flex-layout.row#lp1-card-phone\": {\n \"props\": {\n \"marginTop\": 6,\n \"verticalAlign\": \"middle\",\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"image#lp1-card-phone\"\n ]\n },\n\n \"image#lp1-card\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerlp2___5c1534ae7ca0bc36356136d1ccac648d.png\"\n }\n },\n\n \"image#lp1-card-phone\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerlp2flipsmall___7f3a4abb4b6347751efa5330ac61f563.png\"\n }\n },\n\n \"flex-layout.row#landing-page2\": {\n \"props\": {\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"responsive-layout.desktop#lp2\",\n \"flex-layout.col#lp2-products\"\n ]\n },\n\n \"responsive-layout.desktop#lp2\": {\n \"children\": [\n \"flex-layout.col#lp2-card\"\n ]\n },\n\n \"responsive-layout.phone#lp2\": {\n \"children\": [\n \"flex-layout.row#lp2-card-phone\"\n ]\n },\n\n \"flex-layout.col#lp2-card\": {\n \"props\": {\n \"width\": \"30%\",\n \"verticalAlign\": \"middle\",\n \"horizontalAlign\": \"left\"\n },\n \"children\": [\n \"image#lp2-card\"\n ]\n },\n\n \"flex-layout.row#lp2-card-phone\": {\n \"props\": {\n \"verticalAlign\": \"middle\",\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"image#lp2-card-phone\"\n ]\n },\n\n \"image#lp2-card\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerlp2flip___6d82e6686be9c73a77ada8afe817e53a.png\"\n }\n },\n\n \"image#lp2-card-phone\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerlp2small___a13366cc34cc7ba994c15416887835e4.png\"\n }\n },\n\n \"flex-layout.col#lp2-products\": {\n \"props\": {\n \"width\": \"70%\"\n },\n \"children\": [\n \"flex-layout.row#lp2-products\"\n ]\n },\n\n \"flex-layout.row#lp2-products\": {\n \"children\": [\n \"shelf#lp2-products\"\n ]\n },\n\n \"shelf#lp2-products\": {\n \"blocks\": [\n \"product-summary.shelf#sku\"\n ],\n \"props\": {\n \"category\": \"1/6\",\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"productList\": {\n \"maxItems\": 10,\n \"itemsPerPage\": 3,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"showTitle\": false,\n \"hideUnavailableItems\": true,\n \"summary\": {\n \"isOneClickBuy\": false,\n \"showBadge\": true,\n \"badgeText\": \"OFF\",\n \"buyButtonText\": \"Comprar\",\n \"displayBuyButton\": \"displayButtonHover\",\n \"showCollections\": false,\n \"showListPrice\": true,\n \"showLabels\": false,\n \"showInstallments\": true,\n \"showSavings\": true,\n \"name\": {\n \"showBrandName\": false,\n \"showSku\": false,\n \"showProductReference\": false\n }\n }\n }\n }\n },\n\n \"flex-layout.row#landing-page3\": {\n \"props\": {\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"flex-layout.col#lp3-products\",\n \"responsive-layout.desktop#lp3\"\n ]\n },\n\n \"responsive-layout.phone#lp3\": {\n \"children\": [\n \"flex-layout.row#lp3-card-phone\"\n ]\n },\n\n \"responsive-layout.desktop#lp3\": {\n \"children\": [\n \"flex-layout.col#lp3-card\"\n ]\n },\n\n \"flex-layout.col#lp3-products\": {\n \"props\": {\n \"width\": \"70%\"\n },\n \"children\": [\n \"flex-layout.row#lp3-products\"\n ]\n },\n\n \"flex-layout.row#lp3-products\": {\n \"children\": [\n \"shelf#lp3-products\"\n ]\n },\n\n \"shelf#lp3-products\": {\n \"blocks\": [\n \"product-summary.shelf#sku\"\n ],\n \"props\": {\n \"category\": \"1/8\",\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"productList\": {\n \"maxItems\": 10,\n \"itemsPerPage\": 3,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"showTitle\": false,\n \"hideUnavailableItems\": true,\n \"summary\": {\n \"isOneClickBuy\": false,\n \"showBadge\": true,\n \"badgeText\": \"OFF\",\n \"buyButtonText\": \"Comprar\",\n \"displayBuyButton\": \"displayButtonHover\",\n \"showCollections\": false,\n \"showListPrice\": true,\n \"showLabels\": false,\n \"showInstallments\": true,\n \"showSavings\": true,\n \"name\": {\n \"showBrandName\": false,\n \"showSku\": false,\n \"showProductReference\": false\n }\n }\n }\n }\n },\n\n \"flex-layout.col#lp3-card\": {\n \"props\": {\n \"width\": \"30%\",\n \"verticalAlign\": \"middle\",\n \"horizontalAlign\": \"right\"\n },\n \"children\": [\n \"image#lp3-card\"\n ]\n },\n\n \"flex-layout.row#lp3-card-phone\": {\n \"props\": {\n \"verticalAlign\": \"middle\",\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"image#lp3-card-phone\"\n ]\n },\n\n \"image#lp3-card\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerlp2___5c1534ae7ca0bc36356136d1ccac648d.png\"\n }\n },\n\n \"image#lp3-card-phone\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerlp2flipsmall___7f3a4abb4b6347751efa5330ac61f563.png\"\n }\n }\n} \n```", "role": "assistant" } ]
code_mycheckout-checkout-service_403a4833
[ { "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": "system" }, { "content": "Show me the implementation of mycheckout-checkout-service/src/app/users/cards/schemas/cards.schema.ts from mycheckout-checkout-service.", "role": "user" }, { "content": "Here's the implementation:\n\n```typescript\nimport {\n Model,\n Document,\n Schema,\n ModelDefinition,\n} from 'src/shared/utils/dynamoose-module';\nimport { Profile, ProfileDoc } from '../../profiles/schemas/profile.schema';\nimport { User, UserDoc } from '../../schemas/user.schema';\n\nenum franchise {\n 'vi' = 'visa',\n 'visa' = 'vi',\n 'mc' = 'master',\n 'master' = 'master',\n 'di' = 'diner',\n 'diner' = 'diner',\n 'amex' = 'amex',\n}\n\ninterface CardAttrs {\n franchise: string;\n number: string;\n token?: string;\n gateway: string;\n profile: ProfileDoc;\n user: UserDoc;\n bin?: string;\n cvv?: string;\n holderName?: string;\n holderDocument?: string;\n expirationDate?: string;\n cardNumber?: string;\n aliasCC?: string;\n aliasCVV?: string;\n accountId?: string;\n paymentSystem?: string;\n cardContent?: Record<string, any>;\n internalCardContent?: Record<string, any>;\n}\n\nexport interface CardDoc extends Document {\n franchise: string;\n number: string;\n token?: string;\n gateway: string;\n profile: ProfileDoc;\n user: UserDoc;\n bin?: string;\n cvv?: string;\n holderName?: string;\n holderDocument?: string;\n expirationDate?: string;\n aliasCC?: string;\n aliasCVV?: string;\n accountId?: string;\n cardNumber?: string;\n paymentSystem?: string;\n cardContent?: Record<string, any>;\n internalCardContent?: Record<string, any>;\n}\n\nexport type CardModel = Model<CardDoc, CardAttrs>;\n\nexport const CardSchema = Schema.build({\n franchise: { type: String, required: true },\n number: { type: String, required: true },\n token: { type: String },\n gateway: { type: String, required: true },\n bin: { type: String },\n cvv: { type: String },\n paymentSystem: { type: String },\n holderName: { type: String },\n holderDocument: { type: String },\n expirationDate: { type: String },\n cardNumber: { type: String },\n aliasCC: { type: String },\n aliasCVV: { type: String },\n accountId: { type: String },\n cardContent: Object,\n internalCardContent: Object,\n});\n\nexport const Card: ModelDefinition = {\n name: 'cards',\n schema: CardSchema,\n methods: {\n transform: (ret: CardDoc) => {\n ret.franchise = franchise[ret.franchise];\n ret.cvv = ret.token ? 'required' : 'non-required';\n delete ret.token;\n delete ret.internalCardContent;\n //delete ret.cvv;\n delete ret.holderName;\n delete ret.holderDocument;\n delete ret.cardNumber;\n delete ret.expirationDate;\n delete ret.aliasCC;\n delete ret.aliasCVV;\n },\n },\n population: function (populate) {\n this.schema.schemaObject.profile = {\n type: populate(Profile),\n index: { global: true, name: 'profileIndex' },\n };\n this.schema.schemaObject.user = {\n type: populate(User),\n index: { global: true, name: 'userIndex' },\n };\n },\n};\n\n/*\n@Prop({\n required: true,\n type: mongoose.Schema.Types.ObjectId,\n ref: 'Profile',\n})\nprofile: null; //Profile;\n\n\n@Prop({ required: false, type: {} })\ncardContent: Record<string, any>;\n\n\n @Prop({ required: false, type: {} })\n internalCardContent: Record<string, any>;*/\n\n```", "role": "assistant" } ]
code_recommendation-shelf_d455a2dd
[ { "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": "system" }, { "content": "Explain the code in recommendation-shelf/react/typings/css.d.ts.", "role": "user" }, { "content": "Here's how it works:\n\n```typescript\ndeclare module '*.css' {\n const styles: {\n [key: string]: string\n }\n\n export default styles\n}\n\n```", "role": "assistant" } ]
code_easy-setup_08449334
[ { "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": "system" }, { "content": "How do I implement a Node.js service in VTEX IO like easy-setup?", "role": "user" }, { "content": "This is the code:\n\n```typescript\nimport type { IBrand } from '../../../clients/CatalogClient/types'\n\nconst BrandData: IBrand[] = [\n {\n Active: true,\n AdWordsRemarketingCode: '',\n Id: 9280,\n Keywords: 'brand',\n LinkId: 'brand',\n LomadeeCampaignCode: '',\n MenuHome: true,\n Name: 'Brand',\n Score: null,\n SiteTitle: 'Brand',\n Text: 'Brand',\n },\n]\n\nexport { BrandData }\n\n```", "role": "assistant" } ]
multiturn_b2b-quotes_debugging_session_80fd78e4
[ { "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. You provide detailed, accurate answers with working code examples.", "role": "system" }, { "content": "b2b-quotes is not rendering on my page. What could be wrong?", "role": "user" }, { "content": "When `b2b-quotes` isn't rendering, there are several common issues to check. Let me walk you through the most likely causes.\n\n**1. Missing App Dependencies**\n\nFirst, ensure you have the B2B Suite apps installed. The `b2b-quotes` component requires these dependencies in your `manifest.json`:\n\n```json\n{\n \"dependencies\": {\n \"vtex.b2b-quotes\": \"1.x\",\n \"vtex.b2b-organizations\": \"1.x\",\n \"vtex.storefront-permissions\": \"1.x\"\n }\n}\n```\n\nRun `vtex list` to verify these apps are installed in your workspace.\n\n**2. Block Declaration Missing**\n\nThe `b2b-quotes` blocks must be properly declared. Check that you're using the correct block names:\n\n```jsonc\n// store/blocks/b2b-quotes.jsonc\n{\n \"store.b2b-quotes\": {\n \"blocks\": [\"b2b-quotes-list\"]\n },\n \"b2b-quotes-list\": {\n \"props\": {\n \"itemsPerPage\": 15\n }\n }\n}\n```\n\n**3. Route Configuration**\n\nThe B2B quotes page needs a route. Verify your `routes.json` includes:\n\n```json\n{\n \"store.b2b-quotes\": {\n \"path\": \"/b2b-quotes\"\n }\n}\n```\n\n**4. User Permissions**\n\nB2B components are permission-gated. The logged-in user must belong to a B2B organization with appropriate roles. Check the Storefront Permissions app is configured and the user has `create-quotes` or `access-quotes` permissions.\n\n**5. GraphQL Dependencies**\n\nThe component relies on GraphQL queries. Open your browser's Network tab and look for failed GraphQL requests to `/_v/private/graphql/v1` endpoints.\n\nCan you check the browser console for any errors and verify the dependencies are installed? That will help narrow down the issue.", "role": "assistant" }, { "content": "I've checked the dependencies. The console shows no errors but nothing appears.", "role": "user" }, { "content": "A blank render with no console errors often indicates the component is mounting but receiving empty data or being hidden by conditional logic. Let's dig deeper.\n\n**1. Check User Organization Status**\n\nThe `b2b-quotes` component only renders content for users who belong to a B2B organization. Even without errors, if the user isn't associated with an organization, the component returns null.\n\nVerify the user's organization status by checking the GraphQL response:\n\n```graphql\nquery GetOrganization {\n getOrganizationByIdStorefront {\n id\n name\n status\n }\n}\n```\n\nYou can test this in the GraphQL IDE at `https://{workspace}--{account}.myvtex.com/_v/private/graphql/v1`.\n\n**2. Inspect the Component State**\n\nAdd React DevTools to your browser and search for the `QuotesList` component. Check if:\n- `loading` is stuck at `true`\n- `quotes` array is empty\n- `organizationId` is undefined\n\n**3. Check for CSS Display Issues**\n\nSometimes the component renders but is hidden. Inspect the DOM for elements with class names starting with `vtex-b2b-quotes`. Add temporary styles to debug:\n\n```css\n/* styles/css/vtex.b2b-quotes.css */\n.vtex-b2b-quotes-0-x-container {\n border: 2px solid red !important;\n min-height: 200px !important;\n}\n```\n\n**4. Verify B2B Organization is Active**\n\nOrganizations have a status field. If the organization status is `inactive` or `on-hold`, quotes functionality is disabled:\n\n```json\n{\n \"status\": \"active\" // Must be 'active'\n}\n```\n\n**5. Check Cost Center Assignment**\n\nUsers must be assigned to a cost center within their organization. Without this, quote operations fail silently:\n\n```graphql\nquery GetCostCenters {\n getCostCentersByOrganizationIdStorefront {\n id\n name\n }\n}\n```\n\nCould you share your `blocks.jsonc` configuration? The issue might be in how the blocks are structured or nested. Also, confirm whether you're testing with a user that has a complete B2B profile (organization + cost center + role).", "role": "assistant" }, { "content": "Could it be a block configuration issue? Here's my blocks.jsonc:\n\n```jsonc\n{\n \"store.custom#quotes\": {\n \"blocks\": [\"flex-layout.row#quotes\"]\n },\n \"flex-layout.row#quotes\": {\n \"children\": [\"b2b-quotes\"]\n }\n}\n```", "role": "user" }, { "content": "I found your issue. The block name `b2b-quotes` alone isn't valid. The B2B Quotes app exports specific block names that you must use. Let me provide the correct configuration.\n\n**The Problem**\n\nThe block `b2b-quotes` doesn't exist as a standalone block. The app exports blocks like `b2b-quotes-list`, `b2b-quote-details`, and the page template `store.b2b-quotes`.\n\n**Correct Configuration**\n\nHere's the proper setup for a custom quotes page:\n\n```jsonc\n// store/blocks/quotes-page.jsonc\n{\n \"store.custom#quotes\": {\n \"blocks\": [\"flex-layout.row#quotes-wrapper\"]\n },\n \n \"flex-layout.row#quotes-wrapper\": {\n \"props\": {\n \"fullWidth\": true,\n \"blockClass\": \"quotes-wrapper\"\n },\n \"children\": [\"flex-layout.col#quotes-content\"]\n },\n \n \"flex-layout.col#quotes-content\": {\n \"props\": {\n \"width\": \"100%\"\n },\n \"children\": [\n \"b2b-quotes-list\"\n ]\n },\n \n \"b2b-quotes-list\": {\n \"props\": {\n \"itemsPerPage\": 25,\n \"tableFullWidth\": true\n }\n }\n}\n```\n\n**For Quote Details Page**\n\nYou'll also need a details page for when users click on a quote:\n\n```jsonc\n{\n \"store.custom#quote-details\": {\n \"blocks\": [\"flex-layout.row#quote-details-wrapper\"]\n },\n \n \"flex-layout.row#quote-details-wrapper\": {\n \"children\": [\"b2b-quote-details\"]\n },\n \n \"b2b-quote-details\": {\n \"props\": {\n \"allowCustomPrice\": true,\n \"allowDiscounts\": true\n }\n }\n}\n```\n\n**Update Your Routes**\n\nMake sure both routes are configured in `store/routes.json`:\n\n```json\n{\n \"store.custom#quotes\": {\n \"path\": \"/quotes\"\n },\n \"store.custom#quote-details\": {\n \"path\": \"/quote/:id\"\n }\n}\n```\n\n**Alternative: Use the Default Pages**\n\nIf you don't need custom layouts, you can use the pre-built pages by simply installing the app. They're automatically available at `/b2b-quotes` and `/b2b-quote/:id`. The app declares these in its own `routes.json`.\n\n**Available Block Props Reference**\n\n```jsonc\n{\n \"b2b-quotes-list\": {\n \"props\": {\n \"itemsPerPage\": 15, // Pagination size\n \"tableFullWidth\": true, // Table spans full width\n \"showOrganization\": true // Display org column\n }\n },\n \"b2b-quote-details\": {\n \"props\": {\n \"allowCustomPrice\": true, // Sales reps can edit prices\n \"allowDiscounts\": true, // Enable percentage discounts\n \"showPriceBreakdown\": true // Show subtotals\n }\n }\n}\n```\n\nAfter making these changes, run `vtex link` again and navigate to your `/quotes` route. The `b2b-quotes-list` block should now render the quotes table for authenticated B2B users.", "role": "assistant" } ]
code_product-quantity_9614f4d8
[ { "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": "system" }, { "content": "Explain the code in product-quantity/react/typings/graphql.d.ts.", "role": "user" }, { "content": "```typescript\ndeclare module '*.graphql' {\n import { DocumentNode } from 'graphql'\n\n const value: DocumentNode\n export default value\n}\n\n```", "role": "assistant" } ]
code_sandbox_b287cca4
[ { "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": "system" }, { "content": "Show me the implementation of sandbox/react/typings/graphql.d.ts from sandbox.", "role": "user" }, { "content": "The implementation is:\n\n```typescript\ndeclare module '*.graphql' {\n import { DocumentNode } from 'graphql'\n\n const value: DocumentNode\n export default value\n}\n```", "role": "assistant" } ]
code_country-flags_dc797fbc
[ { "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": "system" }, { "content": "How do I implement the Grc component in my VTEX store?", "role": "user" }, { "content": "Here's how it works:\n\n```tsx\nimport React from 'react'\n\nconst GRC: React.FC = () => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M24 20C24 20.5525 23.5525 21 23 21H1C0.4475 21 0 20.5525 0 20V4C0 3.4475 0.4475 3 1 3H23C23.5525 3 24 3.4475 24 4V20Z\"\n fill=\"#010080\"\n />\n <path d=\"M24 5H10V7H24V5Z\" fill=\"#E6E6E6\" />\n <path d=\"M24 9H10V11H24V9Z\" fill=\"#E6E6E6\" />\n <path d=\"M6 7V3H4V7H0V9H4V13H0V15H24V13H6V9H10V7H6Z\" fill=\"#E6E6E6\" />\n <path d=\"M24 17H0V19H24V17Z\" fill=\"#E6E6E6\" />\n </svg>\n)\n\nexport default GRC\n\n```", "role": "assistant" } ]
code_shipping-option-components_fd575ee3
[ { "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": "system" }, { "content": "Show me the test patterns used in shipping-option-components.", "role": "user" }, { "content": "Here's how it works:\n\n```typescript\nimport { getCatalogCount } from '../client'\n\ndescribe('client.getCatalogCount', () => {\n beforeEach(() => {\n jest.clearAllMocks()\n })\n\n it('uses credentials: \"omit\" and does not attach cookies', async () => {\n const mockFetch = jest\n .fn()\n .mockResolvedValue({ json: () => Promise.resolve({}) })\n\n ;(global as any).fetch = mockFetch\n\n await getCatalogCount('12345-678', [0, 0])\n\n expect(mockFetch).toHaveBeenCalledTimes(1)\n // eslint-disable-next-line prefer-destructuring\n const [, options] = mockFetch.mock.calls[0]\n\n expect(options).toMatchObject({\n method: 'GET',\n credentials: 'omit',\n headers: { 'Content-Type': 'application/json' },\n })\n\n // Ensure no Cookie header is forwarded\n expect(options.headers).not.toHaveProperty('Cookie')\n })\n})\n\n```", "role": "assistant" } ]
code_store-on-localhost_2aec7ff7
[ { "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": "system" }, { "content": "Explain the code in store-on-localhost/src/monobloco/components/new/Footer/components/withImage.js.", "role": "user" }, { "content": "```javascript\nimport React, { Component } from 'react'\n\nfunction getDisplayName(Component) {\n return Component.displayName || Component.name || 'Component'\n}\n\n/**\n * HOC used for lazily load an image in the 'images' folder right above\n * this component.\n *\n * Used for loading the logos for the Footer\n *\n * @param {Function} getImageFilename\n */\nexport default getImageFilename => {\n return WrappedComponent => {\n class WithImage extends Component {\n static displayName = `WithImage(${getDisplayName(WrappedComponent)})`\n static getSchema = WrappedComponent.getSchema\n static schema = WrappedComponent.schema\n\n state = {}\n\n _isMounted = false\n\n componentDidMount() {\n const imageName = getImageFilename(this.props)\n this._isMounted = true\n this.lazyImport(imageName)\n }\n\n componentWillUnmount() {\n this._isMounted = false\n }\n\n componentDidUpdate() {\n const imageName = getImageFilename(this.props)\n if (imageName !== this.state.imageName) {\n this.lazyImport(imageName)\n }\n }\n\n lazyImport = imageName => {\n return import(`../images/${imageName}`).then(imageSrc => {\n if (this._isMounted) {\n this.setState({ imageSrc: imageSrc.default, imageName })\n }\n })\n }\n\n render() {\n return (\n <WrappedComponent {...this.props} imageSrc={this.state.imageSrc} />\n )\n }\n }\n\n return WithImage\n }\n}\n\n```", "role": "assistant" } ]
code_product-customizer_60f76501
[ { "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": "system" }, { "content": "How do I style components in product-customizer?", "role": "user" }, { "content": "Here's how it works:\n\n```css\n@media screen and (min-width: 40em) {\n .vtex-product-customizer__options {\n background-color: transparent;\n }\n}\n\n.vtex-product-customizer {\n padding-bottom: 140px;\n}\n\n.vtex-product-customizer__actions .vtex-button {\n width: 100%;\n}\n\n.vtex-product-customizer__actions .actions--change-toppings .vtex-button {\n padding: 0;\n text-align: left;\n}\n\n.vtex-product-customizer__single-choice .single-choice__image-container {\n color: #1346d8;\n max-width: 72px;\n position: relative;\n}\n\n.single-choice__description {\n white-space: nowrap;\n text-overflow: ellipsis;\n max-width: 200px;\n overflow: hidden;\n}\n\n.vtex-product-customizer__single-choice.selected .single-choice__image-container .single-choice__icon-container {\n display: block;\n}\n\n.vtex-product-customizer__single-choice.selected .single-choice__image-container .vtex__icon-success {\n right: 5px;\n bottom: 10px;\n position: absolute;\n}\n\n.vtex-product-customizer__single-choice.selected .single-choice__image-container img {\n width: 100%;\n}\n\n/* Fixes gap when modal has a fixed positioned element inside, makes it feel like a new view on mobile */\ndiv.vtex-modal__overlay {\n padding: 0;\n}\n\n.vtex-modal__overlay .vtex-modal__modal {\n padding: 2rem 1rem 0 !important; /* sorry, element has inline styles */\n}\n\n/* Add to cart button */\n.vtex-product-customizer__change-ingredients + .actions--add-to-cart {\n position: sticky;\n}\n\n.actions--add-to-cart .vtex-price-selling {\n color: white;\n}\n\n/* Quantity selector */\n.multiple-choice__actions input {\n width: 2.5rem;\n}\n.multiple-choice__actions button {\n background: transparent;\n width: 1.75rem !important; /* inline styles so important is needed */\n}\n.multiple-choice__price .vtex-price-selling {\n padding: 0;\n}\n.multiple-choice__actions button.o-0 {\n opacity: .2;\n}\n\n.vtex-product-customizer__image {\n object-fit: cover;\n}\n```", "role": "assistant" } ]
code_seller-selector_75a7ca68
[ { "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": "system" }, { "content": "Show me the implementation of seller-selector/messages/es.json from seller-selector.", "role": "user" }, { "content": "Here's the implementation:\n\n```json\n{\n \"store/seller-list.pending\": \"Escriba el código postal para calcular\",\n \"store/seller-list.shipping-label\": \"Calcular el flete\",\n \"store/seller-link.linkText\": \"Verifique {sellerQuantity, plural, one {otro vendedor} other {# otros vendedores}}\",\n \"store/seller-list.shipping-estimate\": \"{name} {price} {estimate}\",\n \"admin/editor.seller-selector.title\": \"Selector de vendedor\",\n \"admin/editor.seller-selector.head-cell\": \"Celda de encabezado\",\n \"admin/editor.seller-selector.head-cell-text\": \"Texto de celda de encabezado\",\n \"admin/editor.seller-selector.limitShippingInformation-title\": \"¿Cuántas cotizaciones de envío se deben mostrar?\",\n \"admin/editor.seller-selector.limitShippingInformation-description\": \"Configure cuántas cotizaciones de envío deben mostrarse, esta configuración se aplicará a todos los vendedores en esta página\",\n \"admin/editor.seller-selector.add-to-cart\": \"Añadir al carrito\",\n \"admin/editor.seller-selector.oneClickBuy-title\": \"Redireccionar a pagar\",\n \"admin/editor.seller-link.title\": \"Enlace del vendedor\",\n \"admin/editor.seller-link.textLinkTitle\": \"Texto del enlace\",\n \"admin/editor.seller-link.textLinkDescription\": \"Valores disponibles para interpolación: '{sellerQuantity}'\"\n}\n\n```", "role": "assistant" } ]
code_render-guide_b8b61c1c
[ { "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": "system" }, { "content": "How do I implement the Header component in my VTEX store?", "role": "user" }, { "content": "```tsx\nimport React, { FunctionComponent } from 'react'\n\nconst Header: FunctionComponent = () => <h1 className=\"pl5\">Render Guide</h1>\n\nexport default Header\n\n```", "role": "assistant" } ]
code_admin-catalog-translations_b26cbbd5
[ { "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": "system" }, { "content": "Show me the GraphQL schema for admin-catalog-translations.", "role": "user" }, { "content": "Here's how it works:\n\n```graphql\nquery startProductTranslations($locale: String!, $categoryId: String!) {\n productTranslations(locale: $locale, categoryId: $categoryId)\n @context(provider: \"vtex.admin-catalog-translation\") {\n requestId\n }\n}\n\n```", "role": "assistant" } ]
code_country-flags_6b394033
[ { "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": "system" }, { "content": "What props does Lie accept and how do I configure them?", "role": "user" }, { "content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\n\nconst LIE: React.FC = () => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M24 12H0V4C0 3.4475 0.4475 3 1 3H23C23.5525 3 24 3.4475 24 4V12Z\"\n fill=\"#1147A7\"\n />\n <path\n d=\"M24 20C24 20.5525 23.5525 21 23 21H1C0.4475 21 0 20.5525 0 20V12H24V20Z\"\n fill=\"#CE1127\"\n />\n <path d=\"M7 6H3V8.666L5 10L7 8.666V6Z\" fill=\"#F6D031\" />\n </svg>\n)\n\nexport default LIE\n\n```", "role": "assistant" } ]
code_b2b-supplier_5bb3fb8d
[ { "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": "system" }, { "content": "Show me the implementation of b2b-supplier/react/typings/vtex.render-runtime.d.ts from b2b-supplier.", "role": "user" }, { "content": "Here's the source code:\n\n```typescript\n/* Typings for `render-runtime` */\ndeclare module 'vtex.render-runtime' {\n import type { ComponentType, ReactElement, ReactType } from 'react'\n\n export interface NavigationOptions {\n page: string\n params?: unknown\n }\n\n export interface RenderContextProps {\n runtime: {\n navigate: (options: NavigationOptions) => void\n }\n }\n\n interface ExtensionPointProps {\n id: string\n\n [key: string]: any\n }\n\n interface ChildBlock<BlockProps> {\n props: BlockProps\n }\n\n export const ExtensionPoint: ComponentType<ExtensionPointProps>\n export const useChildBlock: <BlockProps>({\n id,\n }: {\n id: string\n }) => ChildBlock<BlockProps> | null\n export const Helmet: ReactElement\n export const Link: ReactType\n export const NoSSR: ReactElement\n export const RenderContextConsumer: unknown\n export const TreePathContextConsumer: unknown\n export const useTreePath: unknown\n export const useRuntime: any\n export const canUseDOM: boolean\n export const withRuntimeContext: <\n TOriginalProps extends Record<string, unknown>\n >(\n Component: ComponentType<TOriginalProps & RenderContextProps>\n ) => ComponentType<TOriginalProps>\n\n export const withSession: <TOriginalProps extends {}>(\n Component: ComponentType<TOriginalProps & RenderContextProps>\n ) => ComponentType<TOriginalProps>\n\n interface KeyValue {\n value: string\n }\n\n interface Session {\n id: string\n namespaces: {\n store: {\n channel: KeyValue\n }\n profile: {\n isAuthenticated: KeyValue\n email: string\n }\n }\n }\n\n interface SessionUnauthorized {\n type: 'Unauthorized'\n message: string\n }\n\n interface SessionForbidden {\n type: 'Forbidden'\n message: string\n }\n\n type SessionResponse = Session | SessionUnauthorized | SessionForbidden\n\n export interface RenderSession {\n sessionPromise: Promise<SessionPromise>\n }\n\n export interface SessionPromise {\n response: Session | SessionUnauthorized | SessionForbidden\n }\n}\n\n```", "role": "assistant" } ]
code_butik_307bdb53
[ { "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": "system" }, { "content": "Explain the code in butik/react/components/SKUSelector/index.js.", "role": "user" }, { "content": "```javascript\nimport React, { PureComponent } from 'react'\nimport PropTypes from 'prop-types'\nimport VariationSelector from './components/VariationSelector'\nimport { Machine } from 'xstate'\nimport { interpret } from 'xstate/lib/interpreter'\nimport hash from 'object-hash'\nimport './global.css'\n\n/**\n * Display a list of SKU items of a product and its specifications.\n */\nclass SKUSelector extends PureComponent {\n constructor(props) {\n super(props)\n\n this.state = {}\n this.visualVariations = []\n this.standardVariations = []\n this.stateMachine = {}\n this.variationsOptions = {}\n }\n\n componentDidMount() {\n const { skus, variations, selectedVariations } = this.props\n if (!variations || !variations.length) return\n\n variations.forEach(variation => {\n /** Separate all variations into visualVariations and standardVariations based on the thumbSrc value */\n if (variation.hasThumbs) this.visualVariations.push(variation.name)\n else this.standardVariations.push(variation.name)\n\n /** Fills variationsOptions with all possible variationOptions */\n this.variationsOptions[variation.name] = {}\n skus.forEach(sku => {\n this.variationsOptions[variation.name][sku[variation.name]] = true\n })\n })\n\n this.stateMachine.interpret = interpret(\n this.createStateMachine(\n skus,\n this.visualVariations,\n this.standardVariations,\n selectedVariations && hash(selectedVariations)\n )\n )\n\n this.setState({ stateMachineStateHash: this.stateMachine.initial })\n this.stateMachine.interpret.onTransition(this.handleStateTransition).start()\n }\n\n handleStateTransition = state => {\n const stateMachineStateHash = state.value\n const { onChange } = this.props\n\n this.setState({ stateMachineStateHash })\n\n const stateMachineState = this.stateMachine.states[stateMachineStateHash]\n\n const selectedVariations = stateMachineState.variations\n const { sku, price } = stateMachineState\n\n const allVariationsSelected = Object.keys(selectedVariations).reduce(\n (accumulator, variation) =>\n accumulator && selectedVariations[variation] !== null,\n true\n )\n\n onChange({\n sku,\n allVariationsSelected,\n selectedVariations,\n price,\n })\n }\n\n /** Returns the variation that has a different label if there is exactly one different variation\n * or undefined otherwise\n * */\n getDifferentVariation = (stateA, stateB) => {\n let counter = 0\n let differentVariation = null\n\n Object.keys(stateA).forEach(variation => {\n if (stateA[variation] !== stateB[variation]) {\n counter++\n differentVariation = variation\n }\n })\n\n if (counter === 1) return differentVariation\n }\n\n /** Creates a state machine whose state is based on the selected variations **/\n createStateMachine = (\n skus,\n visualVariations,\n standardVariations,\n initialState\n ) => {\n const { stateMachine } = this\n stateMachine.id = 'SKUSelector'\n stateMachine.states = {}\n stateMachine.transitions = {}\n\n const { states, transitions } = stateMachine\n\n skus.forEach(sku => {\n /** Creates all possible states without selecting some standardVariations **/\n const bitMaskLimit = 1 << standardVariations.length\n\n for (let bitMask = 0; bitMask < bitMaskLimit; bitMask++) {\n const state = { variations: {} }\n\n visualVariations.forEach(\n variation => (state.variations[variation] = sku[variation])\n )\n\n standardVariations.forEach((variation, variationIndex) => {\n if ((1 << variationIndex) & bitMask)\n state.variations[variation] = sku[variation]\n else state.variations[variation] = null\n })\n\n const stateKey = hash(state.variations)\n\n if (bitMask === 0 && !stateMachine.initial)\n stateMachine.initial = stateKey\n\n if (!states[stateKey] || !states[stateKey].available) {\n if (!states[stateKey]) states[stateKey] = {}\n\n states[stateKey].variations = state.variations\n states[stateKey].sku = sku.sku\n states[stateKey].available = sku.available\n }\n\n if (sku.available) {\n if (states[stateKey].price) {\n const { value, notUnique } = states[stateKey].price\n\n states[stateKey].price.notUnique =\n notUnique || sku.price.notUnique || sku.price.value !== value\n\n states[stateKey].price.value = Math.min(value, sku.price.value)\n } else states[stateKey].price = { ...sku.price }\n }\n }\n })\n\n /** Creates a transition from A to B if there is only one different variation **/\n Object.keys(states).forEach(keyA => {\n states[keyA].on = {}\n\n Object.keys(states).forEach(keyB => {\n const stateA = states[keyA].variations\n const stateB = states[keyB].variations\n\n const differentVariation = this.getDifferentVariation(stateA, stateB)\n if (!differentVariation) return\n\n const action = {\n variation: differentVariation,\n label: stateB[differentVariation],\n }\n\n const actionHash = hash(action)\n transitions[actionHash] = action\n states[keyA].on[actionHash] = keyB\n })\n })\n\n if (initialState && stateMachine.states[initialState])\n stateMachine.initial = initialState\n\n return Machine(stateMachine)\n }\n\n onSelectItem = actionHash => () => {\n this.stateMachine.interpret.send(actionHash)\n }\n\n render() {\n if (!this.props.variations || !this.props.variations.length) return null\n\n const { visualVariations, standardVariations } = this\n const { askToSelectVariations, designTokens } = this.props\n const variations = visualVariations.concat(standardVariations)\n\n const { stateMachineStateHash } = this.state\n if (!stateMachineStateHash) return <div />\n\n const stateMachineStates = this.stateMachine.states\n const stateMachineState = stateMachineStates[stateMachineStateHash]\n\n const transitions = stateMachineState.on\n const selectedVariations = stateMachineState.variations\n\n return (\n <React.Fragment>\n {variations.map((variation, variationIndex) => {\n const selectedItem = selectedVariations[variation]\n\n const items = Object.keys(this.variationsOptions[variation]).reduce(\n (accumulator, label) => {\n const selected = selectedItem === label\n\n const actionHash = hash({\n variation,\n label: selected ? null : label,\n })\n\n const nextStateHash = transitions[actionHash]\n\n if (nextStateHash || selected) {\n const available = selected\n ? stateMachineState.available\n : stateMachineStates[nextStateHash].available\n\n accumulator.push({\n label,\n available,\n thumbSrc: null,\n onSelectItem: this.onSelectItem(actionHash),\n })\n }\n return accumulator\n },\n []\n )\n\n return (\n <VariationSelector\n key={variationIndex}\n variation={{\n name: variation,\n items,\n }}\n designTokens={designTokens}\n selectedItem={selectedItem}\n askToSelectVariation={askToSelectVariations && !selectedItem}\n />\n )\n })}\n </React.Fragment>\n )\n }\n}\n\nSKUSelector.propTypes = {\n /** Variation name, the same used as key in 'skus' */\n variations: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n hasThumbs: PropTypes.bool,\n })\n ),\n /** Can just pass vtex product.items */\n skus: PropTypes.arrayOf(\n PropTypes.shape({\n /** Value that will be returned when selected */\n sku: PropTypes.any,\n /** True if it's available, available quantity > 0 */\n available: PropTypes.bool,\n /** Necessary for the component return the minimum price at each state */\n price: PropTypes.shape({\n /** The minimum price of that Sku */\n value: PropTypes.number,\n /** True if this sku have different prices from multiple sellers */\n notUnique: PropTypes.bool,\n }),\n /** Also has the values for each variation as variationName: label */\n })\n ),\n /** selectedVariations in the initial state of the form {variationName: label}\n * for all variations using null if it's not selected */\n selectedVariations: PropTypes.object,\n /** Function called when the state change is triggered. It receives the selected sku,\n * the variations that are selected and a boolean telling if all variations are selected */\n onChange: PropTypes.func,\n /** Boolean prop that displays a warning text beside not selected variations */\n askToSelectVariations: PropTypes.bool,\n /** Used to change internal designs. When set, will replace component className **/\n designTokens: PropTypes.shape({ skuSelectorContainer: PropTypes.string }),\n}\n\nexport default SKUSelector\n\n```", "role": "assistant" } ]