id
stringlengths
12
53
messages
listlengths
3
3
code_seller-selector_16b1cf92
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of seller-selector/store/routes.json from the seller-selector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.sellers\": {\n \"path\": \"/sellers/:slug\"\n }\n}\n```" } ]
code_seller-selector_66921efd
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of seller-selector/react/typings/vtex.address-form.d.ts from the seller-selector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.address-form'\n\ndeclare module 'vtex.address-form/inputs' {\n export const StyleguideInput\n export const GeolocationInput\n}\n\ndeclare module 'vtex.address-form/helpers' {\n export const addValidation\n export const removeValidation\n export const injectRules\n}\n\n```" } ]
code_seller-selector_c66552b6
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of seller-selector/react/typings/graphql.d.ts from the seller-selector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module '*.gql' {\n const graphql: any\n export default graphql\n}\n\n```" } ]
code_seller-selector_11bac7d2
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of seller-selector/react/typings/vtex.styleguide.d.ts from the seller-selector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.styleguide' {\n export const Button\n export const Spinner\n}\n\n```" } ]
code_seller-selector_3dfb7158
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of seller-selector/react/queries/SimulateShipping.gql from the seller-selector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```graphql\nquery SimulateShipping(\n $shippingItems: [ShippingItem]\n $postalCode: String\n $country: String\n) {\n shipping(items: $shippingItems, postalCode: $postalCode, country: $country)\n @context(provider: \"vtex.store-graphql\") {\n logisticsInfo {\n itemIndex\n slas {\n id\n name\n price\n shippingEstimate\n shippingEstimateDate\n }\n }\n }\n}\n\n```" } ]
code_seller-selector_22805c34
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of seller-selector/react/utils/index.tsx from the seller-selector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nlet addressId = 1\n\nconst getRandomAddressId = () =>\n (addressId++ * new Date().getTime() * -1).toString().replace('-', '')\n\nexport const getNewAddress = (country: string) => {\n const newAddressId = getRandomAddressId()\n\n return {\n addressId: newAddressId,\n addressType: 'residential',\n city: null,\n complement: null,\n country,\n geoCoordinates: [],\n neighborhood: null,\n number: null,\n postalCode: null,\n receiverName: null,\n reference: null,\n state: null,\n street: null,\n addressQuery: null,\n }\n}\n\n```" } ]
code_seller-selector_e537257b
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of seller-selector/react/__tests__/index.test.tsx from the seller-selector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\ndescribe('Orders List Scenarios', () => {\n it('should work', () => {\n expect(1).toBe(1)\n })\n})\n\n```" } ]
code_seller-selector_f532514e
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of seller-selector/store/blocks/sellers.jsonc from the seller-selector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.sellers\": {\n \"blocks\": [\n \"seller-table\"\n ]\n },\n \"seller-table\": {\n \"children\": [\n \"vtex.store-components:product-name\",\n \"seller-simulate-shipping\",\n \"seller-head\",\n \"seller-body\"\n ]\n },\n \"seller-head\": {\n \"children\": [\n \"seller-head-cell#Seller\",\n \"seller-head-cell#Price\",\n \"seller-head-cell#Shipping\",\n \"seller-head-cell#PriceWithShipping\",\n \"seller-head-cell#BuyButton\"\n ]\n },\n \"seller-head-cell#Seller\": {\n \"props\": {\n \"title\": \"Seller\"\n }\n },\n \"seller-head-cell#Price\": {\n \"props\": {\n \"title\": \"Price\"\n }\n },\n \"seller-head-cell#Shipping\": {\n \"props\": {\n \"title\": \"Shipping\"\n }\n },\n \"seller-head-cell#PriceWithShipping\": {\n \"props\": {\n \"title\": \"Price With Shipping\"\n }\n },\n \"seller-head-cell#BuyButton\": {\n \"props\": {\n \"title\": \"Add To Cart\"\n }\n },\n \"seller-body\": {\n \"children\": [\n \"seller-row\"\n ]\n },\n \"seller-row\": {\n \"children\": [\n \"seller-name\",\n \"seller-price\",\n \"seller-shipping\",\n \"seller-price-with-shipping\",\n \"seller-add-to-cart\"\n ]\n },\n \"seller-add-to-cart\": {\n \"blocks\": [\n \"buy-button\"\n ]\n }\n}\n```" } ]
code_orders-feed-example_8e104f3e
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of orders-feed-example/docs/README.md from the orders-feed-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# Orders Feed Example\n\nA boilerplate app implementing an event handler receiving status updates from OMS Feed.\nThis is the method for using [Feed v3 Hook](https://developers.vtex.com/reference/feed-v3) inside VTEX IO.\n\n## How to Use\n\nThis app handles events sent by the app `vtex.orders-broadcast`, as you can see by looking at `node/service.json`.\n\n```json\n{\n \"memory\": 256,\n \"ttl\": 10,\n \"timeout\": 2,\n \"minReplicas\": 2,\n \"maxReplicas\": 4,\n \"workers\": 1,\n \"events\": {\n \"allStates\": {\n \"sender\": \"vtex.orders-broadcast\",\n \"topics\": [\"order-status-updated\"]\n },\n \"someStates\": {\n \"sender\": \"vtex.orders-broadcast\",\n \"topics\": [\"cancel\", \"order-created\"]\n }\n }\n}\n```\n\nYou have two ways of consuming changes in status:\n\n1. Receive all events subscribing to the `order-status-updated` topic, as the `allStates` handler does\n2. Receive a selection of status changes where the `currentState` equals the `topic`, as the `someStates` handler does. This option is the preferred one, when you know ahead of time, what types of events, you want to listen to.\n\nNormally `vtex.orders-broadcast` sends events only in `master` workspace. If you want to use it in a developer workspace, do the following:\n\n1. Create your development workspace by running `vtex use {workspaceName}`\n2. Go to `https://{accountName}.myvtex.com/admin/apps/vtex.orders-broadcast/setup`\n3. Change the `Target Workspace` variable to the name of the workspace you have created previously.\n4. Now you can link this app (`vtex.orders-feed-example`) in your desired workspace and receive order status updates.\n\nAdditionally, if you are setting up the app in a subaccount, it is important to check the `Notify Subaccounts` option at `https://{accountName}.myvtex.com/admin/apps/vtex.orders-broadcast/setup` even if the feed is not configured for the main account.\n\n\nHere is an example body that you can expect to receive:\n\n```json\n{\n \"recorder\": {\n \"_record\": {\n \"x-vtex-meta\": {},\n \"x-vtex-meta-bucket\": {}\n }\n },\n \"domain\": \"Marketplace\",\n \"orderId\": \"v69305315atmc-01\",\n \"currentState\": \"invoice\",\n \"lastState\": \"payment-approved\",\n \"currentChangeDate\": \"2020-07-13T20:25:13.2304508Z\",\n \"lastChangeDate\": \"2020-07-13T20:25:03.9527532Z\"\n}\n```\n\nIf you want to understand further how Feed v3 works, check out [this documentation](https://help.vtex.com/tutorial/orders-management-feed-v3-setup--5qDml3cQypWDRTgw69s4C1).\n\n```" } ]
code_orders-feed-example_1a06bd22
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of orders-feed-example/node/service.json from the orders-feed-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"memory\": 256,\n \"ttl\": 10,\n \"timeout\": 2,\n \"minReplicas\": 2,\n \"maxReplicas\": 4,\n \"workers\": 1,\n \"events\": {\n \"allStates\": {\n \"sender\": \"vtex.orders-broadcast\",\n \"topics\": [\"order-status-updated\"]\n },\n \"someStates\": {\n \"sender\": \"vtex.orders-broadcast\",\n \"topics\": [\"cancel\", \"order-created\"]\n }\n }\n}\n\n```" } ]
code_orders-feed-example_3cd38672
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of orders-feed-example/node/package.json from the orders-feed-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"dependencies\": {\n \"co-body\": \"^6.0.0\",\n \"ramda\": \"^0.25.0\"\n },\n \"devDependencies\": {\n \"@types/co-body\": \"^0.0.3\",\n \"@types/jest\": \"^24.0.18\",\n \"@types/node\": \"^12.0.0\",\n \"@types/ramda\": \"types/npm-ramda#dist\",\n \"@vtex/api\": \"6.35.0\",\n \"@vtex/test-tools\": \"^1.0.0\",\n \"tslint\": \"^5.14.0\",\n \"tslint-config-vtex\": \"^2.1.0\",\n \"typescript\": \"3.8.3\"\n },\n \"scripts\": {\n \"lint\": \"tsc --noEmit --pretty && tslint -c tslint.json --fix './**/*.ts'\"\n },\n \"version\": \"0.2.2\"\n}\n\n```" } ]
code_orders-feed-example_464a587e
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of orders-feed-example/node/index.ts from the orders-feed-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport {\n ClientsConfig,\n LRUCache,\n Service,\n ServiceContext,\n RecorderState,\n EventContext,\n} from '@vtex/api'\n\nimport { Clients } from './clients'\nimport { allStates } from './middlewares/allStates'\nimport { someStates } from './middlewares/someStates'\n\nconst TIMEOUT_MS = 800\n\n// Create a LRU memory cache for the Status client.\n// The @vtex/api HttpClient respects Cache-Control headers and uses the provided cache.\nconst memoryCache = new LRUCache<string, any>({ max: 5000 })\nmetrics.trackCache('status', memoryCache)\n\n// This is the configuration for clients available in `ctx.clients`.\nconst clients: ClientsConfig<Clients> = {\n // We pass our custom implementation of the clients bag, containing the Status client.\n implementation: Clients,\n options: {\n // All IO Clients will be initialized with these options, unless otherwise specified.\n default: {\n retries: 2,\n timeout: TIMEOUT_MS,\n },\n // This key will be merged with the default options and add this cache to our Status client.\n status: {\n memoryCache,\n },\n },\n}\n\ndeclare global {\n type Context = ServiceContext<Clients, State>\n\n interface StatusChangeContext extends EventContext<Clients> {\n body: {\n domain: string\n orderId: string\n currentState: string\n lastState: string\n currentChangeDate: string\n lastChangeDate: string\n }\n }\n // The shape of our State object found in `ctx.state`. This is used as state bag to communicate between middlewares.\n interface State extends RecorderState {}\n}\n\n// Export a service that defines route handlers and client options.\nexport default new Service({\n clients,\n events: {\n allStates,\n someStates,\n },\n})\n\n```" } ]
code_orders-feed-example_cc144153
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of orders-feed-example/node/clients/index.ts from the orders-feed-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { IOClients } from \"@vtex/api\";\n\n// Extend the default IOClients implementation with our own custom clients.\nexport class Clients extends IOClients {}\n\n```" } ]
code_orders-feed-example_7b65d92b
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of orders-feed-example/node/middlewares/allStates.ts from the orders-feed-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport async function allStates(\n ctx: StatusChangeContext,\n next: () => Promise<any>\n) {\n console.log(ctx.body)\n await next()\n}\n\n```" } ]
code_orders-feed-example_8c085b45
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of orders-feed-example/node/middlewares/someStates.ts from the orders-feed-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport async function someStates(\n ctx: StatusChangeContext,\n next: () => Promise<any>\n) {\n console.log(ctx.body)\n await next()\n}\n\n```" } ]
code_email-checkout-conflict_6d60a431
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of email-checkout-conflict/checkout-ui-custom/checkout6-custom.js from the email-checkout-conflict VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\nwindow.checkEmailAuthConflictMessages = {\n\n\ten: {\n\t\ttitle: \"Email conflict\",\n\t\tbutton: \"Log In\",\n\t\tmessage: \"It looks like the email you entered is different from the one that was previously registered. Please log in again by clicking the button below.\"\n\t},\n\tes: {\n\t\ttitle: \"Email no registrado \",\n\t\tbutton: \"Iniciar sesión\",\n\t\tmessage: \"Parece que el email que has ingresado es diferente del que se registró anteriormente. Por favor, inicia sesión de nuevo haciendo clic en el botón a continuación.\"\n\t},\n \"pt-BR\": {\n\t\ttitle: \"Conflito de email\",\n\t\tbutton: \"Entrar\",\n\t\tmessage: \"Parece que o email que você inseriu é diferente do que foi registrado anteriormente. Faça login novamente clicando no botão abaixo.\"\n },\n\tro: {\n\t\ttitle:\"Conflict adresa email\",\n\t\tbutton:\"Loghează-te\",\n\t\tmessage:\"Am identificat că probabil ați folosit un alt e-mail de conectare decât cel introdus anterior. Vă rugăm să vă conectați din nou făcând clic pe butonul de mai jos.\"\n\t},\n\tbg: {\n\t\ttitle: \"Конфликт на имейл адреси\",\n\t\tbutton: \"Влизане\",\n\t\tmessage: \"Изглежда, че въведеният от вас имейл е различен от този, който е бил регистриран преди това. Моля, влезте отново, като щракнете върху бутона по-долу.\"\n\t},\n\tde: {\n\t\ttitle: \"E-Mail-Konflikt\",\n\t\tbutton: \"Einloggen\",\n\t\tmessage: \"Es sieht so aus, als ob die eingegebene E-Mail sich von der unterscheidet, die zuvor registriert wurde. Bitte melden Sie sich erneut an, indem Sie auf den Button unten klicken.\"\n\t},\n\tfr: {\n\t\ttitle: \"Conflit d'e-mail\",\n\t\tbutton: \"Se connecter\",\n\t\tmessage: \"Il semble que l'e-mail que vous avez saisi soit différent de celui qui a été enregistré précédemment. Veuillez vous reconnecter en cliquant sur le bouton ci-dessous.\"\n\t},\n\tit: {\n\t\ttitle: \"Conflitto di email\",\n\t\tbutton: \"Accedi\",\n\t\tmessage: \"Sembra che l'email inserita sia diversa da quella registrata in precedenza. Accedi di nuovo cliccando sul pulsante in basso.\"\n\t},\n\tja: {\n\t\ttitle: \"メールの不一致\",\n\t\tbutton: \"ログイン\",\n\t\tmessage: \"入力したメールアドレスが以前に登録したものと異なるようです。下のボタンをクリックし、もう一度ログインしてください。\"\n\t},\n\tko: {\n\t\ttitle: \"이메일 충돌\",\n\t\tbutton: \"로그인\",\n\t\tmessage: \"입력한 이메일이 이전에 등록한 이메일과 다른 것 같습니다. 아래 버튼을 클릭하여 다시 로그인하세요.\"\n\t},\n\tnl: {\n\t\ttitle: \"E-mailconflict\",\n\t\tbutton: \"Inloggen\",\n\t\tmessage: \"Het lijkt erop dat het e-mailadres dat u hebt ingevoerd anders is dan het e-mailadres dat u eerder hebt geregistreerd. Log opnieuw in door op onderstaande knop te klikken.\"\n\t},\n\tth: {\n\t\ttitle: \"อีเมลไม่ตรงกัน\",\n\t\tbutton: \"ล็อกอิน\",\n\t\tmessage: \"ดูเหมือนว่าอีเมลที่คุณให้ต่างจากที่ลงทะเบียนไว้ โปรดล็อกอินอีกครั้งโดยคลิกปุ่มที่ด้านล่าง\"\n\t},\n\tca: {\n\t\ttitle: \"Conflicte amb l'adreça electrònica\",\n\t\tbutton: \"Inicia la sessió\",\n\t\tmessage: \"Sembla que l'adreça electrònica que heu introduït és diferent de la que es va registrar anteriorment. Feu clic al botó de sota per tornar a iniciar la sessió.\"\n\t},\n\tcs: {\n\t\ttitle: \"Konflikt e-mailů\",\n\t\tbutton: \"Přihlásit se\",\n\t\tmessage: \"Vypadá to, že zadaný e-mail se liší od toho, který jste zaregistrovali dříve. Klikněte na tlačítko níže a přihlaste se znovu.\"\n\t},\n\tda: {\n\t\ttitle: \"E-mailkonflikt\",\n\t\tbutton: \"Log ind\",\n\t\tmessage: \"Det ser ud til, at den e-mail, du har indtastet, er anderledes end den, der tidligere blev registreret. Log venligst ind igen ved at klikke på knappen nedenfor.\"\n\t},\n\tfi: {\n\t\ttitle: \"Sähköpostiristiriita\",\n\t\tbutton: \"Kirjaudu\",\n\t\tmessage: \"Näyttää siltä, että syöttämäsi sähköpostiosoite on eri kuin aiemmin rekisteröity sähköpostiosoite. Kirjaudu uudelleen napsauttamalla alla olevaa painiketta.\"\n\t},\n\tid: {\n\t\ttitle: \"Konflik Email\",\n\t\tbutton: \"Masuk\",\n\t\tmessage: \"Tampaknya alamat email yang Anda masukkan berbeda dari yang sudah terdaftar sebelumnya. Silakan masuk kembali dengan mengklik tombol di bawah ini.\"\n\t},\n\tno: {\n\t\ttitle: \"E-postkonflikt\",\n\t\tbutton: \"Logg inn\",\n\t\tmessage: \"Det ser ut som om e-postadressen du skrev inn, er annerledes enn den som tidligere var registrert. Vennligst logg inn igjen ved å klikke på knappen nedenfor.\"\n\t},\n\tpl: {\n\t\ttitle: \"Konflikt e-mailowy\",\n\t\tbutton: \"Zaloguj się\",\n\t\tmessage: \"Wygląda na to, że wprowadzony e-mail jest inny niż poprzednio zarejestrowany. Zaloguj się ponownie, klikając poniższy przycisk.\"\n\t},\n\tru: {\n\t\ttitle: \"Конфликт электронной почты\",\n\t\tbutton: \"Вход\",\n\t\tmessage: \"Похоже, введенная вами электронная почта отличается от зарегистрированной ранее. Повторите попытку входа, нажав кнопку ниже.\"\n\t},\n\tsk: {\n\t\ttitle: \"Konflikt e-mailov\",\n\t\tbutton: \"Prihlásenie\",\n\t\tmessage: \"Zdá sa, že e-mail, ktorý ste zadali, sa líši od e-mailu, ktorý ste predtým zaregistrovali. Prihláste sa znova kliknutím na tlačidlo nižšie.\"\n\t},\n\tsl: {\n\t\ttitle: \"Email konflikt\",\n\t\tbutton: \"Prijava\",\n\t\tmessage: \"Zdi se, da se vneseni e-poštni naslov razlikuje od tistega, ki je bil prej registriran. Prosimo, prijavite se ponovno s klikom na spodnji gumb.\"\n\t},\n\tsv: {\n\t\ttitle: \"Emailkonflikt\",\n\t\tbutton: \"Logga in\",\n\t\tmessage: \"Det verkar som att e-postadressen du angav skiljer sig från den som tidigare registrerades. Vänligen logga in igen genom att klicka på knappen nedan.\"\n\t},\n\tuk: {\n\t\ttitle: \"Конфлікт електронної пошти\",\n\t\tbutton: \"Вхід\",\n\t\tmessage: \"Схоже, електронна пошта, яку ви ввели, відрізняється від зареєстрованої раніше. Повторіть спробу входу, натиснувши кнопку нижче.\"\n\t}\n}\n\n\nclass checkEmailAuthConflict {\n\tconstructor({} = {}) {\n\t\tthis.orderForm = \"\";\n this.lang = \"\";\n\t}\n\n getRootPath = () => {\n const { rootPath } =\n window.__RUNTIME__ || (window.vtex && window.vtex.renderRuntime) || {};\n \n return rootPath || \"\";\n };\n\n\tremoveModal() {\n\t\t$(\".checkEmailAuthConflict__modal\").fadeOut(\"normal\", function() {\n\t\t\t$(\".checkEmailAuthConflict__modal\").remove();\n\t\t});\n\t} \n\n\tshowModal() {\n\n\t\tconst _this = this;\n\n\t\t$(\".checkEmailAuthConflict__modal\").remove();\n\n\t\tif(!_this.lang) return false;\n\t\tif(!checkEmailAuthConflictMessages[this.lang]) this.lang = \"en\";\n\t\tlet modal = `\n\t\t\t<div class=\"checkEmailAuthConflict__modal\">\n\t\t\t\t<div class=\"checkEmailAuthConflict__modal--bg\"></div>\n\t\t\t\t<div class=\"checkEmailAuthConflict__modal--wrap\">\n\t\t\t\t\t<h4 class=\"checkEmailAuthConflict__modal--title\">${checkEmailAuthConflictMessages[this.lang].title}</h4>\n\t\t\t\t\t<p class=\"checkEmailAuthConflict__modal--text\">${checkEmailAuthConflictMessages[this.lang].message}</p>\n\t\t\t\t\t<button class=\"checkEmailAuthConflict__modal--button js-checkEmailAuthConflict__modal--button\">${checkEmailAuthConflictMessages[this.lang].button}</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;\n\n\t\t$(\"body\").append(modal);\n\n\t}\n\n\tbind() {\n\t\tconst _this = this;\n\n\t\t$(\"body\").on(\"click\", \".js-checkEmailAuthConflict__modal--button\", function(e) {\n\t\t\te.preventDefault();\n\t\t\t$(this).addClass(\"js-loading\");\n\t\t\t_this.changeUser();\n\t\t})\n\n\t}\n\n\tchangeUser() {\n\t\tconst _this = this;\n\n\t\t$.ajax(`${this.getRootPath()}/checkout/changeToAnonymousUser/${_this.orderForm.orderFormId}`)\n\t\t.done(function() {\n\t\t\t_this.removeModal();\n\t\t\tvtexid.start();\n\t\t});\n\t}\n\n\tvalidate() {\n\t\tconst _this = this;\n\t\ttry {\n\t\t\tif( \n\t\t\t\t_this.orderForm && \n\t\t\t\t_this.orderForm.clientProfileData && \n\t\t\t\t_this.orderForm.clientProfileData.email \n\t\t\t) {\n\t\t\t\tfetch(`${this.getRootPath()}/api/vtexid/pub/authenticated/user`, {credentials: 'include'})\n\t\t\t\t.then(response => response.json())\n\t\t\t\t.then(function(response) {\n\t\t\t\t\tif(!response) return false;\n\t\t\t\t\tlet user = response.user;\n\n\t\t\t\t\tif(_this.orderForm.clientProfileData.email != user) {\n\t\t\t\t\t\t_this.showModal();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t} catch(e) {\n\t\t\tconsole.error(e)\n\t\t} \n\t}\n\n\tvalidateOperations(orderForm) {\n\t\tif (orderForm.userType === 'callCenterOperator' || ~window.location.host.indexOf(`myvtex`)) {\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}\n\n\tinit() {\n\t\tconst _this = this;\n\n\t\ttry {\n\n\t\t\t$(window).one('orderFormUpdated.vtex', function(_, orderForm) {\n\t\t\t\tif (_this.validateOperations(orderForm)) {\n\t\n\t\t\t\t\t_this.orderForm = orderForm;\n\t\t\t\t\t_this.lang = vtex ? vtex.i18n.locale : \"en\";\n\t\t\t\t\ttry {\n\t\t\t\t\t\t_this.validate();\n\t\t\t\t\t\t_this.bind();\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\tconsole.error(e)\n\t\t\t\t\t} \n\t\t\t\t}\n\t\n\t\t\t});\n\t\n\t\t\t$(window).on('authenticatedUser.vtexid closed.vtexid', function() {\n\t\t\t\t_this.orderForm = vtexjs.checkout.orderForm;\n\t\t\t\tif (_this.validateOperations(_this.orderForm)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t_this.validate();\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\tconsole.error(e)\n\t\t\t\t\t} \n\t\t\t\t} \n\t\t\t});\n\n\t\t} catch(e) {\n\t\t\tconsole.error(`Error on checkEmailAuthConflict: ${e}`)\n\t\t}\n\t\t\n\t}\n}\n\n\nwindow.validateAuthEmail = new checkEmailAuthConflict()\nvalidateAuthEmail.init(); \n```" } ]
code_email-checkout-conflict_ee2b1733
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of email-checkout-conflict/checkout-ui-custom/checkout6-custom.css from the email-checkout-conflict VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.checkEmailAuthConflict__modal,\n.checkEmailAuthConflict__modal--bg {\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: 99999;\n}\n\n.checkEmailAuthConflict__modal--bg {\n background: #000;\n opacity: 0.4;\n}\n\n.checkEmailAuthConflict__modal--wrap {\n width: 400px;\n background: #fff;\n position: fixed;\n left: calc(50% - 200px);\n top: 50%;\n transform: translateY(-50%);\n z-index: 99999;\n padding: 30px;\n border-radius: 3px;\n box-sizing: border-box;\n\n color: #333333;\n background: #fff;\n box-shadow: 0 5px 0 #ddd;\n border-bottom: 1px solid #fff;\n border-radius: 4px;\n border: 2px solid #eee;\n}\n\nbutton.checkEmailAuthConflict__modal--button {\n background: #1a73e8;\n padding: 10px;\n display: inline-block;\n border: none;\n border-radius: 3px;\n color: #fff;\n}\n\n .checkEmailAuthConflict__modal--button.js-loading:after {\n border: 3px solid #f3f3f3; /* Light grey */\n border-top: 3px solid #9999; /* Blue */\n border-radius: 50%;\n width: 10px;\n height: 10px;\n animation: spin 1s linear infinite;\n content: '';\n display: inline-block;\n margin-left: 8px;\n vertical-align: middle;\n }\n\nh4.checkEmailAuthConflict__modal--title {\n font-size: 16px;\n font-weight: bold;\n color: #000;\n}\n\np.checkEmailAuthConflict__modal--text {\n margin-bottom: 20px;\n}\n\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n```" } ]
code_email-checkout-conflict_e7220b1e
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of email-checkout-conflict/docs/README.md from the email-checkout-conflict VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# Email checkout validation\n\nValidates identified users with the last email used to login. It covers the issue mentioned on this [thread](https://vtex.slack.com/archives/C017NPK8U86/p1633371546124200)\n```" } ]
code_bonytos-de-tema_7df0f6e7
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/sitemap/sitemap.json from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"urlset\": {\n \"url\": [\n {\n \"loc\": \"https://storetheme.vtex.com/about-us\"\n }\n ]\n }\n}\n```" } ]
code_bonytos-de-tema_88e7878d
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/store/blocks.jsonc from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n/* Blocks can be defined both on the store/blocks.json file, and in any number of json\n * files inside the store/blocks directory, with any arbitrary directory structure.\n *\n * Additionally, all blocks files can support comments, such as this one, if given the\n * .jsonc file extension.\n *\n * The store/blocks.json file is intended for backwards compatibility, for miscellaneous\n * blocks, or if the app is simple enough that it doesn't warrant splitting the file.\n */\n{\n \"store.orderplaced\": {\n \"blocks\": [\"order-placed\"]\n },\n\n \"store.account\": {\n \"blocks\": [\"my-account\"],\n \"parent\": {\n \"challenge\": \"challenge.profile\"\n }\n },\n\n \"store.login\": {\n \"blocks\": [\"login-content#default\"]\n },\n\n \"login-content#default\": {\n \"props\": {\n \"isInitialScreenOptionOnly\": false,\n \"defaultOption\": 1,\n \"showPasswordVerificationIntoTooltip\": true\n }\n },\n\n \"product-summary.shelf\": {\n \"children\": [\n \"product-summary-add-to-list-button\",\n \"stack-layout#prodsum\",\n \"product-summary-name\",\n \"product-rating-inline\",\n \"product-summary-space\",\n \"product-summary-price\",\n \"product-identifier.summary\",\n \"product-summary-buy-button\"\n ]\n },\n\n \"stack-layout#prodsum\": {\n \"children\": [\n \"product-summary-image\",\n \"product-summary-specification-badges\"\n ]\n },\n\n \"product-summary-specification-badges\": {\n \"props\": {\n \"specificationGroupName\": \"Group\",\n \"specificationName\": \"On Sale\",\n \"visibleWhen\": \"True\",\n \"displayValue\": \"SPECIFICATION_NAME\"\n }\n },\n\n \"store.product-review-form\": {\n \"blocks\": [\"product-review-form\"]\n }\n}\n\n```" } ]
code_bonytos-de-tema_359072be
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/store/routes.json from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.custom#about-us\": {\n \"path\": \"/about-us\"\n }\n}\n\n```" } ]
code_bonytos-de-tema_10ce4703
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/styles/css/vtex.rich-text.css from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.container--info-card-headline {\n position: absolute;\n right: 50px;\n text-align: center;\n justify-content: center;\n}\n\n.container--deals {\n color: #ffffff;\n text-align: center;\n justify-content: center;\n}\n\n.container--deals .paragraph {\n margin: 0;\n}\n\n.container--link {\n justify-content: center;\n}\n\n.container--question {\n justify-content: center;\n}\n\n.container--question .paragraph {\n text-align: center;\n color: #879F5A;\n margin: 0 16px;\n padding-top: 120px;\n}\n\n.container--question .strong {\n font-size: 32px;\n line-height: 2rem;\n font-weight: 700;\n}\n\n.container--link .paragraph {\n text-align: center;\n max-width: 540px;\n padding-top: 36px;\n padding-bottom: 84px;\n color: #03034E;\n}\n\n.container--link .strong {\n font-size: 16px;\n font-weight: 700;\n text-transform: uppercase;\n}\n\n.container--link .link {\n text-decoration: none;\n font-size: 36px;\n font-weight: 300;\n color: #03034E;\n}\n\n.container--title {\n color: #03034E;\n font-size: 28px;\n font-weight: 700;\n}\n\n@media only screen and (min-width: 640px) {\n .container--question .strong {\n font-size: 40px;\n line-height: 3rem;\n }\n\n .container--about {\n max-width: 85%;\n }\n\n .container--title {\n color: #03034E;\n font-size: 40px;\n font-weight: 700;\n max-width: 60%;\n }\n\n .container--title .paragraph {\n line-height: 1.3em;\n }\n}\n\n```" } ]
code_bonytos-de-tema_2ff216f2
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/styles/css/vtex.store-header.css from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.headerRow--menu-link :global(.vtex-menu-2-x-styledLink) {\n color: #ffffff;\n font-size: 14px;\n}\n\n.headerRow--main-header .headerRowBackground {\n background-color: #F0F0F0;\n}\n\n.headerRow--main-header :global(.vtex-menu-2-x-styledLink) {\n color: #727273;\n font-size: 14px;\n}\n\n.headerRow--main-header-mobile .headerRowBackground {\n padding: 10px 0px;\n background-color: #F0F0F0;\n}\n\n.headerRow--main-header-search-mobile .headerRowBackground {\n padding: 0px 0px;\n background-color: #F0F0F0;\n}\n\n```" } ]
code_bonytos-de-tema_608bb514
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/styles/css/vtex.store-components.css from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.notificationBarContainer {\n background-color: #E6F1E6;\n color: #03034E;\n font-weight: 700;\n font-size: 12px;\n text-decoration: underline;\n}\n\n/* .searchBarContainer {\n max-width: 265px;\n} */\n\n.infoCardContainer--info-card-home {\n max-width: 1520px;\n margin: 0 auto;\n background-color: #E6F1E6;\n padding: 0px;\n}\n\n.infoCardContainer--info-card-about-us {\n height: 720px;\n margin: 0 auto;\n padding: 0px;\n}\n\n.newsletter {\n background-color: #03054E;\n max-width: 1528px;\n margin: 0 auto;\n}\n\n.newsletter .container {\n padding: 60px 10px;\n}\n\n.label {\n color: #fff;\n font-size: 26px;\n}\n\n.inputGroup {\n padding-bottom: 4px;\n border-bottom: 2px solid #fff;\n display: flex;\n color: #fff;\n}\n\n.inputGroup input {\n background-color: transparent;\n color: #fff;\n border: none;\n padding-left: 0px;\n}\n\n.inputGroup input::placeholder {\n color: #fff;\n font-size: 16px;\n}\n\n.inputGroup button {\n background-color: transparent;\n color: #fff;\n border: none;\n margin-right: -24px;\n}\n\n.buttonContainer {\n padding-top: 0px;\n}\n\n.imageElement--storePrint {\n /* max-height: 300px; */\n margin-bottom: 20px;\n}\n\n.infoCardTextContainer--info-card-about-us {\n position: absolute;\n left: 0;\n width: 30%;\n}\n\n.infoCardHeadline--info-card-about-us {\n text-align: left;\n}\n\n.infoCardSubhead--info-card-about-us {\n text-align: left;\n}\n\n.infoCardCallActionContainer--info-card-about-us {\n align-self: flex-start;\n}\n\n@media only screen and (min-width: 640px) {\n .newsletter .container {\n padding: 140px;\n }\n\n .label {\n font-size: 40px;\n }\n\n .infoCardTextContainer--info-card-about-us {\n max-width: 100%;\n margin: 0 auto;\n background-color: #E6F1E6;\n padding: 0px;\n }\n\n .infoCardHeadline--info-card-about-us {\n text-align: center;\n }\n\n .infoCardSubhead--info-card-about-us {\n text-align: center;\n }\n\n .infoCardCallActionContainer--info-card-about-us {\n align-self: center;\n }\n\n .infoCardContainer--info-card-home .infoCardTextContainer {\n width: 30%;\n }\n\n .infoCardContainer--info-card-home .infoCardImageContainer {\n width: 70%;\n }\n\n .imageElement--storePrint {\n margin-bottom: 0px;\n /* max-height: 650px; */\n }\n}\n\n```" } ]
code_bonytos-de-tema_90f1ba12
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/styles/css/vtex.store-footer.css from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.row--menu-row {\n padding-right: 24px;\n}\n\n.row--menu-row .rowContainer {\n align-items: flex-start;\n}\n\n.row--payment-methods {\n padding-top: 16px;\n}\n\n```" } ]
code_bonytos-de-tema_dae25ec6
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/styles/css/vtex.flex-layout.css from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.flexRow--deals {\n background-color: #a7afbd;\n padding: 14px 0px;\n}\n\n.flexRow--deals .stretchChildrenWidth {\n align-items: center;\n}\n\n.flexRow--deals .flexCol {\n align-items: center;\n}\n\n.flexCol--filterCol {\n max-width: 500px;\n min-width: 230px;\n}\n\n.flexCol--productCountCol {\n align-items: flex-start;\n}\n\n.flexCol--orderByCol {\n align-items: flex-end;\n}\n\n.flexCol--orderByMobileCol {\n width: 42%;\n}\n\n.flexCol--filterMobileCol {\n width: 38%;\n}\n\n.flexCol--switcherMobileCol {\n width: 20%;\n}\n\n```" } ]
code_bonytos-de-tema_72e83fca
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/styles/css/vtex.carousel.css from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.containerImg {\n background-color: #F0F0F0;\n}\n\n.containerImg img {\n max-width: 1520px;\n}\n\n```" } ]
code_bonytos-de-tema_1239d322
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/styles/configs/style.json from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"typeScale\": [\n 3, 2.25, 1.5, 1.25, 1, 0.875, 0.75\n ],\n \"spacing\": [0.125, 0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4, 8, 16],\n \"customMedia\": [\n { \"s\": 20 },\n { \"ns\": {\n \"value\": 40,\n \"minWidth\": true\n }\n },\n { \"m\": {\n \"value\": 40,\n \"minWidth\": true\n }\n },\n { \"l\": {\n \"value\": 64,\n \"minWidth\": true\n }\n },\n { \"xl\": {\n \"value\": 80,\n \"minWidth\": true\n }\n }\n ],\n \"colors\": {\n \"black-90\": \"rgba(0,0,0,.9)\",\n \"black-80\": \"rgba(0,0,0,.8)\",\n \"black-70\": \"rgba(0,0,0,.7)\",\n \"black-60\": \"rgba(0,0,0,.6)\",\n \"black-50\": \"rgba(0,0,0,.5)\",\n \"black-40\": \"rgba(0,0,0,.4)\",\n \"black-30\": \"rgba(0,0,0,.3)\",\n \"black-20\": \"rgba(0,0,0,.2)\",\n \"black-10\": \"rgba(0,0,0,.1)\",\n \"black-05\": \"rgba(0,0,0,.05)\",\n \"black-025\": \"rgba(0,0,0,.025)\",\n \"black-0125\": \"rgba(0,0,0,.0125)\",\n\n \"white-90\": \"rgba(255,255,255,.9)\",\n \"white-80\": \"rgba(255,255,255,.8)\",\n \"white-70\": \"rgba(255,255,255,.7)\",\n \"white-60\": \"rgba(255,255,255,.6)\",\n \"white-50\": \"rgba(255,255,255,.5)\",\n \"white-40\": \"rgba(255,255,255,.4)\",\n \"white-30\": \"rgba(255,255,255,.3)\",\n \"white-20\": \"rgba(255,255,255,.2)\",\n \"white-10\": \"rgba(255,255,255,.1)\",\n \"white-05\": \"rgba(255,255,255,.05)\",\n \"white-025\": \"rgba(255,255,255,.025)\",\n \"white-0125\": \"rgba(255,255,255,.0125)\"\n },\n \"semanticColors\": {\n \"background\": {\n \"base\": \"#F4F6F0\",\n \"base--inverted\": \"#2D3C23\",\n \"action-primary\": \"#62844C\",\n \"action-secondary\": \"#eef3f7\",\n \"emphasis\": \"#FCDE89\",\n \"disabled\": \"#f2f4f5\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"hover-background\": {\n \"action-primary\": \"#879F5A\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#FCDE89\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"active-background\": {\n \"action-primary\": \"#0c389f\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#FCDE89\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"text\": {\n \"action-primary\": \"#62844C\",\n \"action-secondary\": \"#eef3f7\",\n \"link\": \"#62844C\",\n \"emphasis\": \"#FCDE89\",\n \"disabled\": \"#979899\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"visited-text\": {\n \"link\": \"#0c389f\"\n },\n \"hover-text\": {\n \"action-primary\": \"#879F5A\",\n \"action-secondary\": \"#dbe9fd\",\n \"link\": \"#0c389f\",\n \"emphasis\": \"#FCDE89\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\"\n },\n \"active-text\": {\n \"link\": \"#0c389f\",\n \"emphasis\": \"#FCDE89\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\"\n },\n \"border\": {\n \"action-primary\": \"#62844C\",\n \"action-secondary\": \"#eef3f7\",\n \"emphasis\": \"#FCDE89\",\n \"disabled\": \"#e3e4e6\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"hover-border\": {\n \"action-primary\": \"#879F5A\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#FCDE89\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"active-border\": {\n \"action-primary\": \"#0c389f\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#FCDE89\",\n \"success\": \"#8bc34a\",\n \"success--faded\": \"#eafce3\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ffb100\",\n \"warning--faded\": \"#fff6e0\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"on\": {\n \"base\": \"#3f3f40\",\n \"base--inverted\": \"#ffffff\",\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#62844C\",\n \"emphasis\": \"#ffffff\",\n \"disabled\": \"#979899\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\",\n \"muted-1\": \"#ffffff\",\n \"muted-2\": \"#ffffff\",\n \"muted-3\": \"#3f3f40\",\n \"muted-4\": \"#3f3f40\",\n \"muted-5\": \"#3f3f40\"\n },\n \"hover-on\": {\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#62844C\",\n \"emphasis\": \"#ffffff\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\"\n },\n \"active-on\": {\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#62844C\",\n \"emphasis\": \"#ffffff\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\"\n }\n },\n \"borderWidths\": [0, 0.125, 0.25, 0.5, 1, 2],\n \"borderRadius\": [0, 0.125, 0.25, 0.5, 1],\n \"widths\": [1, 2, 4, 8, 16],\n \"maxWidths\": [1, 2, 4, 8, 16, 32, 48, 64, 96],\n \"heights\": [1, 2, 4, 8, 16],\n \"sizes\": [\n {\"name\": \"small\", \"value\": 2},\n {\"name\": \"regular\", \"value\": 2.5},\n {\"name\": \"large\", \"value\": 3}\n ],\n \"typography\":{\n \"measure\": [30, 34, 20],\n \"styles\": {\n \"heading-1\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"3rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-2\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"2.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-3\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"1.75rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-4\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.5rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-5\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-6\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"body\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"small\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"0.875rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"mini\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"0.75rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"action\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"action--small\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"0.875rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"action--large\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"code\": {\n \"fontFamily\": \"Consolas, monaco, monospace\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n }\n }\n },\n \"opacity\": [1, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.05, 0.025, 0]\n}\n\n```" } ]
code_bonytos-de-tema_bf0d6f4b
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/store/blocks/product-assembly.jsonc from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"sticky-layout#buy-button\": {\n \"props\": {\n \"position\": \"bottom\"\n },\n \"children\": [\"flex-layout.row#buy-button\"]\n },\n \"product-assembly-options\": {\n \"children\": [\n \"flex-layout.row#product-assembly-options\",\n \"assembly-option-input-values\"\n ]\n },\n \"assembly-option-input-values\": {\n \"props\": {\n \"optionsDisplay\": \"box\"\n }\n },\n \"flex-layout.row#product-assembly-options\": {\n \"props\": {\n \"colGap\": 2,\n \"preserveLayoutOnMobile\": true,\n \"colSizing\": \"auto\"\n },\n \"children\": [\n \"flex-layout.col#product-assembly-image\",\n \"flex-layout.col#product-assembly-middle\",\n \"flex-layout.col#product-assembly-quantity\"\n ]\n },\n \"flex-layout.col#product-assembly-quantity\": {\n \"props\": {\n \"verticalAlign\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-quantity-selector\"\n ]\n },\n \"flex-layout.col#product-assembly-image\": {\n \"props\": {\n \"marginRight\": 4\n },\n \"children\": [\n \"assembly-option-item-image\"\n ]\n },\n \"flex-layout.col#product-assembly-middle\": {\n \"props\": {\n \"width\": \"grow\",\n \"verticalAlignment\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-name\",\n \"assembly-option-item-price\",\n \"assembly-option-item-children-description\",\n \"assembly-option-item-customize#first-level\"\n ]\n },\n \"assembly-option-item-customize#first-level\": {\n \"props\": {\n \"buttonProps\": {\n \"collapse\": \"left\"\n }\n },\n \"children\": [\n \"flex-layout.row#item-customize\"\n ]\n },\n \"flex-layout.row#item-customize\": {\n \"props\": {\n \"colGap\": 2,\n \"preserveLayoutOnMobile\": true,\n \"colSizing\": \"auto\"\n },\n \"children\": [\n \"flex-layout.col#product-assembly-image\",\n \"flex-layout.col#item-customize-middle\",\n \"flex-layout.col#item-customize-quantity\"\n ]\n },\n \"flex-layout.col#item-customize-middle\": {\n \"props\": {\n \"width\": \"grow\",\n \"verticalAlignment\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-name\",\n \"assembly-option-item-price\",\n \"assembly-option-item-children-description\",\n \"assembly-option-item-customize#sec-level\"\n ]\n },\n \"flex-layout.col#item-customize-quantity\": {\n \"props\": {\n \"horizontalAlign\": \"right\",\n \"verticalAlign\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-quantity-selector\"\n ]\n },\n \"assembly-option-item-customize#sec-level\": {\n \"props\": {\n \"buttonProps\": {\n \"collapse\": \"left\"\n }\n },\n \"children\": [\n \"assembly-option-item-image\",\n \"assembly-option-item-name\",\n \"assembly-option-item-price\",\n \"assembly-option-item-quantity-selector\"\n ]\n }\n}\n```" } ]
code_bonytos-de-tema_a621474f
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/store/blocks/about-us.json from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.custom#about-us\": {\n \"blocks\": [\n \"info-card#about-us\"\n ]\n },\n\n \"info-card#about-us\": {\n \"props\": {\n \"id\": \"info-card-about-us\",\n \"isFullModeStyle\": true,\n \"textPosition\": \"center\",\n \"imageUrl\": \"https://i.imgur.com/20MIGfk.png\",\n \"headline\": \"We are a company focused on natural products\",\n \"subhead\": \"We believe that natural beauty comes allong with organic products. We don't test in animals.\",\n \"callToActionText\": \"Subscribe to newsletter\",\n \"callToActionUrl\": \"/sale/d\",\n \"blockClass\": \"info-card-about-us\",\n \"textAlignment\": \"center\"\n }\n }\n}\n\n```" } ]
code_bonytos-de-tema_4e31cedc
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/store/blocks/product.json from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.product\": {\n \"children\": [\n \"flex-layout.row#product-breadcrumb\",\n \"flex-layout.row#product-main\",\n \"shelf.relatedProducts\",\n \"product-description\",\n \"product-reviews\",\n \"product-questions-and-answers\"\n ]\n },\n \"product-description\": {\n \"props\": {\n \"description\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consequat, dolor vel gravida placerat, nisi justo varius arcu, in scelerisque nisi risus non nibh. Ut suscipit nunc eu dui placerat convallis. Sed accumsan ultricies enim non facilisis. Donec nec pulvinar dolor. Etiam sollicitudin varius cursus. Pellentesque dignissim neque eu nisi finibus venenatis. Nunc ac CLEITON eget lacus scelerisque hendrerit nec sed lectus. Fusce feugiat tincidunt auctor. In dictum sapien pulvinar felis viverra malesuada. Etiam feugiat lobortis maximus. Sed augue lacus, euismod at arcu a, scelerisque vulputate erat. Pellentesque justo ipsum, auctor in arcu eu, ornare ullamcorper elit. Donec sed nisi semper ligula cursus pellentesque ac non lacus. Etiam semper quam vehicula, posuere nunc nec, vehicula eros.\"\n }\n },\n \"flex-layout.row#product-breadcrumb\": {\n \"props\": {\n \"marginTop\": 4\n },\n \"children\": [\"breadcrumb\"]\n },\n \"flex-layout.row#product-main\": {\n \"props\": {\n \"colGap\": 7,\n \"rowGap\": 7,\n \"marginTop\": 4,\n \"marginBottom\": 7,\n \"paddingTop\": 7,\n \"paddingBottom\": 7\n },\n \"children\": [\"flex-layout.col#stack\", \"flex-layout.col#right-col\"]\n },\n\n \"stack-layout\": {\n \"children\": [\n \"flex-layout.row#product-image\",\n \"product-specification-badges\"\n ]\n },\n\n \"product-specification-badges\": {\n \"props\": {\n \"specificationGroupName\": \"Group\",\n \"specificationName\": \"On Sale\",\n \"visibleWhen\": \"True\",\n \"displayValue\": \"SPECIFICATION_NAME\"\n }\n },\n\n \"flex-layout.col#stack\": {\n \"children\": [\"stack-layout\"],\n \"props\": {\n \"width\": \"60%\",\n \"rowGap\": 0\n }\n },\n \"flex-layout.row#product-image\": {\n \"children\": [\"product-images\"]\n },\n \"product-images\": {\n \"props\": {\n \"displayThumbnailsArrows\": true\n }\n },\n \"flex-layout.col#right-col\": {\n \"props\": {\n \"preventVerticalStretch\": true,\n \"rowGap\": 0\n },\n \"children\": [\n \"product-name\",\n \"product-rating-summary\",\n \"product-price#product-details\",\n \"product-separator\",\n \"product-quantity\",\n \"product-identifier.product\",\n \"sku-selector\",\n \"product-assembly-options\",\n \"flex-layout.row#buy-button\",\n \"availability-subscriber\"\n ]\n },\n\n \"product-price#product-details\": {\n \"props\": {\n \"showInstallments\": true,\n \"showSavings\": false,\n \"showListPrice\": true\n }\n },\n\n \"flex-layout.row#buy-button\": {\n \"props\": {\n \"marginTop\": 4,\n \"marginBottom\": 7\n },\n \"children\": [\"buy-button\"]\n }\n}\n\n```" } ]
code_bonytos-de-tema_a8f69b92
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/store/blocks/search.jsonc from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.search\": {\n \"blocks\": [\"search-result-layout\"]\n },\n\n \"store.search#brand\": {\n \"blocks\": [\"search-result-layout\"],\n \"props\": {\n \"context\": {\n \"orderByField\": \"OrderByReleaseDateDESC\",\n \"hideUnavailableItems\": true,\n \"maxItemsPerPage\": 10\n }\n }\n },\n\n \"store.search#department\": {\n \"blocks\": [\"search-result-layout\"]\n },\n\n \"store.search#category\": {\n \"blocks\": [\"search-result-layout\"]\n },\n\n \"store.search#subcategory\": {\n \"blocks\": [\"search-result-layout\"]\n },\n\n \"search-result-layout\": {\n \"blocks\": [\n \"search-result-layout.desktop\",\n \"search-result-layout.mobile\",\n \"search-not-found-layout\"\n ]\n },\n\n \"search-result-layout.desktop\": {\n \"children\": [\n \"flex-layout.row#searchbread\",\n \"flex-layout.row#searchtitle\",\n \"flex-layout.row#result\"\n ],\n \"props\": {\n \"pagination\": \"show-more\",\n \"mobileLayout\": {\n \"mode1\": \"small\",\n \"mode2\": \"normal\"\n }\n }\n },\n \"flex-layout.row#searchbread\": {\n \"children\": [\"breadcrumb.search\"],\n \"props\": {\n \"preserveLayoutOnMobile\": true,\n \"fullWidth\": true\n }\n },\n \"flex-layout.row#searchtitle\": {\n \"children\": [\"search-title.v2\"]\n },\n \"flex-layout.row#result\": {\n \"children\": [\"flex-layout.col#filter\", \"flex-layout.col#content\"],\n \"props\": {\n \"preventHorizontalStretch\": true,\n \"fullWidth\": true\n }\n },\n \"flex-layout.col#filter\": {\n \"children\": [\"filter-navigator.v3\"],\n \"props\": {\n \"blockClass\": \"filterCol\"\n }\n },\n \"flex-layout.col#content\": {\n \"children\": [\n \"flex-layout.row#searchinfo\",\n \"flex-layout.row#fetchprevious\",\n \"flex-layout.row#products\",\n \"flex-layout.row#fetchmore\"\n ],\n \"props\": {\n \"width\": \"grow\"\n }\n },\n \"flex-layout.row#searchinfo\": {\n \"children\": [\"flex-layout.col#productCount\", \"flex-layout.col#orderby\"]\n },\n \"flex-layout.col#productCount\": {\n \"children\": [\"total-products.v2\"],\n \"props\": {\n \"blockClass\": \"productCountCol\"\n }\n },\n \"flex-layout.col#orderby\": {\n \"children\": [\"order-by.v2\"],\n \"props\": {\n \"blockClass\": \"orderByCol\"\n }\n },\n \"flex-layout.row#fetchprevious\": {\n \"props\": {\n \"marginBottom\": 3\n },\n \"children\": [\"search-fetch-previous\"]\n },\n \"flex-layout.row#fetchmore\": {\n \"props\": {\n \"marginTop\": 3\n },\n \"children\": [\"search-fetch-more\"]\n },\n \"flex-layout.row#products\": {\n \"children\": [\"search-content\"]\n },\n \"search-content\": {\n \"blocks\": [\"gallery\", \"not-found\"]\n },\n\n \"search-result-layout.mobile\": {\n \"children\": [\n \"flex-layout.row#searchinfomobile\",\n \"flex-layout.row#searchbread\",\n \"flex-layout.row#productCountMobile\",\n \"flex-layout.row#contentmobile\"\n ],\n \"props\": {\n \"pagination\": \"show-more\",\n \"mobileLayout\": {\n \"mode1\": \"small\",\n \"mode2\": \"normal\"\n }\n }\n },\n \"flex-layout.row#contentmobile\": {\n \"children\": [\"search-content\"],\n \"props\": {\n \"preserveLayoutOnMobile\": true\n }\n },\n\n \"flex-layout.row#searchinfomobile\": {\n \"children\": [\n \"flex-layout.col#orderByMobile\",\n \"flex-layout.col#filterMobile\",\n \"flex-layout.col#switcherMobile\"\n ],\n \"props\": {\n \"preserveLayoutOnMobile\": true,\n \"colSizing\": \"auto\",\n \"colJustify\": \"around\"\n }\n },\n\n \"flex-layout.col#orderByMobile\": {\n \"children\": [\"order-by.v2\"],\n \"props\": {\n \"blockClass\": \"orderByMobileCol\"\n }\n },\n\n \"flex-layout.row#productCountMobile\": {\n \"children\": [\"total-products.v2\"],\n \"props\": {\n \"blockClass\": \"productCountMobileRow\"\n }\n },\n\n \"flex-layout.col#filterMobile\": {\n \"children\": [\"filter-navigator.v3\"],\n \"props\": {\n \"blockClass\": \"filterMobileCol\"\n }\n },\n \"flex-layout.col#switcherMobile\": {\n \"children\": [\"search-layout-switcher\"],\n \"props\": {\n \"blockClass\": \"switcherMobileCol\"\n }\n },\n \"search-not-found-layout\": {\n \"children\": [\"flex-layout.row#searchbread\", \"flex-layout.row#notfound\"]\n },\n\n \"flex-layout.row#notfound\": {\n \"children\": [\"not-found\"],\n \"props\": {\n \"fullWidth\": true\n }\n },\n\n \"breadcrumb\": {\n \"props\": {\n \"showOnMobile\": true\n }\n },\n\n \"gallery\": {\n \"blocks\": [\"product-summary.shelf\"]\n }\n}\n\n```" } ]
code_bonytos-de-tema_6165b651
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/store/blocks/home/home.jsonc from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.home\": {\n \"blocks\": [\n \"carousel#home\",\n \"shelf#home\",\n \"info-card#home\",\n \"rich-text#question\"\n ]\n },\n\n \"carousel#home\": {\n \"props\": {\n \"autoplay\": false,\n \"banners\": [\n {\n \"image\": \"https://i.imgur.com/iBnFjgI.jpg\",\n \"mobileImage\": \"https://storecomponents.vteximg.com.br/arquivos/banner-principal-mobile.jpg\"\n },\n {\n \"image\": \"https://www.onegreenplanet.org/wp-content/uploads/2018/12/shutterstock_1428218030-1200x800.jpg\",\n \"mobileImage\": \"https://i.imgur.com/Xbj6T5t.png\"\n },\n {\n \"image\": \"https://i.imgur.com/yW173iW.jpg\",\n \"mobileImage\": \"https://storecomponents.vteximg.com.br/arquivos/banner-principal-mobile.jpg\"\n }\n ],\n \"height\": 550,\n \"showArrows\": true,\n \"showDots\": true\n }\n },\n\n \"shelf#home\": {\n \"blocks\": [\"product-summary.shelf\"],\n \"props\": {\n \"orderBy\": \"OrderByBestDiscountDESC\",\n \"collection\": 138,\n \"paginationDotsVisibility\": \"visible\",\n \"productList\": {\n \"maxItems\": 4,\n \"itemsPerPage\": 4,\n \"minItemsPerPage\": 1.5,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"titleText\": \"Natural beauty\"\n }\n }\n },\n\n \"product-summary#home\": {\n \"props\": {\n \"isOneClickBuy\": true,\n \"showBadge\": true,\n \"badgeText\": \"OFF\",\n \"buyButtonText\": \"Add to avocart 🥑\",\n \"displayBuyButton\": \"displayButtonHover\",\n \"showCollections\": false,\n \"showListPrice\": true,\n \"labelSellingPrice\": \"To\",\n \"labelListPrice\": \"From\",\n \"showLabels\": true,\n \"showInstallments\": true,\n \"showSavings\": true,\n \"name\": {\n \"showBrandName\": true,\n \"showSku\": true,\n \"showProductReference\": true\n }\n }\n },\n\n \"info-card#home\": {\n \"props\": {\n \"id\": \"info-card-home\",\n \"isFullModeStyle\": false,\n \"textPosition\": \"center\",\n \"imageUrl\": \"https://morethanglam.com/wp-content/uploads/2016/05/Alternative-skin-care-and-scrub-fresh-avocado-leaves-sea-salt-oils-lime-and-honey-on-marble-background.jpg\",\n \"headline\": \"Self-care line focused on natural products\",\n \"callToActionText\": \"DISCOVER\",\n \"callToActionUrl\": \"/sale/d\",\n \"blockClass\": \"info-card-home\",\n \"textAlignment\": \"center\"\n }\n },\n\n \"rich-text#question\": {\n \"props\": {\n \"text\": \"**This is the best example store built using the VTEX platform.\\nWe are the \\\"Bonytos de Tema\\\" team in the Hackatheme.\\nPlease rate us.**\",\n \"blockClass\": \"question\"\n }\n }\n}\n\n```" } ]
code_bonytos-de-tema_8d8ecb5c
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/store/blocks/home/deals.json from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"flex-layout.row#deals\": {\n \"children\": [\n \"flex-layout.col#deals1\",\n \"flex-layout.col#deals2\",\n \"flex-layout.col#deals3\",\n \"flex-layout.col#deals4\"\n ],\n \"props\": {\n \"blockClass\": \"deals\"\n }\n },\n\n \"flex-layout.col#deals1\": {\n \"children\": [\n \"image#deal1\",\n \"rich-text#deal1\"\n ]\n },\n \"image#deal1\": {\n \"props\": {\n \"src\": \"https://storecomponents.vteximg.com.br/arquivos/box.png\",\n \"maxHeight\": \"24px\"\n }\n },\n \"rich-text#deal1\": {\n \"props\": {\n \"text\": \"Free shipping\",\n \"blockClass\": \"deals\"\n }\n },\n \"flex-layout.col#deals2\": {\n \"children\": [\n \"image#deal2\",\n \"rich-text#deal2\"\n ]\n },\n \"image#deal2\": {\n \"props\": {\n \"src\": \"https://storecomponents.vteximg.com.br/arquivos/delivery-fast.png\",\n \"maxHeight\": \"24px\"\n }\n },\n \"rich-text#deal2\": {\n \"props\": {\n \"text\": \"One day delivery\",\n \"blockClass\": \"deals\"\n }\n },\n \"flex-layout.col#deals3\": {\n \"children\": [\n \"image#deal3\",\n \"rich-text#deal3\"\n ]\n },\n \"image#deal3\": {\n \"props\": {\n \"src\": \"https://storecomponents.vteximg.com.br/arquivos/store.png\",\n \"maxHeight\": \"24px\"\n }\n },\n \"rich-text#deal3\": {\n \"props\": {\n \"text\": \"Pick up in store\",\n \"blockClass\": \"deals\"\n }\n },\n \"flex-layout.col#deals4\": {\n \"children\": [\n \"image#deal4\",\n \"rich-text#deal4\"\n ]\n },\n \"image#deal4\": {\n \"props\": {\n \"src\": \"https://storecomponents.vteximg.com.br/arquivos/coupon.png\",\n \"maxHeight\": \"24px\"\n }\n },\n \"rich-text#deal4\": {\n \"props\": {\n \"text\": \"Exclusive deals\",\n \"blockClass\": \"deals\"\n }\n }\n}\n\n```" } ]
code_bonytos-de-tema_a97241d9
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/store/blocks/footer/footer.json from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"footer\": {\n \"blocks\": [\"footer-layout.desktop\", \"footer-layout.mobile\"]\n },\n \"footer-layout.desktop\": {\n \"children\": [\n \"flex-layout.row#footer-1-desktop\",\n \"flex-layout.row#footer-2-desktop\",\n \"flex-layout.row#footer-3-desktop\"\n ]\n },\n \"flex-layout.row#footer-1-desktop\": {\n \"children\": [\n \"social-networks\"\n ],\n \"props\": {\n \"blockClass\": \"menu-row\",\n \"paddingTop\": 6,\n \"paddingBottom\": 3\n }\n },\n\n \"social-networks\": {\n \"props\": {\n \"socialNetworks\": [\n {\n \"name\": \"Facebook\",\n \"url\": \"https://www.facebook.com/omelhordavovojuju/\"\n },\n {\n \"name\": \"Instagram\",\n \"url\": \"https://www.instagram.com/vovojujuu/\"\n },\n {\n \"name\": \"Twitter\",\n \"url\": \"https://twitter.com/jujudisse?lang=en\"\n },\n {\n \"name\": \"Youtube\",\n \"url\": \"https://www.youtube.com/watch?v=Iq8Y5Z1PIuQ\"\n }\n ]\n }\n },\n\n \"flex-layout.row#footer-2-desktop\": {\n \"children\": [\"accepted-payment-methods\"],\n \"props\": {\n \"blockClass\": \"payment-methods\"\n }\n },\n \"accepted-payment-methods\": {\n \"props\": {\n \"paymentMethods\": []\n }\n },\n\n \"flex-layout.row#footer-3-desktop\": {\n \"children\": [\"rich-text#footer\"],\n \"props\": {\n \"blockClass\": \"credits\"\n }\n },\n \"rich-text#footer\": {\n \"props\": {\n \"text\": \"\",\n \"blockClass\": \"footer\"\n }\n },\n\n \"footer-layout.mobile\": {\n \"children\": [\n \"flex-layout.row#2-footer-mobile\"\n ]\n },\n \"flex-layout.row#2-footer-mobile\": {\n \"children\": [\"flex-layout.col#footer-1-mobile\"],\n \"props\": {\n \"blockClass\": \"payment-methods\",\n \"paddingTop\": 4,\n \"paddingBottom\": 4\n }\n },\n \"flex-layout.col#footer-1-mobile\": {\n \"children\": [\n \"accepted-payment-methods\",\n \"social-networks\",\n \"rich-text#footer-mobile\"\n ],\n \"props\": {\n \"blockClass\": \"payment-methods\",\n \"paddingTop\": 4,\n \"paddingBottom\": 4,\n \"rowGap\": 4\n }\n },\n \"flex-layout.row#1-footer-mobile\": {\n \"props\": {\n \"paddingTop\": 4,\n \"paddingBottom\": 4\n },\n \"children\": [\"vtex.menu@2.x:menu#footer-mobile\"]\n },\n \"rich-text#footer-mobile\": {\n \"props\": {\n \"text\": \"\",\n \"blockClass\": \"footer\"\n }\n }\n}\n\n```" } ]
code_bonytos-de-tema_b60cfcc8
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/store/blocks/footer/menu.json from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"vtex.menu@2.x:menu#Products\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#news\",\n \"menu-item#blackfriday\",\n \"menu-item#sale\",\n \"menu-item#personalization\"\n ]\n },\n \"menu-item#news\": {\n \"props\": {\n \"id\": \"menu-item-news\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"News\",\n \"text\": \"News\"\n }\n }\n },\n \"menu-item#blackfriday\": {\n \"props\": {\n \"id\": \"menu-item-black-friday\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"BlackFriday\",\n \"text\": \"Black Friday\"\n }\n }\n },\n \"menu-item#sale\": {\n \"props\": {\n \"id\": \"menu-item-sale\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Sale\",\n \"text\": \"Sale\"\n }\n }\n },\n \"menu-item#personalization\": {\n \"props\": {\n \"id\": \"menu-item-personalization\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Personalization\",\n \"text\": \"Personalization\"\n }\n }\n },\n\n \"vtex.menu@2.x:menu#footer-decoration\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#smartphones\",\n \"menu-item#videogames\",\n \"menu-item#tvs\"\n ]\n },\n\n \"menu-item#smartphones\": {\n \"props\": {\n \"id\": \"menu-item-smartphones\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/decoration/smartphones\",\n \"noFollow\": true,\n \"tagTitle\": \"Smartphones\",\n \"text\": \"Smartphones\"\n }\n }\n },\n\n \"menu-item#videogames\": {\n \"props\": {\n \"id\": \"menu-item-videogames\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/decoration/videogames\",\n \"noFollow\": true,\n \"tagTitle\": \"Videogames\",\n \"text\": \"Videogames\"\n }\n }\n },\n\n \"menu-item#tvs\": {\n \"props\": {\n \"id\": \"menu-item-tvs\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/decoration/tvs\",\n \"noFollow\": true,\n \"tagTitle\": \"TVs\",\n \"text\": \"TVs\"\n }\n }\n },\n\n \"vtex.menu@2.x:menu#footer-bags\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#bags\",\n \"menu-item#backpacks\",\n \"menu-item#necessaire\"\n ]\n },\n\n \"menu-item#bags\": {\n \"props\": {\n \"id\": \"menu-item-bags\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/bags/d\",\n \"noFollow\": true,\n \"tagTitle\": \"Bags\",\n \"text\": \"Bags\"\n }\n }\n },\n\n \"menu-item#backpacks\": {\n \"props\": {\n \"id\": \"menu-item-backpacks\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/bags/backpacks\",\n \"noFollow\": true,\n \"tagTitle\": \"Backpacks\",\n \"text\": \"Backpacks\"\n }\n }\n },\n\n \"menu-item#necessaire\": {\n \"props\": {\n \"id\": \"menu-item-necessaire\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/bags/necessaire\",\n \"noFollow\": true,\n \"tagTitle\": \"Necessaire\",\n \"text\": \"Necessaire\"\n }\n }\n },\n\n \"vtex.menu@2.x:menu#footer-clothing\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#clothing\",\n \"menu-item#shorts\",\n \"menu-item#tank-tops\",\n \"menu-item#shirts\",\n \"menu-item#sweatshirt\",\n \"menu-item#cropped\"\n ]\n },\n\n \"vtex.menu@2.x:menu#footer-mobile\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#clothing-mobile\",\n \"menu-item#decoration-mobile\",\n \"menu-item#sale-mobile\"\n ]\n },\n\n \"menu-item#clothing-mobile\": {\n \"props\": {\n \"id\": \"menu-item-category-clothing\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/d\",\n \"noFollow\": true,\n \"tagTitle\": \"Clothing\",\n \"text\": \"Clothing\"\n }\n },\n \"blocks\": [\"vtex.menu@2.x:submenu.accordion#clothing\"]\n },\n \"vtex.menu@2.x:submenu.accordion#clothing\": {\n \"children\": [\"vtex.menu@2.x:menu#clothing-accordion\"]\n },\n\n \"vtex.menu@2.x:menu#clothing-accordion\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#shorts\",\n \"menu-item#tank-tops\",\n \"menu-item#shirts\",\n \"menu-item#sweatshirt\",\n \"menu-item#cropped\"\n ]\n },\n\n \"menu-item#decoration-mobile\": {\n \"props\": {\n \"itemProps\": {\n \"tagTitle\": \"Decoration\",\n \"text\": \"Decoration\"\n }\n },\n \"blocks\": [\"vtex.menu@2.x:submenu.accordion#decoration\"]\n },\n \"vtex.menu@2.x:submenu.accordion#decoration\": {\n \"children\": [\"vtex.menu@2.x:menu#footer-decoration-mobile\"]\n },\n\n \"vtex.menu@2.x:menu#footer-decoration-mobile\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#smartphones\",\n \"menu-item#videogames\",\n \"menu-item#tvs\"\n ]\n },\n\n \"menu-item#sale-mobile\": {\n \"props\": {\n \"itemProps\": {\n \"tagTitle\": \"Sale\",\n \"text\": \"Sale\"\n }\n },\n \"blocks\": [\"vtex.menu@2.x:submenu.accordion#sale\"]\n },\n \"vtex.menu@2.x:submenu.accordion#sale\": {\n \"children\": [\"vtex.menu@2.x:menu#footer-sale-mobile\"]\n },\n\n \"vtex.menu@2.x:menu#footer-sale-mobile\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#smartphones\",\n \"menu-item#videogames\",\n \"menu-item#tvs\"\n ]\n },\n\n \"menu-item#clothing\": {\n \"props\": {\n \"id\": \"menu-item-category-clothing\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/d\",\n \"noFollow\": true,\n \"tagTitle\": \"Clothing\",\n \"text\": \"Clothing\"\n }\n }\n },\n \"menu-item#category-maquiagem\": {\n \"props\": {\n \"id\": \"menu-item-category-category-maquiagem\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/maquiagem/d\",\n \"noFollow\": true,\n \"tagTitle\": \"Maquiagem\",\n \"text\": \"Maquiagem\"\n }\n }\n },\n\n \"menu-item#shorts\": {\n \"props\": {\n \"id\": \"menu-item-shorts\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/shorts\",\n \"noFollow\": false,\n \"tagTitle\": \"Shorts\",\n \"text\": \"Shorts\"\n }\n }\n },\n\n \"menu-item#tank-tops\": {\n \"props\": {\n \"id\": \"menu-item-tank-tops\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/tank-tops\",\n \"noFollow\": false,\n \"tagTitle\": \"Tank tops\",\n \"text\": \"Tank tops\"\n }\n }\n },\n\n \"menu-item#shirts\": {\n \"props\": {\n \"id\": \"menu-item-shirts\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/shirts\",\n \"noFollow\": false,\n \"tagTitle\": \"Shirts\",\n \"text\": \"Shirts\"\n }\n }\n },\n\n \"menu-item#sweatshirt\": {\n \"props\": {\n \"id\": \"menu-item-sweat-shirts\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/sweatshirt\",\n \"noFollow\": false,\n \"tagTitle\": \"Sweatshirt\",\n \"text\": \"Sweatshirt\"\n }\n }\n },\n\n \"menu-item#cropped\": {\n \"props\": {\n \"id\": \"menu-item-cropped\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/clothing/cropped\",\n \"noFollow\": false,\n \"tagTitle\": \"Cropped\",\n \"text\": \"Cropped\"\n }\n }\n }\n}\n\n```" } ]
code_bonytos-de-tema_358fe364
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/store/blocks/header/header.json from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"header\": {\n \"blocks\": [\n \"header-layout.desktop\",\n \"header-layout.mobile\"\n ]\n },\n \"header.full\": {\n \"blocks\": [\n \"header-layout.desktop\",\n \"header-layout.mobile\"\n ]\n },\n \"header-layout.desktop\": {\n \"children\": [\n \"header-row#42-desktop\"\n ],\n \"props\": {\n \"fullWidth\": true\n }\n },\n\n \"header-row#42-desktop\": {\n \"children\": [\n \"drawer\",\n \"logo#desktop\",\n \"vtex.menu@2.x:menu#category-menu\",\n \"header-spacer\",\n \"header-spacer\",\n \"search-bar\",\n \"locale-switcher\",\n \"login\",\n \"minicart\"\n ],\n \"props\": {\n \"fullWidth\": true,\n \"compactMode\": true\n }\n },\n\n \"header-row#1-desktop\": {\n \"children\": [\n \"telemarketing\"\n ],\n \"props\": {\n \"fullWidth\": true\n }\n },\n\n \"header-row#2-desktop\": {\n \"children\": [\n \"notification.bar#home\"\n ],\n \"props\": {\n \"fullWidth\": \"true\"\n }\n },\n \"notification.bar#home\": {\n \"props\": {\n \"content\": \"SELECTED ITEMS ON SALE! CHECK IT OUT!\"\n }\n },\n \"header-row#3-desktop\": {\n \"children\": [\n \"vtex.menu@2.x:menu#websites\",\n \"header-spacer\",\n \"vtex.menu@2.x:menu#institutional\"\n ],\n \"props\": {\n \"blockClass\": \"menu-link\",\n \"inverted\": \"true\"\n }\n },\n \"header-row#4-desktop\": {\n \"children\": [\n \"logo#desktop\",\n \"vtex.menu@2.x:menu#category-menu\",\n \"header-spacer\",\n \"header-spacer\",\n \"search-bar\",\n \"locale-switcher\",\n \"login\",\n \"minicart\"\n ],\n \"props\": {\n \"sticky\": true,\n \"blockClass\": \"main-header\"\n }\n },\n \"logo#desktop\": {\n \"props\": {\n \"title\": \"Logo\",\n \"href\": \"/\",\n \"url\": \"https://i.imgur.com/Xbj6T5t.png\",\n \"width\": \"37\"\n }\n },\n\n \"minicart\": {\n \"blocks\": [\n \"product-summary\"\n ],\n \"props\": {\n \"type\": \"popup\",\n \"showRemoveButton\": true,\n \"showDiscount\": true,\n \"showSku\": true,\n \"labelMiniCartEmpty\": \"\",\n \"labelButtonFinishShopping\": \"Go to checkout\",\n \"enableQuantitySelector\": true,\n \"maxQuantity\": 10,\n \"labelClasses\": \"gray\"\n }\n },\n\n \"header-layout.mobile\": {\n \"children\": [\n \"header-row#1-mobile\",\n \"header-row#2-mobile\"\n ]\n },\n \"header-row#1-mobile\": {\n \"children\": [\n \"drawer\",\n \"logo#mobile\",\n \"header-spacer\",\n \"header-spacer\",\n \"minicart\"\n ],\n \"props\": {\n \"sticky\": true,\n \"blockClass\": \"main-header-mobile\"\n }\n },\n \"header-row#2-mobile\": {\n \"children\": [\n \"search-bar#mobile\"\n ],\n \"props\": {\n \"sticky\": true,\n \"blockClass\": \"main-header-search-mobile\",\n \"fullWidth\": true\n }\n },\n \"drawer\": {\n \"children\": [\n \"menu#drawer\"\n ]\n },\n\n \"menu#drawer\": {\n \"children\": [\n \"menu-item#category-maquiagem\",\n \"menu-item#category-perfumes\",\n \"menu-item#category-cabelo\"\n ],\n \"props\": {\n \"orientation\": \"vertical\"\n }\n },\n \"menu-item#category-maquiagem\": {\n \"props\": {\n \"id\": \"menu-item-category-maquiagem\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/makeup/\",\n \"noFollow\": true,\n \"tagTitle\": \"Maquiagem\",\n \"text\": \"Maquiagem\"\n }\n }\n },\n \"menu-item#category-perfumes\": {\n \"props\": {\n \"id\": \"menu-item-category-perfumes\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/perfume/\",\n \"noFollow\": true,\n \"tagTitle\": \"Perfumes\",\n \"text\": \"Perfumes\"\n }\n }\n },\n \"menu-item#category-cabelo\": {\n \"props\": {\n \"id\": \"menu-item-hair\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/hair/\",\n \"noFollow\": true,\n \"tagTitle\": \"Cabelo\",\n \"text\": \"Cabelo\"\n }\n }\n },\n\n \"logo#mobile\": {\n \"props\": {\n \"title\": \"Logo\",\n \"href\": \"/\",\n \"url\": \"https://i.imgur.com/Xbj6T5t.png\",\n \"width\": \"30\",\n \"blockClass\": \"logo-mobile\"\n }\n },\n \"search-bar#desktop\": {\n \"props\": {\n \"compactMode\":false\n }\n },\n \"search-bar#mobile\": {\n \"props\": {\n \"maxWidth\": \"3\"\n }\n }\n}\n\n```" } ]
code_bonytos-de-tema_b8a2fe80
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/store/blocks/header/category-menu.json from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"vtex.menu@2.x:menu#category-menu\": {\n \"children\": [\n \"menu-item#category-maquiagem\",\n \"menu-item#category-perfumes\",\n \"menu-item#category-cabelo\",\n \"menu-item#about-us\"\n ]\n },\n \"menu-item#category-clothing\": {\n \"props\": {\n \"id\": \"menu-item-category-clothing\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/apparel---accessories/clothing/\",\n \"noFollow\": true,\n \"tagTitle\": \"Clothing\",\n \"text\": \"Clothing\"\n }\n },\n \"blocks\": [\n \"vtex.menu@2.x:submenu#category-clothing\"\n ]\n },\n \"vtex.menu@2.x:submenu#category-clothing\": {\n \"props\": {\n \"width\": \"auto\"\n },\n \"children\": [\n \"vtex.menu@2.x:menu#category-clothing\"\n ]\n },\n \"vtex.menu@2.x:menu#category-clothing\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#category-clothing-hats\",\n \"menu-item#category-clothing-shoes\",\n \"menu-item#category-clothing-bags\"\n ]\n },\n \"menu-item#category-clothing-hats\": {\n \"props\": {\n \"id\": \"menu-item-category-clothing-hats\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/apparel---accessories/hats/\",\n \"noFollow\": true,\n \"tagTitle\": \"Hats\",\n \"text\": \"Hats\"\n }\n }\n },\n \"menu-item#category-maquiagem\": {\n \"props\": {\n \"id\": \"menu-item-category-maquiagem\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/makeup/\",\n \"noFollow\": true,\n \"tagTitle\": \"Maquiagem\",\n \"text\": \"Maquiagem\"\n }\n }\n },\n \"menu-item#category-perfumes\": {\n \"props\": {\n \"id\": \"menu-item-category-perfumes\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/perfume/\",\n \"noFollow\": true,\n \"tagTitle\": \"Perfumes\",\n \"text\": \"Perfumes\"\n }\n }\n },\n \"menu-item#category-cabelo\": {\n \"props\": {\n \"id\": \"menu-item-hair\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/hair/\",\n \"noFollow\": true,\n \"tagTitle\": \"Cabelo\",\n \"text\": \"Cabelo\"\n }\n }\n },\n \"menu-item#about-us\": {\n \"props\": {\n \"id\": \"menu-item-about-us\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/about-us\",\n \"noFollow\": true,\n \"tagTitle\": \"About us\",\n \"text\": \"About us\"\n }\n }\n },\n \"menu-item#category-clothing-shoes\": {\n \"props\": {\n \"id\": \"menu-item-category-clothing-shoes\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/apparel---accessories/shoes/\",\n \"noFollow\": true,\n \"tagTitle\": \"Shoes\",\n \"text\": \"Shoes\"\n }\n }\n },\n \"menu-item#category-clothing-bags\": {\n \"props\": {\n \"id\": \"menu-item-category-clothing-bags\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/apparel---accessories/bags/\",\n \"noFollow\": true,\n \"tagTitle\": \"Bags\",\n \"text\": \"Bags\"\n }\n }\n },\n \"menu-item#category-decoration\": {\n \"props\": {\n \"id\": \"menu-item-category-decoration\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/home---decor/\",\n \"noFollow\": true,\n \"tagTitle\": \"Decoration\",\n \"text\": \"Decoration\"\n }\n }\n },\n \"menu-item#custom-sale\": {\n \"props\": {\n \"id\": \"menu-item-custom-sale\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/sale/d\",\n \"noFollow\": true,\n \"tagTitle\": \"Sale\",\n \"text\": \"Sale\"\n }\n },\n \"blocks\": [\n \"vtex.menu@2.x:submenu#custom-sale\"\n ]\n },\n \"vtex.menu@2.x:submenu#custom-sale\": {\n \"props\": {\n \"width\": \"100%\"\n },\n \"children\": [\n \"vtex.menu@2.x:menu#custom-sale\",\n \"info-card#home\"\n ]\n },\n \"vtex.menu@2.x:menu#custom-sale\": {\n \"props\": {\n \"orientation\": \"vertical\"\n },\n \"children\": [\n \"menu-item#category-clothing-hats\",\n \"menu-item#category-clothing-shoes\"\n ]\n }\n}\n\n```" } ]
code_bonytos-de-tema_8ec0946b
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of bonytos-de-tema/store/blocks/header/top-menu.json from the bonytos-de-tema VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"vtex.menu@2.x:menu#websites\": {\n \"children\": [\n \"menu-item#shop\",\n \"menu-item#about-us\"\n ]\n },\n \"menu-item#shop\": {\n \"props\": {\n \"id\": \"menu-item-shop\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Shop\",\n \"text\": \"Shop\"\n }\n }\n },\n \"menu-item#about-us\": {\n \"props\": {\n \"id\": \"menu-item-about-us\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/about-us\",\n \"noFollow\": false,\n \"tagTitle\": \"about-us\",\n \"text\": \"About Us\"\n }\n }\n },\n \"vtex.menu@2.x:menu#institutional\": {\n \"children\": [\n \"menu-item#vtex-website\"\n ]\n },\n \"menu-item#vtex-website\": {\n \"props\": {\n \"id\": \"menu-item-vtex-website\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"external\",\n \"href\": \"http://vtex.com\",\n \"noFollow\": false,\n \"tagTitle\": \"visit vtex.com\",\n \"text\": \"visit vtex.com\"\n }\n }\n }\n}\n\n```" } ]
code_cypress-example_2238227b
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of cypress-example/node/service.json from the cypress-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"memory\": 256,\n \"ttl\": 10,\n \"timeout\": 2,\n \"minReplicas\": 1,\n \"maxReplicas\": 1,\n \"routes\": {\n \"onSpecComplete\": {\n \"path\": \"/_v/e2e_spec_callback/*spec\",\n \"public\": false,\n \"access\": \"authorized\",\n \"policies\": [\n {\n \"effect\": \"allow\",\n \"actions\": [\"post\"],\n \"principals\": [\"vrn:apps:*:*:*:app/vtex.tester-hub@*\"]\n }\n ]\n },\n \"onTestComplete\": {\n \"path\": \"/_v/e2e_complete_callback/:testId\",\n \"public\": false,\n \"access\": \"authorized\",\n \"policies\": [\n {\n \"effect\": \"allow\",\n \"actions\": [\"post\"],\n \"principals\": [\"vrn:apps:*:*:*:app/vtex.tester-hub@*\"]\n }\n ]\n }\n }\n}\n\n```" } ]
code_cypress-example_90131818
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of cypress-example/node/package.json from the cypress-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"dependencies\": {\n \"co-body\": \"^6.0.0\"\n },\n \"devDependencies\": {\n \"@vtex/api\": \"6.37.1\",\n \"@types/co-body\": \"0.0.3\",\n \"@types/node\": \"12.x\",\n \"typescript\": \"3.9.7\"\n },\n \"scripts\": {\n \"lint\": \"tsc --noEmit --pretty && tslint -c tslint.json --fix './**/*.ts'\"\n },\n \"version\": \"0.0.4\"\n}\n\n```" } ]
code_cypress-example_3cfb1656
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of cypress-example/node/index.ts from the cypress-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { Service } from '@vtex/api'\n\nimport { onSpecComplete, onTestComplete } from './middlewares/e2e'\n\nexport default new Service({\n routes: {\n onSpecComplete,\n onTestComplete,\n },\n})\n\n```" } ]
code_cypress-example_9faf10c8
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of cypress-example/cypress/plugins/index.js from the cypress-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```javascript\n/// <reference types=\"cypress\" />\n// ***********************************************************\n// This example plugins/index.js can be used to load plugins\n//\n// You can change the location of this file or turn off loading\n// the plugins file with the 'pluginsFile' configuration option.\n//\n// You can read more here:\n// https://on.cypress.io/plugins-guide\n// ***********************************************************\n\n// This function is called when a project is opened or re-opened (e.g. due to\n// the project's config changing)\n\n/**\n * @type {Cypress.PluginConfig}\n */\nmodule.exports = (on, config) => {\n\n}\n\n```" } ]
code_cypress-example_09543fee
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of cypress-example/cypress/integration/basic.spec.ts from the cypress-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndescribe('Basic test', () => {\n before(() => {\n cy.setVtexIdCookie()\n })\n\n it('adds custom bell to cart', () => {\n // navigate to home page\n cy.visit('/')\n\n // search for \"bell\"\n cy.get('#downshift-0-input')\n .type('bell{enter}')\n\n // wait until search results are loaded\n cy.get('#europe', { timeout: 10000 })\n\n // find Custom Bell product summary\n cy.get('section.vtex-product-summary-2-x-container')\n .contains('Custom Bell')\n .within(() => {\n // click Add to cart button\n cy.get('button')\n .contains('Add to cart')\n .click()\n })\n\n // assert that the product was added to the cart\n cy.get('.vtex-toast')\n .should('contain.text', \"Item added to your cart\")\n })\n})\n\n```" } ]
code_cypress-example_cecdfc6f
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of cypress-example/cypress/support/commands.ts from the cypress-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\n// ***********************************************\n// This example commands.js shows you how to\n// create various custom commands and overwrite\n// existing commands.\n//\n// For more comprehensive examples of custom\n// commands please read more here:\n// https://on.cypress.io/custom-commands\n// ***********************************************\n//\n//\n// -- This is a parent command --\n// Cypress.Commands.add(\"login\", (email, password) => { ... })\n//\n//\n// -- This is a child command --\n// Cypress.Commands.add(\"drag\", { prevSubject: 'element'}, (subject, options) => { ... })\n//\n//\n// -- This is a dual command --\n// Cypress.Commands.add(\"dismiss\", { prevSubject: 'optional'}, (subject, options) => { ... })\n//\n//\n// -- This will overwrite an existing command --\n// Cypress.Commands.overwrite(\"visit\", (originalFn, url, options) => { ... })\n\n```" } ]
code_cypress-example_b071f3f4
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of cypress-example/cypress/support/vtex.ts from the cypress-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nfunction setVtexIdCookie() {\n const cookieOptions = {\n domain: `.${new URL(Cypress.config().baseUrl as string).hostname}`,\n }\n return cy.setCookie('VtexIdclientAutCookie', Cypress.env(\"authToken\"), cookieOptions)\n}\n\nCypress.Commands.add(\"setVtexIdCookie\", setVtexIdCookie)\n\ndeclare namespace Cypress {\n interface Chainable<Subject> {\n setVtexIdCookie: typeof setVtexIdCookie\n }\n}\n\n```" } ]
code_cypress-example_19429b3d
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of cypress-example/cypress/support/index.ts from the cypress-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\n// ***********************************************************\n// This example support/index.js is processed and\n// loaded automatically before your test files.\n//\n// This is a great place to put global configuration and\n// behavior that modifies Cypress.\n//\n// You can change the location of this file or turn off\n// automatically serving support files with the\n// 'supportFile' configuration option.\n//\n// You can read more here:\n// https://on.cypress.io/configuration\n// ***********************************************************\n\n// Import commands.js using ES2015 syntax:\nimport './commands'\nimport './vtex'\n\n// Alternatively you can use CommonJS syntax:\n// require('./commands')\n\n```" } ]
code_cypress-example_03434dcd
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of cypress-example/cypress/monitoring/basic.spec.ts from the cypress-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndescribe('Basic test', () => {\n before(() => {\n cy.setVtexIdCookie()\n })\n\n it('adds custom bell to cart', () => {\n // navigate to home page\n cy.visit('/')\n\n // search for \"bell\"\n cy.get('#downshift-0-input')\n .type('bell{enter}')\n\n // wait until search results are loaded\n cy.get('#search-result-anchor', { timeout: 10000 })\n\n // find Custom Bell product summary\n cy.get('section.vtex-product-summary-2-x-container')\n .contains('Custom Bell')\n .within(() => {\n // click Add to cart button\n cy.get('button')\n .contains('Add to cart')\n .click()\n })\n\n // assert that the product was added to the cart\n cy.get('.vtex-toast')\n .should('contain.text', \"Item added to your cart\")\n })\n})\n\n```" } ]
code_cypress-example_c40e2103
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of cypress-example/node/typings/e2e.d.ts from the cypress-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare global {\n interface SpecReport {\n state: 'enqueued' | 'running' | 'passed' | 'failed' | 'skipped' | 'error'\n error?: string\n report?: {\n stats: {\n suites: number\n tests: number\n passes: number\n pending: number\n skipped: number\n failures: number\n }\n tests: Array<{\n title: string[]\n state: string\n body: string\n stack?: string\n error?: string\n }>\n }\n logId?: string\n specId?: string\n lastUpdate: number\n }\n\n interface AppReport {\n [spec: string]: SpecReport\n }\n}\n\nexport {}\n\n```" } ]
code_cypress-example_e9b8f52c
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of cypress-example/node/middlewares/e2e.ts from the cypress-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { ServiceContext } from '@vtex/api'\n\nimport parse = require('co-body')\n\nexport async function onSpecComplete(ctx: ServiceContext, next: () => Promise<any>) {\n const {\n vtex: {\n logger,\n route: {\n params: { spec },\n },\n },\n } = ctx\n\n console.log('EVIDENCE ID:', ctx.headers['x-vtex-evidence'])\n\n const specReport = await parse.json(ctx.req) as SpecReport\n\n const testsByState: { [state: string]: string[] } = {}\n if (specReport.report?.tests) {\n specReport.report.tests.forEach(t => {\n testsByState[t.state] = (testsByState[t.state] ?? []).concat(t.title.join(''))\n })\n }\n logger.info({\n spec,\n state: specReport.state,\n testsByState,\n })\n\n ctx.status = 200\n\n await next()\n}\n\nexport async function onTestComplete(ctx: ServiceContext, next: () => Promise<any>) {\n const {\n vtex: {\n logger,\n route: {\n params: { testId },\n },\n },\n } = ctx\n\n const app = await parse.json(ctx.req) as AppReport\n\n const specsByState: { [state: string]: string[] } = {}\n Object.entries(app).forEach(([spec, report]) => {\n specsByState[report.state] = (specsByState[report.state] ?? []).concat(spec)\n })\n\n logger.info({\n specsByState,\n testId,\n })\n\n ctx.status = 200\n\n await next()\n}\n\n\n```" } ]
code_iubenda-components_716e9976
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iubenda-components/messages/ar-SA.json from the iubenda-components VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"admin/editor.iubenda.advertisingTrackingPreferences\": \"رابط التتبع الإعلاني\",\n \"admin/editor.iubenda.advertisingTrackingPreferences.label\": \"النص\",\n \"store/iubenda.advertisingTrackingPreferences\": \"تحديث تفضيلات تتبع الإعلانات الخاصة بك\"\n}\n\n```" } ]
code_iubenda-components_96d7427d
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iubenda-components/messages/en.json from the iubenda-components VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"admin/editor.iubenda.advertisingTrackingPreferences\": \"Advertising tracking preferences link\",\n \"admin/editor.iubenda.advertisingTrackingPreferences.label\": \"Text\",\n \"store/iubenda.advertisingTrackingPreferences\": \"Update your advertising tracking preferences\"\n}\n\n```" } ]
code_iubenda-components_f9f67bfb
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iubenda-components/messages/context.json from the iubenda-components VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"admin/editor.iubenda.advertisingTrackingPreferences\": \"Advertising tracking preferences link\",\n \"admin/editor.iubenda.advertisingTrackingPreferences.label\": \"Text\",\n \"store/iubenda.advertisingTrackingPreferences\": \"Update your advertising tracking preferences\"\n}\n```" } ]
code_iubenda-components_e892ecd5
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iubenda-components/docs/README.md from the iubenda-components VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n📢 Use this project, [contribute](https://github.com/vtex-apps/iubenda-components) to it or open issues to help evolve it using [Store Discussion](https://github.com/vtex-apps/store-discussion).\n\n# Iubenda Components\n\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors-)\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n<!-- markdownlint-enable -->\n<!-- prettier-ignore-end -->\n\nThe Iubenda Components app allows your visitors to update their advertising tracking preferences even after closing the cookie banner. \n\n![image](https://user-images.githubusercontent.com/284515/80037044-46d6da00-84c9-11ea-9ad2-5f0a357e5fe5.png)\n\nRead more on [Iubenda Help](https://www.iubenda.com/en/help/7440-iab-framework-cmp#update-tcf-preferences).\n\n## Configuration\n\n1. Add the `iubenda-components` app to your theme's dependencies in the `manifest.json`:\n\n```json\n dependencies: {\n \"vtex.iubenda-components\": \"0.x\"\n }\n```\n\n2. Add the `advertising-tracking-preferences` block preferentially placed on the footer. For example:\n\n```diff\n \"footer\": {\n \"children\": [\n+ \"advertising-tracking-preferences\"\n ]\n },\n```\n\n## Customization\n\nIn order to apply CSS customizations in this and other blocks, follow the instructions given in the recipe on [Using CSS Handles for store customization](https://vtex.io/docs/recipes/style/using-css-handles-for-store-customization).\n\n| CSS Handles |\n| -------------------------------- |\n| `advertisingTrackingPreferences` |\n\n<!-- DOCS-IGNORE:start -->\n\n## Contributors ✨\n\nThanks goes to these wonderful people:\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<!-- markdownlint-enable -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind are welcome!\n\n<!-- DOCS-IGNORE:end -->\n\n```" } ]
code_iubenda-components_7cc206fa
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iubenda-components/react/AdvertisingTrackingPreferences.tsx from the iubenda-components VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport * as React from 'react'\nimport { defineMessages } from 'react-intl'\nimport { IOMessage } from 'vtex.native-types'\nimport { useCssHandles } from 'vtex.css-handles'\n\nconst HANDLES = ['advertisingTrackingPreferences']\n\nconst messages = defineMessages({\n label: {\n id: 'store/iubenda.advertisingTrackingPreferences',\n },\n title: {\n id: 'admin/editor.iubenda.advertisingTrackingPreferences',\n },\n})\n\nconst AdvertisingTrackingPreferences: SFC<Props> = ({\n label = messages.label.id,\n}) => {\n const handles = useCssHandles(HANDLES)\n\n const ref = React.useCallback(node => {\n if (node !== null) {\n try {\n window._iub.advertisingPreferencesButton.enableElement(node)\n } catch (e) {\n console.error(e)\n }\n }\n }, [])\n\n return (\n // eslint-disable-next-line jsx-a11y/anchor-is-valid\n <a\n ref={ref}\n href=\"#\"\n className={`${handles.advertisingTrackingPreferences} iubenda-advertising-preferences-link`}\n >\n <IOMessage id={label} />\n </a>\n )\n}\n\ninterface Props {\n label: string\n}\n\nAdvertisingTrackingPreferences.schema = {\n title: messages.title.id,\n}\n\nexport default AdvertisingTrackingPreferences\n\n```" } ]
code_iubenda-components_1543d357
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iubenda-components/react/package.json from the iubenda-components VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"name\": \"CHANGE_ME\",\n \"version\": \"0.1.0\",\n \"scripts\": {\n \"test\": \"vtex-test-tools test\"\n },\n \"dependencies\": {\n \"apollo-client\": \"^2.6.8\",\n \"react\": \"^16.12.0\",\n \"react-apollo\": \"^3.1.3\",\n \"react-dom\": \"^16.12.0\",\n \"react-intl\": \"^3.12.0\"\n },\n \"devDependencies\": {\n \"@apollo/react-testing\": \"^3.1.3\",\n \"@types/jest\": \"^25.1.4\",\n \"@types/node\": \"^13.9.8\",\n \"@types/react\": \"^16.9.31\",\n \"@vtex/test-tools\": \"^3.1.0\",\n \"@vtex/tsconfig\": \"^0.4.4\",\n \"apollo-cache-inmemory\": \"^1.6.5\",\n \"graphql\": \"^14.6.0\",\n \"prop-types\": \"^15.7.2\",\n \"typescript\": \"3.8.3\",\n \"vtex.css-handles\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.css-handles@0.4.2/public/@types/vtex.css-handles\",\n \"vtex.native-types\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.native-types@0.7.1/public/@types/vtex.native-types\",\n \"vtex.render-runtime\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.render-runtime@8.99.0/public/@types/vtex.render-runtime\"\n }\n}\n\n```" } ]
code_iubenda-components_bde92cab
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iubenda-components/store/contentSchemas.json from the iubenda-components VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"definitions\": {\n \"AdvertisingTrackingPreferences\": {\n \"properties\": {\n \"label\": {\n \"title\": \"admin/editor.iubenda.advertisingTrackingPreferences.label\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"default\": \"store/iubenda.advertisingTrackingPreferences\"\n }\n }\n }\n }\n}\n\n```" } ]
code_iubenda-components_e4727f49
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iubenda-components/store/interfaces.json from the iubenda-components VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"advertising-tracking-preferences\": {\n \"component\": \"AdvertisingTrackingPreferences\",\n \"content\": {\n \"$ref\": \"app:vtex.iubenda-components#/definitions/AdvertisingTrackingPreferences\"\n }\n }\n}\n\n```" } ]
code_iubenda-components_35adecf2
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iubenda-components/react/typings/site-editor.d.ts from the iubenda-components VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { FunctionComponent } from 'react'\n\ndeclare global {\n interface SFC<P = {}> extends FunctionComponent<P> {\n getSchema?(props: P): object\n schema?: object\n }\n}\n\n```" } ]
code_iubenda-components_18478a75
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iubenda-components/react/typings/global.d.ts from the iubenda-components VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ninterface Window extends Window {\n _iub: Iubenda\n}\n\ninterface Iubenda {\n advertisingPreferencesButton: {\n enableElement: (element: HTMLElement) => void\n }\n}\n\n```" } ]
code_iubenda-components_2bb59d26
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of iubenda-components/react/__tests__/index.test.tsx from the iubenda-components VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\ndescribe('Orders List Scenarios', () => {\n it('should work', () => {\n expect(1).toBe(1)\n })\n})\n\n```" } ]
code_KI-379869_23fe0474
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/docs/README.md from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# Orders canceled validator\n\nApp implementing an event handler receiving status updates from OMS Feed and master data V1. \nThis is the method for using [Feed v3 Hook](https://developers.vtex.com/reference/feed-v3) inside VTEX IO.\n\n\n## How to Use\n\n### Configurations \n1. You need to create a [new Data Entity](https://help.vtex.com/tutorial/creating-data-entity--tutorials_1265#how-to-set-up) with Acronym \"CO\" and name you prefer with fields orderId, retry ,status\n ```json\n {\n \"orderId\" : \"Varchar50\",\n \"retry\": \"integer\",\n \"status\": \"Varchar50\",\n }\n ``` \n2. Assign permissions Search and filter settings to true. (Is searchable? and Is filterable?) Without this configuration, execution errors will be generated \n3. [Create two trigger in Master Data v1 with Sending an HTTP request](https://help.vtex.com/en/tutorial/creating-trigger-in-master-data--tutorials_1270#sending-an-http-request) \n 1. Create a trigger with name **cancel_order_verify**\n 1. Trigger rule => **Um registro for alterado**\n 2. Schedule => Schedule on dynamic date with CURRENT DATE plus 4 Hour(s)\n 3. if positive => send an HTTP request with \n 1. URL : https://{{account}}.myvtex.com/_v/check/cancel_order\n 2. method: POST\n 3. content as JSON: \n 4. and select your Data Entity\n 5. save \n 2. Create a trigger with name **create_order_verify**\n 1. Trigger rule => **Um registro for inserido**\n 2. Schedule => Schedule on dynamic date with CURRENT DATE plus 10 minute(s)\n 3. if positive => send an HTTP request with \n 1. URL : https://{{account}}.myvtex.com/_v/check/cancel_order\n 2. method: POST\n 3. content as JSON: \n 4. and select your Data Entity\n 5. save \n\n This is a body configuration JSON on triggers content as JSON\n ```json\n {\n \"html_url\": \"{=UrlRegistro}\",\n \"orderId\": \"{!orderId}\",\n \"retry\": \"{!retry}\",\n \"status\": \"{!status}\",\n \"id\": \"{!id}\",\n \"accountId\": \"{!accountId}\",\n \"accountName\": \"{!accountName}\",\n \"dataEntityId\": \"{!dataEntityId}\",\n \"createdBy\": \"{!createdBy}\",\n \"createdIn\": \"{!createdIn}\",\n \"updatedBy\": \"{!updatedBy}\",\n \"updatedIn\": \"{!updatedIn}\",\n \"lastInteractionBy\": \"{!lastInteractionBy}\",\n \"lastInteractionIn\": \"{!lastInteractionIn}\",\n \"followers\": \"{!followers}\",\n \"tags\": \"{!tags}\",\n \"auto_filter\": \"{!auto_filter}\",\n }\n ```\n4. Install ki-379869 app on your account with ```vtex install vtex.ki-379869@0.x```\n5. Once it is working, follow-up orders will be stored in master data with the current status or if it has already been cancelled. Status in Data entity will be \"Cancel requested by vtex.ki-379869@x\" if a cancellation request was made\n \n\n## Order Feed v3 info\n\nThis app handles events sent by the app `vtex.orders-broadcast`, as you can see by looking at `node/service.json`.\n\n```json\n{\n \"memory\": 256,\n \"ttl\": 10,\n \"timeout\": 2,\n \"minReplicas\": 2,\n \"maxReplicas\": 4,\n \"workers\": 1,\n \"events\": {\n \"someStates\": {\n \"sender\": \"vtex.orders-broadcast\",\n \"topics\": [\"order-created\"]\n }\n }\n}\n```\n\nApp ki-379869 starts with consuming changes in status using Feed v3:\n\n1. Receive a selection of status changes where the `order-created`. \n\nNormally `vtex.orders-broadcast` sends events only in `master` workspace. If you want to use it in a developer workspace, do the following:\n\n1. Create your development workspace by running `vtex use {workspaceName}`\n2. Go to `https://{accountName}.myvtex.com/admin/apps/vtex.orders-broadcast/setup`\n3. Change the `Target Workspace` variable to the name of the workspace you have created previously.\n4. Now you can link this app (`vtex.ki-379869`) in your desired workspace and receive order status updates.\n\nHere is an example body that you can expect to receive:\n\n```json\n{\n \"recorder\": {\n \"_record\": {\n \"x-vtex-meta\": {},\n \"x-vtex-meta-bucket\": {}\n }\n },\n \"domain\": \"Marketplace\",\n \"orderId\": \"v69305315atmc-01\",\n \"currentState\": \"invoice\",\n \"lastState\": \"payment-approved\",\n \"currentChangeDate\": \"2020-07-13T20:25:13.2304508Z\",\n \"lastChangeDate\": \"2020-07-13T20:25:03.9527532Z\"\n}\n```\n\nIf you want to understand further how Feed v3 works, check out [this documentation](https://help.vtex.com/tutorial/orders-management-feed-v3-setup--5qDml3cQypWDRTgw69s4C1).\n\n```" } ]
code_KI-379869_686381a1
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/paymentProvider/configuration.json from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"name\": \"SequraConnector\",\n \"usesAutoSettleOptions\": true,\n \"paymentMethods\": [\n {\n \"name\": \"Sequra\",\n \"allowsSplit\": \"disabled\"\n }\n ]\n}\n\n```" } ]
code_KI-379869_51c0141e
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/cancelFlows.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { LogLevel } from '@vtex/api';\nimport { LogUtil } from './utils/loggerUtil';\nimport { LoggerConstants } from './utils/loggerConstants';\nimport { validateDaysPassed } from './utils/validations';\nimport { MAX_NUMBER_RETRY, MSG_CANCELED, MSG_NOT_CANCELED } from './typings/constants';\n\n\nexport async function cancelFlowOne(ctx: Context, order: OrderInfo) {\n const {\n state: { body },\n clients: { orders, transactions, masterData },\n } = ctx\n\n const doc: OrderType = {\n id: body.id,\n orderId: body.orderId,\n status: body.status,\n retry: Number(body.retry) + 1,\n }\n\n const transactionId = order.paymentData.transactions[0]?.transactionId\n const transactionResponse = await transactions.getTransaction(\n transactionId\n )\n\n if (transactionResponse.status.toLowerCase() === 'cancelled') {\n await orders.cancelOrder(order.orderId)\n masterData.updateDocument({ ...doc, status: MSG_CANCELED })\n } else if (body.retry < MAX_NUMBER_RETRY) {\n // Order in progress. We check again with retry + 1\n masterData.updateDocument({ ...doc, status: order.status })\n } else if (order.allowCancellation) {\n let message = ''\n const creationDate = new Date(order.creationDate)\n const now = new Date()\n\n if (validateDaysPassed(creationDate, now, 7)) {\n await orders.cancelOrder(order.orderId)\n message = MSG_CANCELED\n } else {\n message = MSG_NOT_CANCELED\n }\n\n masterData.updateDocument({\n ...doc,\n status: message,\n retry: doc.retry + 1,\n })\n }\n\n}\n\nexport async function cancelFlowTwo(ctx: Context) {\n const {\n state: { body },\n clients: { masterData },\n } = ctx\n\n const orderMD = await masterData.searchByOrderId(body.orderId)\n if (orderMD.length > 0) {\n await masterData.delete(orderMD[0].id)\n }\n\n\n const logInfo: any = {\n info: LoggerConstants.DOCUMENT_DELETE_MD,\n detail: {\n accountName: ctx.vtex.account,\n success: 200,\n body: body\n },\n };\n\n LogUtil.showLog(\n {\n message: `${logInfo.error}`,\n method: cancelFlowTwo.name,\n nameSpace: '',\n type: LogLevel.Info,\n code: 200,\n detail: logInfo.detail,\n },\n ctx.vtex\n );\n}\n\n```" } ]
code_KI-379869_80e4fbeb
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/service.json from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"memory\": 256,\n \"ttl\": 10,\n \"timeout\": 2,\n \"minReplicas\": 2,\n \"maxReplicas\": 4,\n \"workers\": 1,\n \"events\": {\n \"someStates\": {\n \"sender\": \"vtex.orders-broadcast\",\n \"topics\": [\"order-created\"]\n }\n },\n \"routes\": {\n \"checkCancelOrder\": {\n \"path\": \"/_v/check/cancel_order\",\n \"public\": true\n }\n }\n}\n\n```" } ]
code_KI-379869_3cab1bb5
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/package.json from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"dependencies\": {\n \"@vtex/clients\": \"^2.21.0\",\n \"co-body\": \"^6.0.0\",\n \"ramda\": \"^0.25.0\",\n \"@vtex/payment-provider\": \"^1.0.0\",\n \"node-fetch\": \"^2.0.0\"\n },\n \"devDependencies\": {\n \"@types/co-body\": \"^0.0.3\",\n \"@types/jest\": \"^24.0.18\",\n \"@types/node\": \"^12.0.0\",\n \"@types/ramda\": \"types/npm-ramda#dist\",\n \"@vtex/api\": \"6.45.15\",\n \"@vtex/test-tools\": \"^1.0.0\",\n \"tslint\": \"^5.14.0\",\n \"tslint-config-vtex\": \"^2.1.0\",\n \"typescript\": \"3.9.7\",\n \"@types/node-fetch\": \"^2.0.3\"\n },\n \"scripts\": {\n \"lint\": \"tsc --noEmit --pretty && tslint -c tslint.json --fix './**/*.ts'\"\n },\n \"version\": \"0.2.1\"\n}\n\n```" } ]
code_KI-379869_c11e720a
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/index.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport {\n ClientsConfig,\n LRUCache,\n method,\n Service,\n ServiceContext,\n RecorderState,\n EventContext,\n} from '@vtex/api'\n\nimport { Clients } from './clients'\nimport { someStates } from './middlewares/someStates'\nimport { validate } from './middlewares/validate'\nimport { checkStatus } from './middlewares/checkStatus'\n\nconst TIMEOUT_MS = 800\n\n// Create a LRU memory cache for the Status client.\n// The @vtex/api HttpClient respects Cache-Control headers and uses the provided cache.\nconst memoryCache = new LRUCache<string, any>({ max: 5000 })\nmetrics.trackCache('status', memoryCache)\n\n// This is the configuration for clients available in `ctx.clients`.\nconst clients: ClientsConfig<Clients> = {\n // We pass our custom implementation of the clients bag, containing the Status client.\n implementation: Clients,\n options: {\n // All IO Clients will be initialized with these options, unless otherwise specified.\n default: {\n retries: 2,\n timeout: TIMEOUT_MS,\n },\n // This key will be merged with the default options and add this cache to our Status client.\n status: {\n memoryCache,\n },\n },\n}\n\ndeclare global {\n type Context = ServiceContext<Clients, State>\n\n interface StatusChangeContext extends EventContext<Clients> {\n body: {\n id: string\n domain: string\n orderId: string\n currentState: string\n lastState: string\n currentChangeDate: string\n lastChangeDate: string\n }\n }\n // The shape of our State object found in `ctx.state`. This is used as state bag to communicate between middlewares.\n interface State extends RecorderState {\n code: number\n body: {\n html_url: string\n orderId: string\n status: string\n retry: number\n id: string\n accountId: string\n accountName: string\n dataEntityId: string\n createdBy: string\n createdIn: string\n updatedBy: string\n updatedIn: string\n lastInteractionBy: string\n lastInteractionIn: string\n followers: []\n tags: []\n auto_filter: string\n }\n }\n}\n\n// Export a service that defines route handlers and client options.\nexport default new Service({\n clients,\n events: {\n someStates,\n },\n routes: {\n checkCancelOrder: method({\n POST: [validate, checkStatus],\n }),\n },\n})\n\n```" } ]
code_KI-379869_e11e3886
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/clients/masterData.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport type { InstanceOptions, IOContext, IOResponse } from '@vtex/api'\nimport { JanusClient } from '@vtex/api'\n\nconst entityAcronym = 'CO'\nconst urlDoc = `/api/dataentities/${entityAcronym}/documents`\n\nexport class MasterData extends JanusClient {\n constructor(ctx: IOContext, options?: InstanceOptions) {\n super(ctx, {\n ...options,\n headers: {\n ...options?.headers,\n VtexIdclientAutCookie: ctx.adminUserAuthToken ?? ctx.authToken ?? '',\n 'Content-Type': 'application/json',\n 'X-Vtex-Use-Https': 'true',\n },\n })\n }\n\n public async searchByDocId(docId: string): Promise<[OrderType]> {\n const urlSearch = `/api/dataentities/${entityAcronym}/search`\n return this.http.get(`${urlSearch}?_where=id=${docId}&_fields=id,orderId,status,retry`);\n }\n\n public async searchByOrderId(orderId: string): Promise<[OrderType]> {\n const urlSearch = `/api/dataentities/${entityAcronym}/search`\n return this.http.get(`${urlSearch}?_where=orderId=${orderId}&_fields=id,orderId,status,retry`);\n }\n\n public async createNewDocument(body: OrderType): Promise<ResponseDocument> {\n return this.http.post(`${urlDoc}`, body);\n }\n\n public async updateDocument(body: OrderType): Promise<ResponseDocument> {\n return this.http.patch(`${urlDoc}`, body);\n }\n\n public async delete(docId: string): Promise<IOResponse<void>> {\n return this.http.delete(`${urlDoc}/${docId}`);\n }\n}\n\n```" } ]
code_KI-379869_1228f721
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/clients/orders.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport type { InstanceOptions, IOContext } from '@vtex/api'\nimport { JanusClient } from '@vtex/api'\n\nimport { MSG_CANCELED } from \"../typings/constants\";\n\nexport class Orders extends JanusClient {\n constructor(ctx: IOContext, options?: InstanceOptions) {\n super(ctx, {\n ...options,\n headers: {\n ...options?.headers,\n VtexIdclientAutCookie: ctx.authToken ?? ctx.adminUserAuthToken ?? '',\n 'Proxy-Authorization': ctx.authToken ?? ctx.adminUserAuthToken ?? '',\n 'Content-Type': 'application/json',\n 'X-Vtex-Use-Https': 'true',\n },\n })\n }\n\n public async getOrder(orderId: string): Promise<OrderInfo> {\n return this.http.get(`/api/oms/pvt/orders/${orderId}`)\n }\n\n public async cancelOrder(orderId: string): Promise<OrderCancelResponse> {\n return this.http.post(`/api/oms/pvt/orders/${orderId}/cancel`, { \"reason\": MSG_CANCELED }\n )\n }\n}\n\n```" } ]
code_KI-379869_03407ffb
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/clients/transactions.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { ExternalClient, InstanceOptions, IOContext } from '@vtex/api'\nimport {\n ApprovedAuthorization,\n CancellationResponse,\n} from '@vtex/payment-provider'\n\nexport default class Transactions extends ExternalClient {\n constructor(ctx: IOContext, options?: InstanceOptions) {\n super(`http://${ctx.account}.vtexpayments.com.br`, ctx, {\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n VtexIdclientAutCookie: ctx.authToken,\n 'Proxy-Authorization': ctx.authToken,\n 'X-Vtex-Use-Https': 'true',\n },\n })\n }\n\n public getTransaction = (transactionId: string): Promise<TransactionInfo> =>\n this.http.get(`/api/pvt/transactions/${transactionId}`)\n\n public sendAdditionalData = (\n transactionId: string,\n { name, value }: { name: string; value: string }\n ) =>\n this.http.post(`/api/pvt/transactions/${transactionId}/additional-data`, [\n {\n name,\n value,\n },\n ])\n\n public updatePaymentStatus = (\n transactionId: string,\n paymentId: string,\n transactionData: TransactionInfo\n ): Promise<ApprovedAuthorization | CancellationResponse> =>\n this.http.post(\n `/payment-provider/transactions/${transactionId}/payments/${paymentId}/retry`,\n transactionData\n )\n\n public cancelTransaction = (\n transactionId: string,\n value: number\n ): Promise<CancellationResponse> =>\n this.http.post(\n `/api/pvt/transactions/${transactionId}/cancellation-request`,\n {\n value,\n }\n )\n}\n\n```" } ]
code_KI-379869_4ed6deca
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/clients/index.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { MasterData } from './masterData';\nimport { Orders } from './orders';\nimport { IOClients } from \"@vtex/api\";\nimport Transactions from './transactions';\n\n// Extend the default IOClients implementation with our own custom clients.\nexport class Clients extends IOClients {\n\n public get orders() {\n return this.getOrSet('orders', Orders)\n }\n\n public get masterData() {\n return this.getOrSet('masterData', MasterData)\n }\n\n public get transactions() {\n return this.getOrSet('transactions', Transactions)\n }\n}\n\n```" } ]
code_KI-379869_23276d09
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/typings/orders.d.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ntype ClientProfileData = {\n userProfileId: string\n}\n\ntype OrderCancelResponse = {\n orderId: string\n receipt: string\n date: string\n}\n\ntype transactionOrder = {\n isActive: boolean\n transactionId: string\n merchantName: string\n payments: [\n {\n id: string\n paymentSystem: string\n paymentSystemName: string\n value: string\n installments: string\n referenceValue: string\n cardHolder: string\n cardNumber: string\n firstDigits: string\n lastDigits: string\n cvv2: string\n expireMonth: string\n expireYear: string\n url: string\n giftCardId: string\n giftCardName: string\n giftCardCaption: string\n redemptionCode: string\n group: creditCard\n tid: string\n dueDate: string\n connectorResponses: {\n Tid: string\n ReturnCode: string\n Message: string\n }\n giftCardProvider: string\n giftCardAsDiscount: string\n koinUrl: string\n accountId: string\n parentAccountId: string\n bankIssuedInvoiceIdentificationNumber: string\n bankIssuedInvoiceIdentificationNumberFormatted: string\n bankIssuedInvoiceBarCodeNumber: string\n bankIssuedInvoiceBarCodeType: string\n billingAddress: {\n postalCode: string\n city: string\n state: string\n country: string\n street: string\n number: string\n neighborhood: string\n complement: string\n reference: string\n geoCoordinates: []\n }\n }\n ]\n}\n\ntype OrderInfo = {\n orderId: string\n sequence: string\n marketplaceOrderId: string\n marketplaceServicesEndpoint: string\n sellerOrderId: string\n origin: Marketplace\n affiliateId: string\n salesChannel: number\n merchantName: string\n status: string\n statusDescription: string\n value: number\n creationDate: string\n lastChange: string\n orderGroup: string\n paymentData: {\n giftCards: []\n transactions: [transactionOrder]\n }\n callCenterOperatorData: string\n followUpEmail: string\n lastMessage: string\n invoiceData: string\n changesAttachment: string\n openTextField: string\n roundingError: number\n orderFormId: string\n isCompleted: boolean\n allowCancellation: boolean\n allowEdition: boolean\n isCheckedIn: boolean\n marketplace: string\n authorizedDate: string\n invoicedDate: string\n cancelReason: string\n cancellationData: {\n RequestedByUser: boolean\n RequestedBySystem: boolean\n RequestedBySellerNotification: boolean\n RequestedByPaymentNotification: boolean\n Reason: string\n CancellationDate: string\n }\n}\n\n```" } ]
code_KI-379869_9d340490
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/typings/masterData.d.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ntype OrderType = {\n id: string\n orderId: string\n status: string\n retry: number\n}\n\ntype ResponseDocument = {\n Id: string\n Href: string\n DocumentId: string\n}\n\n```" } ]
code_KI-379869_86f4d937
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/typings/constants.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport const MSG_CANCELED = 'Cancel requested by vtex.ki-379869@x - Orders validator'\nexport const MSG_NOT_CANCELED =\n 'Order not canceled on OMS: 7 days have not passed since creation date'\nexport const MAX_NUMBER_RETRY = 42\n\n```" } ]
code_KI-379869_a8a7ab69
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/typings/transactions.d.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ntype TransactionInfo = {\n id: string\n transactionId: string\n referenceKey: string\n interactions: {\n href: string\n }\n settlements: {\n href: string\n }\n payments: {\n href: string\n }\n refunds: {\n href: string\n }\n cancellations: {\n href: string\n }\n capabilities: {\n href: string\n }\n timeoutStatus: number\n totalRefunds: number\n status: string\n value: number\n receiverUri: string\n startDate: string\n authorizationToken: string\n authorizationDate: string\n commitmentToken: string\n commitmentDate: string\n refundingToken: string\n refundingDate: string\n cancelationToken: string\n cancelationDate: string\n fields: [\n {\n name: string\n value: string\n }\n ]\n shopperInteraction: string\n ipAddress: string\n sessionId: string\n macId: string\n vtexFingerprint: string\n chargeback: string\n whiteSignature: string\n owner: string\n orderId: string\n userAgent: string\n acceptHeader: string\n antifraudTid: string\n antifraudResponse: string\n antifraudReference: string\n antifraudAffiliationId: string\n channel: string\n salesChannel: string\n urn: string\n softDescriptor: string\n markedForRecurrence: boolean\n buyer: string\n}\n\n```" } ]
code_KI-379869_7574dbef
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/middlewares/checkStatus.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { LogLevel } from '@vtex/api';\nimport { LoggerConstants } from './../utils/loggerConstants';\nimport { LogUtil } from './../utils/loggerUtil';\nimport { cancelFlowOne, cancelFlowTwo } from \"../cancelFlows\"\n\nexport async function checkStatus(ctx: Context, next: () => Promise<any>) {\n const {\n state: { body },\n clients: { orders },\n } = ctx\n try {\n const order: OrderInfo = await orders.getOrder(body.orderId)\n\n if (order.status === 'payment-pending' || order.status === '') {\n cancelFlowOne(ctx, order)\n } else {\n if (!order.status.toLowerCase().includes(\"cancel\")\n || order.status.toLowerCase() === 'window-to-cancel') {\n cancelFlowTwo(ctx)\n }\n }\n\n ctx.request.response.status = 200\n } catch (error) {\n const statuscodeError: number =\n error.response !== undefined ? error.response.status : 400;\n\n const logException = {\n error: LoggerConstants.CHECK_STATUS_ERROR,\n detail: {\n accountName: ctx.vtex.account,\n error: error,\n body: body\n },\n };\n\n LogUtil.showLog(\n {\n message: `${logException.error}`,\n method: checkStatus.name,\n nameSpace: '',\n type: LogLevel.Error,\n code: statuscodeError,\n detail: logException.detail,\n },\n ctx.vtex\n );\n ctx.request.response.status = statuscodeError\n }\n\n await next()\n}\n\n```" } ]
code_KI-379869_98d67705
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/middlewares/validate.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { LogLevel } from '@vtex/api';\nimport { LogUtil } from './../utils/loggerUtil';\nimport { LoggerConstants } from './../utils/loggerConstants';\nimport { UserInputError } from '@vtex/api'\nimport { json } from 'co-body'\n\nexport async function validate(ctx: Context, next: () => Promise<any>) {\n const { req } = ctx\n const body = await json(req)\n\n if (!body.orderId) {\n const statuscodeError = 400;\n const logException: any = {\n error: LoggerConstants.ORDER_ID_REQUIRED,\n detail: {\n accountName: ctx.vtex.account,\n body: body\n },\n };\n\n LogUtil.showLog(\n {\n message: `${logException.error}`,\n method: validate.name,\n nameSpace: '',\n type: LogLevel.Info,\n code: statuscodeError,\n detail: logException.detail,\n },\n ctx.vtex\n );\n\n throw new UserInputError(LoggerConstants.ORDER_ID_REQUIRED) // Wrapper for a Bad Request (400) HTTP Error. Check others in https://github.com/vtex/node-vtex-api/blob/fd6139349de4e68825b1074f1959dd8d0c8f4d5b/src/errors/index.ts\n }\n\n ctx.state.body = body\n\n await next()\n}\n\n```" } ]
code_KI-379869_6fd92a6a
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/middlewares/someStates.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { LogLevel } from '@vtex/api';\nimport { LogUtil } from './../utils/loggerUtil';\nimport { LoggerConstants } from './../utils/loggerConstants';\nexport async function someStates(\n ctx: StatusChangeContext,\n next: () => Promise<any>\n) {\n const {\n clients: { masterData },\n } = ctx\n\n const { body } = ctx\n\n const logInfo: any = {\n info: LoggerConstants.EVENT_CALLED,\n detail: {\n accountName: ctx.vtex.account,\n success: 200,\n body: body\n },\n };\n\n LogUtil.showLog(\n {\n message: `${logInfo.error}`,\n method: someStates.name,\n nameSpace: '',\n type: LogLevel.Info,\n code: 200,\n detail: logInfo.detail,\n },\n ctx.vtex\n );\n\n\n try {\n const orderMD = await masterData.searchByOrderId(body.orderId)\n\n if (orderMD && orderMD.length < 1) {\n masterData.createNewDocument({\n id: body.id,\n orderId: body.orderId,\n status: body.currentState,\n retry: 1,\n })\n }\n\n } catch (error) {\n const statuscodeError: number =\n error.response !== undefined ? error.response.status : 400;\n\n const logException: any = {\n error: LoggerConstants.ERROR_FEED,\n detail: {\n accountName: ctx.vtex.account,\n error: error,\n body: body\n },\n };\n\n LogUtil.showLog(\n {\n message: `${logException.error}`,\n method: someStates.name,\n nameSpace: '',\n type: LogLevel.Error,\n code: statuscodeError,\n detail: logException.detail,\n },\n ctx.vtex\n );\n }\n await next()\n}\n\n```" } ]
code_KI-379869_98c3173a
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/utils/validations.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport const validateDaysPassed = (date1: any, date2: any, days: number) => {\n const dayInMs = 24 * 60 * 60 * 1000\n const difference = Math.abs(date2 - date1)\n const differenceOnDays = Math.floor(difference / dayInMs)\n\n return differenceOnDays >= days\n}\n\n```" } ]
code_KI-379869_9527ae28
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/utils/loggerConstants.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\n/**\n * Define the messages from success services on Sync Network\n */\nexport enum LoggerConstants {\n CHECK_STATUS_ERROR = \"Error on checkStatus\",\n ERROR_FEED = \"Error on feed someStates\",\n BAD_REQUEST = \"Error BAD REQUEST\",\n ORDER_ID_REQUIRED = \"Order ID is required\",\n DOCUMENT_DELETE_MD = \"Document on master data has been deleted. No need to continue tracking the order\",\n EVENT_CALLED = \"Event called\"\n}\n\n```" } ]
code_KI-379869_1cc13238
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/utils/loggerUtil.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { IOContext, LogLevel } from \"@vtex/api\";\n\nexport interface Log {\n code?: number;\n nameSpace: string;\n method: string;\n message: string;\n type: LogLevel;\n detail: any; \n}\n\nexport class LogUtil {\n static showLog(params: Log, context: IOContext) {\n const data = {\n message: `[${params.type}]:[${params.nameSpace}:${params.method}:${params.code}]:${params.message}`,\n detail: params.detail,\n };\n context.logger[params.type](data);\n }\n}\n\n```" } ]
code_KI-379869_e6d8c45a
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/mocks/order/mockOrders.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport const order1 = {\n orderId: '1312770505868-01',\n sequence: '12353426',\n marketplaceOrderId: '',\n marketplaceServicesEndpoint: null,\n sellerOrderId: '1313092353426-01',\n origin: 'Marketplace',\n affiliateId: '',\n salesChannel: '1',\n merchantName: null,\n status: '',\n statusDescription: null,\n value: 179990000,\n creationDate: '2023-02-24T13:24:19.8487043+00:00',\n lastChange: '2023-02-24T13:24:42.4745979+00:00',\n orderGroup: '1313092353426',\n totals: [\n {\n id: 'Items',\n name: 'Total de los items',\n value: 279990000,\n },\n {\n id: 'Discounts',\n name: 'Total de descuentos',\n value: -100000000,\n },\n {\n id: 'Shipping',\n name: 'Costo total del envío',\n value: 0,\n },\n {\n id: 'Tax',\n name: 'Costo total del cambio',\n value: 0,\n },\n ],\n items: [\n {\n uniqueId: 'E59DA5C3A7E848798A5F9625B8F06CA3',\n id: '3192771',\n productId: '3066690',\n ean: '8806094043259',\n lockId: null,\n itemAttachment: {\n content: {},\n name: null,\n },\n attachments: [],\n quantity: 1,\n seller: 'exitocol',\n name: 'Televisor SAMSUNG 50 Pulgadas LED Uhd4K Smart TV UN50BU8000',\n refId: '3192771',\n price: 279990000,\n listPrice: 279990000,\n manualPrice: null,\n priceTags: [\n {\n name:\n 'discount@price-table-tecnocmp-774223e7-3b7f-4e2b-a671-dc49a9b0e64d#69daf2ed-39ee-4b47-b5ab-fa2d671416ca',\n value: -100000000,\n isPercentual: false,\n identifier: '774223e7-3b7f-4e2b-a671-dc49a9b0e64d',\n rawValue: -1000000.0,\n rate: null,\n jurisCode: null,\n jurisType: null,\n jurisName: null,\n },\n ],\n imageUrl:\n 'https://exitocol.vteximg.com.br/arquivos/ids/16530705-90-90/TELEVISOR-SAMSUNG-50-Pulgadas-Uhd-4K-UN50BU8000KXZL-3192771_a.jpg?v=638115800804730000',\n detailUrl:\n '/televisor-samsung-50-pulgadas-uhd-4k-un50bu8000kxzl-3066690/p',\n components: [],\n bundleItems: [],\n params: [],\n offerings: [\n {\n type: 'Garantía extendida 12 meses PLU:1320413',\n id: '5765',\n name: 'Garantía extendida 12 meses PLU:1320413',\n price: 13990000,\n },\n ],\n attachmentOfferings: [],\n sellerSku: '3192771',\n priceValidUntil: null,\n commission: 0,\n tax: 0,\n preSaleDate: null,\n additionalInfo: {\n brandName: 'SAMSUNG',\n brandId: '8856',\n categoriesIds: '/34185084/34185121/341054568/',\n categories: [\n {\n id: 341054568,\n name: 'Televisores Samsung',\n },\n {\n id: 34185121,\n name: 'Televisores',\n },\n {\n id: 34185084,\n name: 'Tecnologia',\n },\n ],\n productClusterId:\n '205,208,210,276,302,391,685,741,1593,1851,1947,2863,3180,3642,3756,3904,3964,4655,7837,9121,10998,11524,12189,12379,13119,17702,17998,18178,18224,18377,19052,19509,20799,20938,21365',\n commercialConditionId: '3',\n dimension: {\n cubicweight: 1.0,\n height: 77.1,\n length: 28.88,\n weight: 15300.0,\n width: 124.6,\n },\n offeringInfo: null,\n offeringType: null,\n offeringTypeId: null,\n },\n measurementUnit: 'un',\n unitMultiplier: 1.0,\n sellingPrice: 179990000,\n isGift: false,\n shippingPrice: null,\n rewardValue: 0,\n freightCommission: 0,\n priceDefinition: {\n sellingPrices: [\n {\n value: 179990000,\n quantity: 1,\n },\n ],\n calculatedSellingPrice: 179990000,\n total: 179990000,\n },\n taxCode: 'Technology',\n parentItemIndex: null,\n parentAssemblyBinding: null,\n callCenterOperator: null,\n serialNumbers: null,\n assemblies: [],\n costPrice: null,\n },\n {\n uniqueId: 'BAA6A661268A4F35A1B3E2FA3BCEB70F',\n id: '1624452',\n productId: '26707',\n ean: '7709143481129',\n lockId: null,\n itemAttachment: {\n content: {},\n name: null,\n },\n attachments: [],\n quantity: 1,\n seller: 'exitocol',\n name: 'Soporte Fijo Tv 32 Pulgadas A 60 Pulgadas SF60 SOPORTV',\n refId: '1624452',\n price: 6990000,\n listPrice: 6990000,\n manualPrice: null,\n priceTags: [\n {\n name: 'DISCOUNT@GIFT',\n value: 100,\n isPercentual: true,\n identifier: 'b4430bf2-613b-44a8-84fe-f2f981cdc267',\n rawValue: 1.0,\n rate: null,\n jurisCode: null,\n jurisType: null,\n jurisName: null,\n },\n ],\n imageUrl:\n 'https://exitocol.vteximg.com.br/arquivos/ids/2777803-90-90/SOPORTE-FIJO-TV-32-A-60-1624452_a.jpg?v=637311968440100000',\n detailUrl: '/soporte-fijo-tv-32-a-60-26707/p',\n components: [],\n bundleItems: [],\n params: [],\n offerings: [],\n attachmentOfferings: [],\n sellerSku: '1624452',\n priceValidUntil: null,\n commission: 0,\n tax: 0,\n preSaleDate: null,\n additionalInfo: {\n brandName: 'SOPORTV',\n brandId: '29238',\n categoriesIds: '/34185084/34185451/34185423/',\n categories: [\n {\n id: 34185423,\n name: 'Soportes Para Tv',\n },\n {\n id: 34185451,\n name: 'Accesorios De Audio Y Video',\n },\n {\n id: 34185084,\n name: 'Tecnologia',\n },\n ],\n productClusterId:\n '205,208,210,276,318,391,741,1304,1593,2863,3756,8671,11317,13119,18377,20799',\n commercialConditionId: '3',\n dimension: {\n cubicweight: 1.0,\n height: 2.5,\n length: 46.0,\n weight: 1100.0,\n width: 10.5,\n },\n offeringInfo: null,\n offeringType: null,\n offeringTypeId: null,\n },\n measurementUnit: 'un',\n unitMultiplier: 1.0,\n sellingPrice: 0,\n isGift: true,\n shippingPrice: null,\n rewardValue: 0,\n freightCommission: 0,\n priceDefinition: {\n sellingPrices: [\n {\n value: 0,\n quantity: 1,\n },\n ],\n calculatedSellingPrice: 0,\n total: 0,\n },\n taxCode: 'Technology',\n parentItemIndex: null,\n parentAssemblyBinding: null,\n callCenterOperator: null,\n serialNumbers: null,\n assemblies: [],\n costPrice: null,\n },\n ],\n marketplaceItems: [],\n clientProfileData: {\n id: 'clientProfileData',\n email: 'da5c90ec598d488ba6d82f8fbb4c45be@ct.vtex.com.br',\n firstName: 'angie ',\n lastName: 'Flor prado',\n documentType: 'C.C',\n document: '1151952574',\n phone: '+573022451983',\n corporateName: null,\n tradeName: null,\n corporateDocument: null,\n stateInscription: '',\n corporatePhone: null,\n isCorporate: false,\n userProfileId: '52a56410-1004-4e0c-8f88-9d21aaa08a35',\n userProfileVersion: null,\n customerClass: null,\n },\n giftRegistryData: null,\n marketingData: {\n id: 'marketingData',\n utmSource: null,\n utmPartner: null,\n utmMedium: null,\n utmCampaign: null,\n coupon: null,\n utmiCampaign: null,\n utmipage: null,\n utmiPart: null,\n marketingTags: ['promo_samsung_tv_barra_24feb'],\n },\n ratesAndBenefitsData: {\n id: 'ratesAndBenefitsData',\n rateAndBenefitsIdentifiers: [\n {\n description: 'caro',\n featured: true,\n id: '774223e7-3b7f-4e2b-a671-dc49a9b0e64d',\n name: 'cmp_tabla_tecno',\n matchedParameters: {\n 'Seller@CatalogSystem': 'exitocol,1|inclusive',\n },\n additionalInfo: null,\n },\n {\n description:\n 'tecno_caro_\"213190\\n1050338\\n1050379\\n1060309\\n1060311\\n1060313\\n1060315\\n1060317\\n1060318\\n1126922\\n1126923\\n1172070\\n1172096\\n1206775\\n1219694\\n1227508\\n1254039\\n1254040\\n1278514\\n1278516\\n1283041\\n1309843\\n1309845\\n1309846\\n1323402\\n1323403\\n1324254\\n1324255\\n1341036\\n1495120\\n1495121\\n1497395\\n1497619\\n1497620\\n1497623\\n1497625\\n1497629\\n1581810\\n1581814\\n1686009\\n1712593\\n1725088\\n1725100\\n1725197\\n1725199\\n1726998\\n1734611\\n1734612\\n1769996\\n1770001\\n1770004\\n3038648\\n3041954\\n3041958\\n3041959\\n3041960\\n3041961\\n3041962\\n3055893\\n3055896\\n3057720\\n3057721\\n3086948\\n3091702\\n3111297\\n3112872\\n3192770\\n3192771\\n3192772\\n3206311\\n3206316\\n3219998\\n3230263\\n3231380\\n3252445\\n3230262\\n3206312\\n3283527\\n3297257\\n3206310',\n featured: false,\n id: 'b4430bf2-613b-44a8-84fe-f2f981cdc267',\n name: 'obsequioSoportetv1624452-311220232359',\n matchedParameters: {\n 'Seller@CatalogSystem': 'exitocol,1|inclusive',\n 'buyAndWin@Marketing': '3192771',\n },\n additionalInfo: null,\n },\n ],\n },\n shippingData: {\n id: 'shippingData',\n address: {\n addressType: 'pickup',\n receiverName: 'angie Flor prado',\n addressId: 'ptorecogida_402',\n versionId: null,\n entityId: null,\n postalCode: '76001',\n city: 'Cali',\n state: 'Valle del Cauca',\n country: 'COL',\n street: 'Avenida 6a Norte',\n number: '35-47',\n neighborhood: '',\n complement: '',\n reference: '',\n geoCoordinates: [-76.528395512, 3.478055395],\n },\n logisticsInfo: [\n {\n itemIndex: 0,\n selectedSla: 'CompraRecoge ptorecogida_402',\n lockTTL: '12d',\n price: 0,\n listPrice: 0,\n sellingPrice: 0,\n deliveryWindow: null,\n deliveryCompany: 'CompraRecoge ptorecogida_402',\n shippingEstimate: '1bd',\n shippingEstimateDate: null,\n slas: [\n {\n id: 'CompraRecoge ptorecogida_402',\n name: 'CompraRecoge ptorecogida_402',\n shippingEstimate: '1bd',\n deliveryWindow: null,\n price: 0,\n deliveryChannel: 'pickup-in-point',\n pickupStoreInfo: {\n additionalInfo: null,\n address: {\n addressType: 'pickup',\n receiverName: '',\n addressId: 'ptorecogida_402',\n versionId: null,\n entityId: null,\n postalCode: '76001',\n city: 'Cali',\n state: 'Valle del Cauca',\n country: 'COL',\n street: 'Avenida 6a Norte',\n number: '35-47',\n neighborhood: '',\n complement: '',\n reference: '',\n geoCoordinates: [-76.528395512, 3.478055395],\n },\n dockId: null,\n friendlyName: 'Éxito Chipichape',\n isPickupStore: true,\n },\n polygonName: null,\n lockTTL: '12d',\n pickupPointId: 'exitocol_402',\n transitTime: null,\n pickupDistance: 0.0,\n },\n {\n id: 'CompraRecoge ptorecogida_4058',\n name: 'CompraRecoge ptorecogida_4058',\n shippingEstimate: '10bd',\n deliveryWindow: null,\n price: 0,\n deliveryChannel: 'pickup-in-point',\n pickupStoreInfo: {\n additionalInfo: null,\n address: {\n addressType: 'pickup',\n receiverName: '',\n addressId: 'ptorecogida_4058',\n versionId: null,\n entityId: null,\n postalCode: '76001',\n city: 'Cali',\n state: 'Valle del Cauca',\n country: 'COL',\n street: 'Cra 98 B ',\n number: '# 25 - 2 ',\n neighborhood: '',\n complement: '',\n reference: '',\n geoCoordinates: [-76.5256547, 3.3688773],\n },\n dockId: null,\n friendlyName: 'ÉXITO WOW VALLE DE LILI (NUEVO)',\n isPickupStore: true,\n },\n polygonName: null,\n lockTTL: '12d',\n pickupPointId: 'exitocol_4058',\n transitTime: null,\n pickupDistance: 0.0,\n },\n {\n id: 'CompraRecoge ptorecogida_4049',\n name: 'CompraRecoge ptorecogida_4049',\n shippingEstimate: '10bd',\n deliveryWindow: null,\n price: 0,\n deliveryChannel: 'pickup-in-point',\n pickupStoreInfo: {\n additionalInfo: null,\n address: {\n addressType: 'pickup',\n receiverName: '',\n addressId: 'ptorecogida_4049',\n versionId: null,\n entityId: null,\n postalCode: '76364',\n city: 'Jamundí',\n state: 'Valle del Cauca',\n country: 'COL',\n street: 'Calle 2 ',\n number: '22-175',\n neighborhood: '',\n complement: '',\n reference: '',\n geoCoordinates: [-76.5584011, 3.258512],\n },\n dockId: null,\n friendlyName: 'Exito Jamundí',\n isPickupStore: true,\n },\n polygonName: null,\n lockTTL: '12d',\n pickupPointId: 'exitocol_4049',\n transitTime: null,\n pickupDistance: 0.0,\n },\n ],\n shipsTo: ['COL'],\n deliveryIds: [\n {\n courierId: 'CompraRecoge ptorecogida_402',\n courierName: 'CompraRecoge ptorecogida_402',\n dockId: 'pickup-in-store',\n quantity: 1,\n warehouseId: '402',\n accountCarrierName: null,\n kitItemDetails: [],\n },\n ],\n deliveryChannels: [\n {\n id: 'delivery',\n stockBalance: 0,\n },\n {\n id: 'pickup-in-point',\n stockBalance: 0,\n },\n ],\n deliveryChannel: 'pickup-in-point',\n pickupStoreInfo: {\n additionalInfo: null,\n address: {\n addressType: 'pickup',\n receiverName: '',\n addressId: 'ptorecogida_402',\n versionId: null,\n entityId: null,\n postalCode: '76001',\n city: 'Cali',\n state: 'Valle del Cauca',\n country: 'COL',\n street: 'Avenida 6a Norte',\n number: '35-47',\n neighborhood: '',\n complement: '',\n reference: '',\n geoCoordinates: [-76.528395512, 3.478055395],\n },\n dockId: null,\n friendlyName: 'Éxito Chipichape',\n isPickupStore: true,\n },\n addressId: 'ptorecogida_402',\n versionId: null,\n entityId: null,\n polygonName: null,\n pickupPointId: 'exitocol_402',\n transitTime: null,\n },\n {\n itemIndex: 1,\n selectedSla: 'CompraRecoge ptorecogida_402',\n lockTTL: '12d',\n price: 0,\n listPrice: 0,\n sellingPrice: 0,\n deliveryWindow: null,\n deliveryCompany: 'CompraRecoge ptorecogida_402',\n shippingEstimate: '1bd',\n shippingEstimateDate: null,\n slas: [\n {\n id: 'CompraRecoge ptorecogida_4049',\n name: 'CompraRecoge ptorecogida_4049',\n shippingEstimate: '1bd',\n deliveryWindow: null,\n price: 0,\n deliveryChannel: 'pickup-in-point',\n pickupStoreInfo: {\n additionalInfo: null,\n address: {\n addressType: 'pickup',\n receiverName: '',\n addressId: 'ptorecogida_4049',\n versionId: null,\n entityId: null,\n postalCode: '76364',\n city: 'Jamundí',\n state: 'Valle del Cauca',\n country: 'COL',\n street: 'Calle 2 ',\n number: '22-175',\n neighborhood: '',\n complement: '',\n reference: '',\n geoCoordinates: [-76.5584011, 3.258512],\n },\n dockId: null,\n friendlyName: 'Exito Jamundí',\n isPickupStore: true,\n },\n polygonName: null,\n lockTTL: '12d',\n pickupPointId: 'exitocol_4049',\n transitTime: null,\n pickupDistance: 0.0,\n },\n {\n id: 'CompraRecoge ptorecogida_402',\n name: 'CompraRecoge ptorecogida_402',\n shippingEstimate: '1bd',\n deliveryWindow: null,\n price: 0,\n deliveryChannel: 'pickup-in-point',\n pickupStoreInfo: {\n additionalInfo: null,\n address: {\n addressType: 'pickup',\n receiverName: '',\n addressId: 'ptorecogida_402',\n versionId: null,\n entityId: null,\n postalCode: '76001',\n city: 'Cali',\n state: 'Valle del Cauca',\n country: 'COL',\n street: 'Avenida 6a Norte',\n number: '35-47',\n neighborhood: '',\n complement: '',\n reference: '',\n geoCoordinates: [-76.528395512, 3.478055395],\n },\n dockId: null,\n friendlyName: 'Éxito Chipichape',\n isPickupStore: true,\n },\n polygonName: null,\n lockTTL: '12d',\n pickupPointId: 'exitocol_402',\n transitTime: null,\n pickupDistance: 0.0,\n },\n {\n id: 'CompraRecoge ptorecogida_4058',\n name: 'CompraRecoge ptorecogida_4058',\n shippingEstimate: '1bd',\n deliveryWindow: null,\n price: 0,\n deliveryChannel: 'pickup-in-point',\n pickupStoreInfo: {\n additionalInfo: null,\n address: {\n addressType: 'pickup',\n receiverName: '',\n addressId: 'ptorecogida_4058',\n versionId: null,\n entityId: null,\n postalCode: '76001',\n city: 'Cali',\n state: 'Valle del Cauca',\n country: 'COL',\n street: 'Cra 98 B ',\n number: '# 25 - 2 ',\n neighborhood: '',\n complement: '',\n reference: '',\n geoCoordinates: [-76.5256547, 3.3688773],\n },\n dockId: null,\n friendlyName: 'ÉXITO WOW VALLE DE LILI (NUEVO)',\n isPickupStore: true,\n },\n polygonName: null,\n lockTTL: '12d',\n pickupPointId: 'exitocol_4058',\n transitTime: null,\n pickupDistance: 0.0,\n },\n ],\n shipsTo: ['COL'],\n deliveryIds: [\n {\n courierId: 'CompraRecoge ptorecogida_402',\n courierName: 'CompraRecoge ptorecogida_402',\n dockId: 'pickup-in-store',\n quantity: 1,\n warehouseId: '402',\n accountCarrierName: null,\n kitItemDetails: [],\n },\n ],\n deliveryChannels: [\n {\n id: 'delivery',\n stockBalance: 0,\n },\n {\n id: 'pickup-in-point',\n stockBalance: 0,\n },\n ],\n deliveryChannel: 'pickup-in-point',\n pickupStoreInfo: {\n additionalInfo: null,\n address: {\n addressType: 'pickup',\n receiverName: '',\n addressId: 'ptorecogida_402',\n versionId: null,\n entityId: null,\n postalCode: '76001',\n city: 'Cali',\n state: 'Valle del Cauca',\n country: 'COL',\n street: 'Avenida 6a Norte',\n number: '35-47',\n neighborhood: '',\n complement: '',\n reference: '',\n geoCoordinates: [-76.528395512, 3.478055395],\n },\n dockId: null,\n friendlyName: 'Éxito Chipichape',\n isPickupStore: true,\n },\n addressId: 'ptorecogida_402',\n versionId: null,\n entityId: null,\n polygonName: null,\n pickupPointId: 'exitocol_402',\n transitTime: null,\n },\n ],\n trackingHints: null,\n selectedAddresses: [\n {\n addressId: 'ptorecogida_402',\n versionId: null,\n entityId: null,\n addressType: 'pickup',\n receiverName: 'angie Flor prado',\n street: 'Avenida 6a Norte',\n number: '35-47',\n complement: '',\n neighborhood: '',\n postalCode: '76001',\n city: 'Cali',\n state: 'Valle del Cauca',\n country: 'COL',\n reference: '',\n geoCoordinates: [-76.528395512, 3.478055395],\n },\n ],\n },\n paymentData: {\n giftCards: [],\n transactions: [\n {\n isActive: true,\n transactionId: 'F0C2879E7C7B45F38980739D8F28BA86',\n merchantName: 'EXITOCOL',\n payments: [\n {\n id: 'FAD90EE2936544F7990C0A0486D9DEDC',\n paymentSystem: '4',\n paymentSystemName: 'Mastercard',\n value: 179990000,\n installments: 18,\n referenceValue: 179990000,\n cardHolder: null,\n cardNumber: null,\n firstDigits: '547141',\n lastDigits: '5634',\n cvv2: null,\n expireMonth: null,\n expireYear: null,\n url: null,\n giftCardId: null,\n giftCardName: null,\n giftCardCaption: null,\n redemptionCode: null,\n group: 'creditCard',\n tid: null,\n dueDate: null,\n connectorResponses: {\n Tid: null,\n ReturnCode: null,\n Message: '3DS_NO_OK_PMTZ- Authentication Failed',\n },\n giftCardProvider: null,\n giftCardAsDiscount: null,\n koinUrl: null,\n accountId: 'CDC71D5127B543A78378151B89E9A62A',\n parentAccountId: null,\n bankIssuedInvoiceIdentificationNumber: null,\n bankIssuedInvoiceIdentificationNumberFormatted: null,\n bankIssuedInvoiceBarCodeNumber: null,\n bankIssuedInvoiceBarCodeType: null,\n billingAddress: {\n postalCode: null,\n city: 'Cali',\n state: 'Valle Del Cauca',\n country: 'COL',\n street: 'Calle 59 a # 2 -143',\n number: null,\n neighborhood: 'los andes',\n complement: '1er piso',\n reference: null,\n geoCoordinates: [],\n },\n },\n ],\n },\n ],\n },\n packageAttachment: {\n packages: [],\n },\n sellers: [\n {\n id: 'exitocol',\n name: 'Exito',\n logo: '',\n fulfillmentEndpoint: 'https://exitocol.myvtex.com/',\n },\n ],\n callCenterOperatorData: null,\n followUpEmail: 'da5c90ec598d488ba6d82f8fbb4c45be@ct.vtex.com.br',\n lastMessage: null,\n hostname: 'exitocol',\n invoiceData: null,\n changesAttachment: null,\n openTextField: null,\n roundingError: 0,\n orderFormId: 'af3c8a62ea8f415397c4be3023dc15f0',\n commercialConditionData: null,\n isCompleted: false,\n customData: {\n customApps: [\n {\n fields: {\n channelId: '11',\n money: '4853.9',\n salesChannel: '1',\n companyData: 'true',\n customerCreditEmail: '-',\n customerCreditDocumentType: '-',\n customerCreditDocument: '-',\n },\n id: 'order',\n major: 1,\n },\n ],\n },\n storePreferencesData: {\n countryCode: 'COL',\n currencyCode: 'COP',\n currencyFormatInfo: {\n CurrencyDecimalDigits: 0,\n CurrencyDecimalSeparator: ',',\n CurrencyGroupSeparator: '.',\n CurrencyGroupSize: 3,\n StartsWithCurrencySymbol: true,\n },\n currencyLocale: 9226,\n currencySymbol: '$',\n timeZone: 'SA Pacific Standard Time',\n },\n allowCancellation: false,\n allowEdition: false,\n isCheckedIn: false,\n marketplace: null,\n authorizedDate: null,\n invoicedDate: null,\n cancelReason: null,\n itemMetadata: {\n Items: [\n {\n Id: '3192771',\n Seller: 'exitocol',\n Name: 'Televisor SAMSUNG 50 Pulgadas LED Uhd4K Smart TV UN50BU8000',\n SkuName: 'Televisor SAMSUNG 50 Pulgadas LED Uhd4K Smart TV UN50BU8000',\n ProductId: '3066690',\n RefId: '3192771',\n Ean: '8806094043259',\n ImageUrl:\n 'http://exitocol.vteximg.com.br/arquivos/ids/16530705-90-90/TELEVISOR-SAMSUNG-50-Pulgadas-Uhd-4K-UN50BU8000KXZL-3192771_a.jpg?v=638115800804730000',\n DetailUrl:\n '/televisor-samsung-50-pulgadas-uhd-4k-un50bu8000kxzl-3066690/p',\n AssemblyOptions: [],\n },\n {\n Id: '1624452',\n Seller: 'exitocol',\n Name: 'Soporte Fijo Tv 32 Pulgadas A 60 Pulgadas SF60 SOPORTV',\n SkuName: 'Soporte Fijo Tv 32 Pulgadas A 60 Pulgadas SF60 SOPORTV',\n ProductId: '26707',\n RefId: '1624452',\n Ean: '7709143481129',\n ImageUrl:\n 'http://exitocol.vteximg.com.br/arquivos/ids/2777803-90-90/SOPORTE-FIJO-TV-32-A-60-1624452_a.jpg?v=637311968440100000',\n DetailUrl: '/soporte-fijo-tv-32-a-60-26707/p',\n AssemblyOptions: [],\n },\n ],\n },\n subscriptionData: null,\n taxData: null,\n checkedInPickupPointId: null,\n cancellationData: {\n RequestedByUser: false,\n RequestedBySystem: null,\n RequestedBySellerNotification: null,\n RequestedByPaymentNotification: true,\n Reason: null,\n CancellationDate: '2023-02-24T13:24:40.6417717+00:00',\n },\n clientPreferencesData: {\n locale: 'es',\n optinNewsLetter: false,\n },\n}\n\n```" } ]
code_KI-379869_c93a383c
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/mocks/transaction/mockTransactions.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport const transaction = {\n id: '330403E62CA24F979ECA19C2F0139C53',\n transactionId: '330403E62CA24F979ECA19C2F0139C53',\n referenceKey: '32019664',\n interactions: {\n href: '/api/pvt/transactions/330403E62CA24F979ECA19C2F0139C53/interactions',\n },\n settlements: {\n href: '/api/pvt/transactions/330403E62CA24F979ECA19C2F0139C53/settlements',\n },\n payments: {\n href: '/api/pvt/transactions/330403E62CA24F979ECA19C2F0139C53/payments',\n },\n refunds: {\n href: '/api/pvt/transactions/330403E62CA24F979ECA19C2F0139C53/refunds',\n },\n cancellations: {\n href:\n '/api/pvt/transactions/330403E62CA24F979ECA19C2F0139C53/cancellations',\n },\n capabilities: {\n href: '/api/pvt/transactions/330403E62CA24F979ECA19C2F0139C53/capabilities',\n },\n timeoutStatus: 1,\n totalRefunds: 0.0,\n status: 'Cancelled',\n value: 1699900,\n receiverUri: null,\n startDate: '2021-04-08T06:20:52',\n authorizationToken: null,\n authorizationDate: null,\n commitmentToken: null,\n commitmentDate: null,\n refundingToken: null,\n refundingDate: null,\n cancelationToken: 'B79D26151F7B4506B9118D8B90B801BA',\n cancelationDate: '2021-04-08T08:30:42',\n fields: [\n {\n name: 'owner',\n value: 'vtexappkey-appvtex',\n },\n {\n name: 'conditions',\n value: '[{\"id\":\"2\",\"value\":17499.0}]',\n },\n {\n name: 'postbackStatusUrl',\n value:\n 'https://oms.vtexcommercestable.com.br/api/oms/pvt/orders/order-group/v32019664ekt/notifications/transaction-status?an=elektra',\n },\n {\n name: 'shopperInteraction',\n value: 'ecommerce',\n },\n {\n name: 'channel',\n value: 'ELEKTRA',\n },\n {\n name: 'salesChannel',\n value: '1',\n },\n {\n name: 'parentMerchant',\n value: 'b765f158-0145-4f52-9720-82fc7a6fa437',\n },\n {\n name: 'orderId',\n value: 'v32019664ekt',\n },\n {\n name: 'ip',\n value: '189.220.10.39',\n },\n {\n name: 'sessionId',\n value: '0%3A1524e110-9831-11eb-a934-27b8530cda4e',\n },\n {\n name: 'macId',\n value: '91219ce0-8945-11eb-888e-df979658da8f',\n },\n {\n name: 'vtexFingerprint',\n value: '895a49cc3a9a478894b01b4502e966ce',\n },\n {\n name: 'userAgent',\n value:\n 'Mozilla/5.0 (Linux; Android 10; moto g(7) play Build/QPYS30.85-23-8-2; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.105 Mobile Safari/537.36',\n },\n {\n name: 'acceptHeader',\n value:\n 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',\n },\n {\n name: 'cart',\n value:\n '{\"items\":[{\"id\":\"34004262\",\"name\":\"Motoneta Italika D125 Roja\",\"value\":1749900,\"quantity\":1,\"priceTags\":[{\"name\":\"discount@price-table-credito-elektra-6889ceff-4f60-4743-8980-e1e7e05b0297#aace7367-9d23-4cf1-b3fd-ec3c0c6334df\",\"value\":-500.00000,\"isPercentual\":false}],\"components\":null,\"commission\":0.0,\"freightCommission\":0.0,\"sellerChain\":null,\"shippingDiscount\":0,\"discount\":-50000,\"refId\":\"34004262\",\"productId\":\"34004262\",\"sellingPrice\":16999.0,\"sellerId\":\"1\",\"dockId\":\"3953\",\"categoryId\":\"1371863\",\"categoryName\":\"Motoneta\",\"deliveryChannel\":\"delivery\",\"deliveryType\":\"Envío domicilio\",\"deliverySlaInMinutes\":17280,\"deliveryWindow\":null,\"tax\":0,\"freight\":0}],\"sellers\":[{\"id\":\"1\",\"name\":\"Elektra\",\"documentType\":\"CNPJ\",\"document\":\"99999999999999\"}],\"freight\":0,\"shippingdate\":null,\"shippingestimated\":\"12bd\",\"orderUrl\":\"http://elektra.vtexcommercestable.com.br/admin/checkout/#/orders?q=v32019664ekt\",\"tax\":0,\"isGiftRegistry\":null,\"giftRegistryDescription\":null,\"giftRegistryId\":null,\"isPickupStore\":null,\"isCallCenter\":null}',\n },\n {\n name: 'clientProfileData',\n value:\n '{\"email\":\"soledaddelaluz05202@gmail.com\",\"firstName\":\"María soledad\",\"lastName\":\"De la luz García\",\"document\":null,\"phone\":\"7461177039\",\"corporateName\":null,\"tradeName\":null,\"corporateDocument\":null,\"stateInscription\":null,\"postalCode\":\"92900\",\"address\":{\"receiverName\":\"María soledad \",\"postalCode\":\"92900\",\"city\":\"Tihuatlán\",\"state\":\"Veracruz de Ignacio de la Llave\",\"country\":\"MEX\",\"street\":\"Lázaro cárdenas\",\"number\":\"302\",\"neighborhood\":\"El Águila\",\"complement\":\"\",\"reference\":\"Alado del depósito karlita\"},\"gender\":null,\"birthDate\":null,\"createdDate\":null,\"corporatePhone\":null,\"isCorporate\":false,\"documentType\":null,\"id\":\"04aa53cb-308f-4383-ad7c-89880b7c8d1e\"}',\n },\n {\n name: 'shippingData',\n value:\n '{\"receiverName\":\"María soledad \",\"postalCode\":\"92900\",\"city\":\"Tihuatlán\",\"state\":\"Veracruz de Ignacio de la Llave\",\"country\":\"MEX\",\"street\":\"Lázaro cárdenas\",\"number\":\"302\",\"neighborhood\":\"El Águila\",\"complement\":\"\",\"reference\":\"Alado del depósito karlita\"}',\n },\n ],\n shopperInteraction: 'ecommerce',\n ipAddress: '189.220.10.39',\n sessionId: '0%3A1524e110-9831-11eb-a934-27b8530cda4e',\n macId: '91219ce0-8945-11eb-888e-df979658da8f',\n vtexFingerprint: '895a49cc3a9a478894b01b4502e966ce',\n chargeback: null,\n whiteSignature: null,\n owner: 'vtexappkey-appvtex',\n orderId: 'v32019664ekt',\n userAgent: 'v32019664ekt',\n acceptHeader:\n 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',\n antifraudTid: null,\n antifraudResponse: null,\n antifraudReference: null,\n antifraudAffiliationId: null,\n channel: 'ELEKTRA',\n salesChannel: '1',\n urn: null,\n softDescriptor: null,\n markedForRecurrence: false,\n buyer: null,\n}\n\n```" } ]
code_KI-379869_e7009537
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of KI-379869/node/mocks/masterData/newDocument.ts from the KI-379869 VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport const orderBody1 = {\n orderId: 'pruebatrigger',\n status: 'cancel',\n}\n\n```" } ]
code_is-api-middleware-graphql_aabe3aea
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of is-api-middleware-graphql/docs/README.md from the is-api-middleware-graphql VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# VTEX Intelligent Search API Middleware Graphql\n\n⚠️ This repository is deprecated ⚠️\n\n`vtex.is-api-middleware-graphql` is the Graphql schema for the Intelligent Search Middleware feature.\n\nCheck the full documentation to learn how to create a middleware for your account.\n\n<!-- TODO: add link to the documentation -->\n\n```" } ]
code_is-api-middleware-graphql_37efff13
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of is-api-middleware-graphql/graphql/schema.graphql from the is-api-middleware-graphql VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```graphql\ntype Query {\n before(\n \"\"\"\n Search term. It can contain any character\n \"\"\"\n query: String\n \"\"\"\n Page number\n \"\"\"\n page: Int\n \"\"\"\n Number of items per page\n \"\"\"\n count: Int\n \"\"\"\n Sort the result by a criteria\n \"\"\"\n sort: String\n \"\"\"\n Indicates how the search-engine will deal with the fullText if there is more than one word. Set `and` if the returned products must have all the words in its metadata or `or` otherwise.\n \"\"\"\n operator: Operator\n \"\"\"\n Indicates how the search engine will correct misspelled words by using fuzzy logic.\n It can be a number representing the max number of misspelled letters, or the string `auto` suggesting that the search-engine should set this value by itself.\n \"\"\"\n fuzzy: String\n \"\"\"\n As fuzzy and operator, it controls the search state, but it is for general purposes. This field allows the search engines to apply features that are not handled by the other fields.\n The possible values in this field are defined by each search engine.\n \"\"\"\n searchState: String\n \"\"\"\n If the search has a redirect enabled, this allows (`true`) or not (`false`) the redirect to be used.\n \"\"\"\n allowRedirect: Boolean\n \"\"\"\n Indicates the user region. Useful for regionalized accounts.\n \"\"\"\n regionId: String\n \"\"\"\n If you want faster searches and do not care about most up to date prices and promotions, use skip value.\n \"\"\"\n simulationBehavior: SimulationBehavior\n \"\"\"\n If true, uses isAvailablePerSalesChannel_ parameter on query with segment's sales channel. Will override any given salesChannel arg\n \"\"\"\n hideUnavailableItems: Boolean\n \"\"\"\n List of the selected facets\n\n The order in which the terms appear is not relevant to the search.\n\n You can also repeat the same `facetKey` several times for different values.\n \"\"\"\n selectedFacets: [SelectedFacetInput]\n \"\"\"\n Rules for pormoting, demoting, adding or removing products\n \"\"\"\n dynamicRules: [DynamicRuleInput]\n ): SearchParams @cacheControl(scope: PUBLIC, maxAge: SHORT)\n}\n\n```" } ]
code_is-api-middleware-graphql_3df824c3
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of is-api-middleware-graphql/node/package.json from the is-api-middleware-graphql VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"name\": \"search-graphql\",\n \"description\": \"Don't delete this file, it's necessary to generate the TypeScript types of the GraphQL\"\n}\n\n```" } ]
code_is-api-middleware-graphql_02903d8c
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of is-api-middleware-graphql/graphql/types/DynamicRule.graphql from the is-api-middleware-graphql VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```graphql\nenum BoostAction {\n add\n remove\n promote\n demote\n}\n\nenum BoostType {\n term\n id\n skuId\n skuEan\n skuReference\n productLink\n product\n sku\n productId\n attribute\n}\n\ntype DynamicRule {\n \"\"\"\n Rule action that will be applied to the products\n \"\"\"\n action: BoostAction\n \"\"\"\n Type of identifier\n \"\"\"\n type: BoostType\n \"\"\"\n Value related to the identifier\n \"\"\"\n value: String\n}\n\ninput DynamicRuleInput {\n \"\"\"\n Rule action that will be applied to the products\n \"\"\"\n action: BoostAction\n \"\"\"\n Type of identifier\n \"\"\"\n type: BoostType\n \"\"\"\n Value related to the identifier\n \"\"\"\n value: String\n}\n\n```" } ]
code_is-api-middleware-graphql_9d35c1b0
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of is-api-middleware-graphql/graphql/types/Operator.graphql from the is-api-middleware-graphql VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```graphql\n\"\"\"\nIndicates how the search-engine will deal with the fullText if there is more than one word. Set `and` if the returned products must have all the words in its metadata or `or` otherwise.\n\"\"\"\nenum Operator {\n and\n or\n}\n\n```" } ]
code_is-api-middleware-graphql_30512807
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of is-api-middleware-graphql/graphql/types/SelectedFacets.graphql from the is-api-middleware-graphql VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```graphql\n\"\"\"\nObject that represents a selected facet. For example: {key: color, value: blue}\n\"\"\"\ntype SelectedFacet {\n \"\"\"\n Facet key\n \"\"\"\n key: String\n \"\"\"\n Facet value\n \"\"\"\n value: String\n}\n\n\"\"\"\nObject that represents a selected facet. For example: {key: color, value: blue}\n\"\"\"\ninput SelectedFacetInput {\n \"\"\"\n Facet key\n \"\"\"\n key: String\n \"\"\"\n Facet value\n \"\"\"\n value: String\n}\n\n```" } ]
code_is-api-middleware-graphql_acc09a81
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of is-api-middleware-graphql/graphql/types/SearchParams.graphql from the is-api-middleware-graphql VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```graphql\ntype SearchParams {\n \"\"\"\n Search term. It can contain any character\n \"\"\"\n query: String\n \"\"\"\n List of the selected facets\n\n The order in which the terms appear is not relevant to the search.\n\n You can also repeat the same `facetKey` several times for different values.\n \"\"\"\n selectedFacets: [SelectedFacet]\n \"\"\"\n Sort the result by a criteria\n \"\"\"\n sort: String\n \"\"\"\n Page number\n \"\"\"\n page: Int\n \"\"\"\n Number of items per page\n \"\"\"\n count: Int\n \"\"\"\n If true, uses isAvailablePerSalesChannel_ parameter on query with segment's sales channel. Will override any given salesChannel arg\n \"\"\"\n hideUnavailableItems: Boolean\n \"\"\"\n Indicates how the search-engine will deal with the fullText if there is more than one word. Set `and` if the returned products must have all the words in its metadata or `or` otherwise.\n \"\"\"\n operator: Operator\n \"\"\"\n Indicates how the search engine will correct misspelled words by using fuzzy logic.\n It can be a number representing the max number of misspelled letters, or the string `auto` suggesting that the search-engine should set this value by itself.\n \"\"\"\n fuzzy: String\n \"\"\"\n As fuzzy and operator, it controls the search state, but it is for general purposes. This field allows the search engines to apply features that are not handled by the other fields.\n The possible values in this field are defined by each search engine.\n \"\"\"\n searchState: String\n \"\"\"\n If the search has a redirect enabled, this allows (`true`) or not (`false`) the redirect to be used.\n \"\"\"\n allowRedirect: String\n \"\"\"\n Rules for pormoting, demoting, adding or removing products\n \"\"\"\n dynamicRules: [DynamicRule]\n \"\"\"\n Indicates the user region. Useful for regionalized accounts.\n \"\"\"\n regionId: String\n \"\"\"\n If you want faster searches and do not care about most up to date prices and promotions, use skip value.\n \"\"\"\n simulationBehavior: SimulationBehavior\n}\n\n```" } ]
code_is-api-middleware-graphql_7c2d970c
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of is-api-middleware-graphql/graphql/types/SimulationBehavior.graphql from the is-api-middleware-graphql VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```graphql\n\"\"\"\nIf you want faster searches and do not care about most up to date prices and promotions, use skip value.\n\"\"\"\nenum SimulationBehavior {\n \"\"\"\n Ignore simulation calls\n \"\"\"\n skip\n \"\"\"\n Calls the simulation only for first party sellers\n \"\"\"\n only1P\n \"\"\"\n Calls the simulation for every single seller\n \"\"\"\n default\n}\n\n```" } ]
code_search-engine-example_e86d00cf
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of search-engine-example/docs/README.md from the search-engine-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# VTEX Search Resolver Template\n\nThis app is an example implementation of the [VTEX Search Protocol](https://github.com/vtex-apps/search-graphql) that wraps API calls related to search on Store Framework. It's inspired by the [`vtex.search-resolver@1.x`](https://github.com/vtex-apps/search-resolver/tree/v1.x) code, which relies on Biggy's external API. **Notice that we've left some of the custom algorithms** creates to integrate with Biggy, since it'll probably be useful when integrating with any other engine.\n\n## Creating a custom integration\n\n- To integrate an external search engine into VTEX, clone this repository and change the resolvers' code on `node`.\n- To test, run `vtex link` in a workspace. Make sure that **there's no other app implementing Search Protocol installed!**.\n\n## Keep in mind\n- Entries and files with `customSearchEngine` **should be modified and renamed** accordingly to the search engine to be integrated.\n- The main file to look at is `node/resolvers/search/index.ts`, where is implemented resolvers for search-related queries. It's important to notice that some resolvers **will not be modified** since they're connecting directly to VTEX APIs. This will be addressed on future releases of VTEX Search Protocol, but shouldn't introduce breaking changes.\n- It's important to **adapt the Typescript types** into the code, since they're probably specific to Biggy.\n```" } ]
code_search-engine-example_4e3a6478
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of search-engine-example/node/service.json from the search-engine-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"stack\": \"nodejs\",\n \"memory\": 1536,\n \"ttl\": 30,\n \"timeout\": 12,\n \"minReplicas\": 2,\n \"maxReplicas\": 100\n}\n\n```" } ]
code_search-engine-example_1205db10
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of search-engine-example/node/package.json from the search-engine-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"name\": \"vtex.search-engine-example\",\n \"scripts\": {\n \"lint\": \"tsc --noEmit && eslint --ext ts .\",\n \"test\": \"jest\"\n },\n \"jest\": {\n \"transform\": {\n \"^.+\\\\.tsx?$\": \"ts-jest\"\n },\n \"testMatch\": [\n \"**/__tests__/**/*.(js|ts)?(x)\",\n \"**/?(*.)+(spec|test).(js|ts)?(x)\"\n ],\n \"moduleFileExtensions\": [\n \"ts\",\n \"tsx\",\n \"js\"\n ]\n },\n \"dependencies\": {\n \"@gocommerce/utils\": \"^0.6.11\",\n \"atob\": \"^2.1.2\",\n \"axios\": \"^0.19.0\",\n \"camelcase\": \"^5.0.0\",\n \"cookie\": \"^0.3.1\",\n \"graphql\": \"^14.5.8\",\n \"graphql-tools\": \"^4.0.6\",\n \"qs\": \"^6.6.0\",\n \"querystring\": \"^0.2.0\",\n \"ramda\": \"^0.26.1\",\n \"slugify\": \"^1.2.6\",\n \"typescript\": \"3.8.3\",\n \"unescape\": \"^1.0.1\",\n \"vtex.search-graphql\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.search-graphql@0.29.0/public\"\n },\n \"devDependencies\": {\n \"@types/atob\": \"^2.1.2\",\n \"@types/camelcase\": \"^4.1.0\",\n \"@types/cookie\": \"^0.3.2\",\n \"@types/es6-shim\": \"^0.31.32\",\n \"@types/graphql\": \"^14.5.0\",\n \"@types/jest\": \"^25.1.4\",\n \"@types/koa\": \"^2.0.46\",\n \"@types/node\": \"^12.0.0\",\n \"@types/qs\": \"^6.5.1\",\n \"@types/ramda\": \"^0.26.21\",\n \"@vtex/api\": \"6.31.1\",\n \"@vtex/tsconfig\": \"^0.2.0\",\n \"eslint\": \"^5.15.3\",\n \"eslint-config-vtex\": \"^10.1.0\",\n \"jest\": \"^25.1.0\",\n \"prettier\": \"^1.16.4\",\n \"ts-jest\": \"^25.2.1\",\n \"typemoq\": \"^2.1.0\"\n },\n \"version\": \"0.0.3\"\n}\n\n```" } ]
code_search-engine-example_f8feca1e
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of search-engine-example/node/globals.ts from the search-engine-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport {\n IOContext,\n MetricsAccumulator,\n ParamsContext,\n RecorderState,\n SegmentData,\n ServiceContext,\n MessagesLoaderV2,\n} from '@vtex/api'\n\nimport { Clients } from './clients'\n\nif (!global.metrics) {\n console.error('No global.metrics at require time')\n global.metrics = new MetricsAccumulator()\n}\n\ndeclare global {\n type Context = ServiceContext<Clients, State, CustomContext>\n\n interface State extends RecorderState {\n messages?: MessagesLoaderV2\n }\n\n interface StaleRevalidateData<T>{\n ttl: Date\n data: T\n }\n\n interface CustomContext extends ParamsContext {\n cookie: string\n originalPath: string\n vtex: CustomIOContext\n }\n\n interface CustomIOContext extends IOContext {\n segment?: SegmentData\n }\n\n interface Property {\n name: string\n values: [string]\n }\n\n interface TranslatableMessage {\n content: string\n from: string\n id: string\n }\n\n interface Reference {\n Key: string\n Value: string\n }\n}\n\n```" } ]
code_search-engine-example_120b096f
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of search-engine-example/node/index.ts from the search-engine-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport './globals'\n\nimport { Cached, LRUCache, RecorderState, Service } from '@vtex/api'\nimport schema from 'vtex.search-graphql/graphql'\n\nimport { Clients } from './clients'\nimport { schemaDirectives } from './directives'\nimport { resolvers } from './resolvers'\n\nconst TWO_SECONDS_MS = 2 * 1000\nconst THREE_SECONDS_MS = 3 * 1000\nconst SIX_SECONDS_MS = 6 * 1000\n\n// Segments are small and immutable.\nconst MAX_SEGMENT_CACHE = 10000\nconst segmentCache = new LRUCache<string, Cached>({ max: MAX_SEGMENT_CACHE })\nconst searchCache = new LRUCache<string, Cached>({ max: 3000 })\nconst customSearchEngineCache = new LRUCache<string, Cached>({ max: 3000 })\nconst messagesCache = new LRUCache<string, Cached>({ max: 3000 })\nconst vbaseCache = new LRUCache<string, Cached>({ max: 3000 })\n\nmetrics.trackCache('segment', segmentCache)\nmetrics.trackCache('search', searchCache)\nmetrics.trackCache('customSearchEngine', customSearchEngineCache)\nmetrics.trackCache('messages', messagesCache)\nmetrics.trackCache('vbase', vbaseCache)\n\nexport default new Service<Clients, RecorderState, CustomContext>({\n clients: {\n implementation: Clients,\n options: {\n default: {\n retries: 2,\n timeout: THREE_SECONDS_MS,\n },\n messagesGraphQL: {\n concurrency: 10,\n memoryCache: messagesCache,\n timeout: TWO_SECONDS_MS,\n },\n segment: {\n concurrency: 10,\n memoryCache: segmentCache,\n timeout: THREE_SECONDS_MS,\n },\n search: {\n concurrency: 10,\n memoryCache: searchCache,\n timeout: SIX_SECONDS_MS,\n },\n customSearchEngine: {\n concurrency: 10,\n memoryCache: customSearchEngineCache,\n timeout: SIX_SECONDS_MS,\n },\n vbase: {\n concurrency: 2,\n memoryCache: vbaseCache,\n timeout: TWO_SECONDS_MS,\n },\n },\n },\n graphql: {\n resolvers,\n schema,\n schemaDirectives,\n },\n})\n\n```" } ]
code_search-engine-example_fa7373f5
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of search-engine-example/node/directives/withSegment.ts from the search-engine-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { defaultFieldResolver, GraphQLField } from 'graphql'\nimport { SchemaDirectiveVisitor } from 'graphql-tools'\nimport atob from 'atob'\n\n/**\n * Warning: we stopped using the segment client to decode the segment token for us because it added unnecessary overhead for now.\n * If the getSegment API evolves to do more than a decode we must stop decoding it here and start calling the API once again.\n */\nexport class WithSegment extends SchemaDirectiveVisitor {\n public visitFieldDefinition(field: GraphQLField<any, any>) {\n const { resolve = defaultFieldResolver } = field\n field.resolve = async (root, args, ctx: Context, info) => {\n const {\n vtex: { segmentToken },\n clients: {segment}\n } = ctx\n ctx.vtex.segment = segmentToken\n ? JSON.parse(atob(segmentToken))\n : (await segment.getSegment())\n return resolve(root, args, ctx, info)\n }\n }\n}\n\n```" } ]
code_search-engine-example_53a1a0e8
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of search-engine-example/node/directives/toVtexAssets.ts from the search-engine-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { defaultFieldResolver, GraphQLField } from 'graphql'\nimport { SchemaDirectiveVisitor } from 'graphql-tools'\n\nimport { flags } from '../featureFlags'\n\nexport class ToVtexAssets extends SchemaDirectiveVisitor {\n public visitFieldDefinition(field: GraphQLField<any, any>) {\n const { resolve = defaultFieldResolver } = field\n field.resolve = async (root, args, ctx: Context, info) => {\n const result = resolve(root, args, ctx, info)\n return flags.VTEX_ASSETS_URL && result\n ? result.replace('vteximg.com.br', 'vtexassets.com')\n : result\n }\n }\n}\n\n```" } ]
code_search-engine-example_92b0f12f
[ { "role": "system", "content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms." }, { "role": "user", "content": "Show me the implementation of search-engine-example/node/directives/index.ts from the search-engine-example VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { WithSegment } from './withSegment'\nimport { ToVtexAssets } from './toVtexAssets'\n\nexport const schemaDirectives = {\n withSegment: WithSegment,\n toVtexAssets: ToVtexAssets,\n}\n\n```" } ]