id
stringlengths
12
53
messages
listlengths
3
3
code_product-review-interfaces_d3cfb838
[ { "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 product-review-interfaces/example/README.md from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# Review app example\n\nThis is an example of how a review app would integrate with the store framework.\n\n## Troubleshooting\n\n## Blocks does not appear in the product page\n\nMake sure you have in your `blocks.json`:\n\n```js\n\"store.product\": {\n \"blocks\": [\n // ...other blocks\n \"product-reviews\",\n \"product-rating-summary\",\n \"product-questions-and-answers\"\n ]\n}\n```\n\n## Stars does not appear in shelf\n\nMake sure you are using the block `product-summary.shelf`. This will not work if it uses the `product-summary`.\n\n```js\n\"product-summary.shelf\": {\n \"children\": [\n // ...other blocks\n \"product-rating-inline\",\n // ...other blocks\n ]\n}\n```\n\n```" } ]
code_product-review-interfaces_bc122f9d
[ { "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 product-review-interfaces/example/manifest.json from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"vendor\": \"vtex\",\n \"name\": \"review-app-example\",\n \"version\": \"0.0.1\",\n \"title\": \"Review App Example\",\n \"description\": \"Example app of a review app in the platform.\",\n \"builders\": {\n \"messages\": \"1.x\",\n \"store\": \"0.x\",\n \"react\": \"3.x\",\n \"node\": \"4.x\",\n \"graphql\": \"1.x\"\n },\n \"mustUpdateAt\": \"2019-04-02\",\n \"scripts\": {\n \"postreleasy\": \"vtex publish --verbose\"\n },\n \"dependencies\": {\n \"vtex.product-review-interfaces\": \"1.x\",\n \"vtex.product-summary\": \"2.x\",\n \"vtex.product-context\": \"0.x\",\n \"vtex.store\": \"2.x\"\n },\n \"settingsSchema\": {\n \"title\": \"Product Review Example\",\n \"type\": \"object\",\n \"properties\": {\n \"storeId\": {\n \"title\": \"Store ID\",\n \"description\": \"Enter your Store ID\",\n \"type\": \"string\"\n },\n \"productBinding\": {\n \"title\": \"Product Reference\",\n \"type\": \"string\",\n \"default\": \"productId\",\n \"enum\": [\n \"productId\",\n \"refId\",\n \"skuId\",\n \"slug\"\n ]\n }\n }\n },\n \"$schema\": \"https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema\"\n}\n```" } ]
code_product-review-interfaces_ed616b1b
[ { "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 product-review-interfaces/docs/README.md from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# Product Review Interfaces\n\n> Interfaces for a product review app.\n\nThis app provides extensible interfaces that can be used by the `vtex.store` and a theme app. A review app would depend on this app and extend the interfaces provided to become available in the store.\n\nYou can see an example of a review app [here](/example).\n\n```" } ]
code_product-review-interfaces_27ef8c8d
[ { "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 product-review-interfaces/react/package.json from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"scripts\": {\n \"lint\": \"tsc --noEmit && eslint --ext ts .\"\n },\n \"dependencies\": {\n \"react\": \"^16.8.3\",\n \"react-dom\": \"^16.8.3\"\n },\n \"devDependencies\": {\n \"@types/graphql\": \"^14.2.0\",\n \"@types/jest\": \"^24.0.11\",\n \"@types/node\": \"^11.13.0\",\n \"@types/prop-types\": \"^15.7.0\",\n \"@types/react\": \"^16.8.10\",\n \"apollo-client\": \"^2.5.1\",\n \"eslint\": \"^5.16.0\",\n \"eslint-config-vtex\": \"^10.1.0\",\n \"prettier\": \"^1.16.4\",\n \"tslint-eslint-rules\": \"^5.4.0\",\n \"typescript\": \"3.3.4000\"\n }\n}\n\n```" } ]
code_product-review-interfaces_f5348957
[ { "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 product-review-interfaces/react/Noop.tsx from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React, { FunctionComponent } from 'react'\n\nconst Noop: FunctionComponent = () => <></>\n\nexport default Noop\n\n```" } ]
code_product-review-interfaces_afe30a87
[ { "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 product-review-interfaces/store/interfaces.json from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"product-review-form\": {\n \"component\": \"Noop\",\n \"extensible\": \"public\"\n },\n \"product-reviews\": {\n \"component\": \"Noop\",\n \"extensible\": \"public\"\n },\n \"product-questions-and-answers\": {\n \"component\": \"Noop\",\n \"extensible\": \"public\"\n },\n \"product-rating-summary\": {\n \"component\": \"Noop\",\n \"extensible\": \"public\"\n },\n \"product-rating-inline\": {\n \"component\": \"Noop\",\n \"extensible\": \"public\"\n }\n}\n```" } ]
code_product-review-interfaces_837b93e7
[ { "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 product-review-interfaces/example/messages/pt.json from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"qna\": \"Perguntas e respostas para {name}\",\n \"stars\": \"Estrelas para {name}\",\n \"rating-summary\": \"Resumo das avaliações para {name}\",\n \"review-form\": \"Formulário de avaliação\",\n \"reviews\": \"Mostre as avaliações de {name} aqui\"\n}\n\n```" } ]
code_product-review-interfaces_b8e790ac
[ { "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 product-review-interfaces/example/messages/en.json from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"qna\": \"Questions and answers for {name}\",\n \"stars\": \"Stars rating for {name}\",\n \"rating-summary\": \"Rating summary for {name}\",\n \"review-form\": \"Review form\",\n \"reviews\": \"Show {name} reviews here\"\n}\n\n```" } ]
code_product-review-interfaces_d7f2c9b1
[ { "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 product-review-interfaces/example/messages/context.json from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"qna\": \"Questions and answers\",\n \"stars\": \"Stars\",\n \"rating-summary\": \"Rating summary\",\n \"review-form\": \"Review form\",\n \"reviews\": \"Reviews\"\n}\n\n```" } ]
code_product-review-interfaces_9b7a6778
[ { "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 product-review-interfaces/example/messages/es.json from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"qna\": \"Preguntas y respuestas para {name}\",\n \"stars\": \"Estrellas para {name}\",\n \"rating-summary\": \"Resumen de las valoraciones para {name}\",\n \"review-form\": \"Formulario de evaluación\",\n \"reviews\": \"Mostrar las evaluaciones de {name} aquí\"\n}\n\n```" } ]
code_product-review-interfaces_04592aa6
[ { "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 product-review-interfaces/example/graphql/schema.graphql from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```graphql\ntype Query {\n appSettings: Settings @cacheControl(scope: PUBLIC, maxAge: MEDIUM)\n}\n\ntype Settings {\n storeId: String\n productBinding: String\n}\n```" } ]
code_product-review-interfaces_abc5689d
[ { "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 product-review-interfaces/example/node/package.json from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"dependencies\": {\n \"ramda\": \"^0.25.0\"\n },\n \"devDependencies\": {\n \"@types/node\": \"8.x\",\n \"@types/ramda\": \"types/npm-ramda#dist\",\n \"@vtex/api\": \"3.8.1\",\n \"eslint\": \"^5.16.0\",\n \"eslint-config-vtex\": \"^10.1.0\",\n \"prettier\": \"^1.18.2\",\n \"typescript\": \"3.5.2\"\n },\n \"scripts\": {\n \"lint\": \"tsc --noEmit --pretty && tslint -c tslint.json --fix './**/*.ts'\"\n }\n}\n\n```" } ]
code_product-review-interfaces_dc30b787
[ { "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 product-review-interfaces/example/node/index.ts from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { ClientsConfig, LRUCache, Service, IOClients, ServiceContext } from '@vtex/api'\nimport { Clients } from './clients'\n\nimport settingsResolver from './resolvers/settings'\n\nconst TIMEOUT_MS = 800\n\n// Create a LRU memory cache for the Product Review 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('productReview', 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 // We declare a global Context type just to avoid re-writing ServiceContext<Clients> in every handler and resolver\n type Context = ServiceContext<Clients>\n}\n\n// Export a service that defines route handlers and client options.\nexport default new Service<IOClients>({\n clients,\n graphql: {\n resolvers: {\n Query: {\n appSettings: settingsResolver,\n }\n },\n },\n})\n```" } ]
code_product-review-interfaces_0d6bca60
[ { "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 product-review-interfaces/example/react/styles.css from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\n.stars {}\n\n.star {}\n.star--filled {}\n.star--empty {}\n```" } ]
code_product-review-interfaces_d4143a29
[ { "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 product-review-interfaces/example/react/RatingSummary.tsx from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React, { FunctionComponent, useContext } from 'react'\nimport { FormattedMessage } from 'react-intl'\nimport { ProductContext } from 'vtex.product-context'\nimport Stars from './components/Stars'\n\nconst RatingSummary: FunctionComponent = () => {\n const { product } = useContext(ProductContext)\n\n if (!product) {\n return null\n }\n\n return (\n <div title={name}>\n <Stars rating={4} />\n <FormattedMessage\n id=\"rating-summary\"\n values={{\n name: product.productName,\n }}\n />\n </div>\n )\n}\n\nexport default RatingSummary\n\n```" } ]
code_product-review-interfaces_bb5202d7
[ { "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 product-review-interfaces/example/react/ReviewForm.tsx from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React, { FunctionComponent } from 'react'\nimport { FormattedMessage } from 'react-intl'\n\nconst ReviewForm: FunctionComponent = () => {\n return (\n <div>\n <FormattedMessage id=\"review-form\" />\n </div>\n )\n}\n\nexport default ReviewForm\n\n```" } ]
code_product-review-interfaces_9a170fb5
[ { "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 product-review-interfaces/example/react/package.json from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"scripts\": {\n \"test\": \"vtex-test-tools test\",\n \"lint\": \"tsc --noEmit && eslint --ext ts,tsx . --fix\"\n },\n \"dependencies\": {\n \"@vtex/css-handles\": \"^1.0.0\",\n \"classnames\": \"^2.2.6\",\n \"ramda\": \"^0.26.1\",\n \"react\": \"^16.8.3\",\n \"react-dom\": \"^16.8.3\",\n \"react-intl\": \"^2.7.2\"\n },\n \"devDependencies\": {\n \"@types/classnames\": \"^2.2.7\",\n \"@types/graphql\": \"^14.2.0\",\n \"@types/jest\": \"^24.0.11\",\n \"@types/node\": \"^11.13.0\",\n \"@types/prop-types\": \"^15.7.0\",\n \"@types/ramda\": \"^0.26.5\",\n \"@types/react\": \"^16.8.10\",\n \"@types/react-intl\": \"^2.3.17\",\n \"@vtex/test-tools\": \"^0.2.0\",\n \"apollo-client\": \"^2.5.1\",\n \"eslint\": \"^5.16.0\",\n \"eslint-config-vtex-react\": \"^4.1.0\",\n \"prettier\": \"^1.18.2\",\n \"typescript\": \"3.5.2\"\n }\n}\n\n```" } ]
code_product-review-interfaces_b31c2707
[ { "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 product-review-interfaces/example/react/QnA.tsx from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React, { FunctionComponent, useContext } from 'react'\nimport { FormattedMessage } from 'react-intl'\nimport { ProductContext } from 'vtex.product-context'\n\nconst QnA: FunctionComponent<QnAProps> = () => {\n const { product } = useContext(ProductContext)\n\n if (!product) {\n return null\n }\n\n return (\n <div>\n <FormattedMessage\n id=\"qna\"\n values={{\n name: product.productName,\n }}\n />\n </div>\n )\n}\n\ninterface QnAProps {\n productQuery: any\n}\n\nexport default QnA\n\n```" } ]
code_product-review-interfaces_cd657ab9
[ { "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 product-review-interfaces/example/react/Reviews.tsx from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React, { FunctionComponent, useContext } from 'react'\nimport { FormattedMessage } from 'react-intl'\nimport { ProductContext } from 'vtex.product-context'\nimport withSettings, { Settings } from './components/withSettings'\nimport { DataProps } from 'react-apollo'\n\nconst Reviews: FunctionComponent<Partial<DataProps<Settings>>> = () => {\n const { product } = useContext(ProductContext)\n\n if (!product) {\n return null\n }\n\n return (\n <div>\n <FormattedMessage\n id=\"reviews\"\n values={{\n name: product.productName,\n }}\n />\n </div>\n )\n}\n\nexport default withSettings(Reviews)\n\n```" } ]
code_product-review-interfaces_bf27e393
[ { "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 product-review-interfaces/example/react/RatingInline.tsx from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React, { useContext, FunctionComponent } from 'react'\nimport { ProductSummaryContext } from 'vtex.product-summary'\nimport Stars from './components/Stars'\n\nconst RatingInline: FunctionComponent = () => {\n const { product } = useContext(ProductSummaryContext)\n\n return (\n <div title={product.name}>\n <Stars rating={4} />\n </div>\n )\n}\n\nexport default RatingInline\n\n```" } ]
code_product-review-interfaces_5664184e
[ { "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 product-review-interfaces/example/store/blocks.json from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.product-review-form\": {\n \"blocks\": [\"product-review-form.example-review\"]\n }\n}\n\n```" } ]
code_product-review-interfaces_ce9dd736
[ { "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 product-review-interfaces/example/store/interfaces.json from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"product-review-form.example-review\": {\n \"component\": \"ReviewForm\"\n },\n \"product-reviews.example-review\": {\n \"component\": \"Reviews\"\n },\n \"product-questions-and-answers.example-review\": {\n \"component\": \"QnA\"\n },\n \"product-rating-summary.example-review\": {\n \"component\": \"RatingSummary\"\n },\n \"product-rating-inline.example-review\": {\n \"component\": \"RatingInline\"\n }\n}\n\n```" } ]
code_product-review-interfaces_4a81849c
[ { "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 product-review-interfaces/example/store/routes.json from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store.product-review-form\": {\n \"path\": \"/new-review\"\n }\n}\n\n```" } ]
code_product-review-interfaces_d2d4bc2a
[ { "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 product-review-interfaces/example/store/plugins.json from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"product-rating-summary\": \"product-rating-summary.example-review\",\n \"product-reviews\": \"product-reviews.example-review\",\n \"product-questions-and-answers\": \"product-questions-and-answers.example-review\",\n \"product-rating-inline\": \"product-rating-inline.example-review\",\n \"product-review-form\": \"product-review-form.example-review\"\n}\n\n```" } ]
code_product-review-interfaces_a3baa754
[ { "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 product-review-interfaces/example/node/clients/productReview.ts from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { ExternalClient, InstanceOptions, IOContext, IOResponse } from '@vtex/api'\n\nexport default class ProductReview extends ExternalClient {\n constructor(context: IOContext, options?: InstanceOptions) {\n super('http://httpstat.us', context, options)\n }\n\n public async getStatus (status: number): Promise<string> {\n return this.http.get(status.toString(), {\n metric: 'status-get',\n })\n }\n\n public async getStatusWithHeaders (status: number): Promise<IOResponse<string>> {\n return this.http.getRaw(status.toString(), {\n metric: 'status-get-raw',\n })\n }\n}\n```" } ]
code_product-review-interfaces_4d89348c
[ { "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 product-review-interfaces/example/node/clients/index.ts from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { IOClients } from '@vtex/api'\n\nimport ProductReview from './productReview'\n\n// Extend the default IOClients implementation with our own custom clients.\nexport class Clients extends IOClients {\n public get status() {\n return this.getOrSet('productReview', ProductReview)\n }\n}\n```" } ]
code_product-review-interfaces_89182ad6
[ { "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 product-review-interfaces/example/node/resolvers/settings.ts from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { ServiceContext } from \"@vtex/api\";\n\ndeclare var process : {\n env: {\n VTEX_APP_ID: string\n }\n}\n\nconst appId = process.env.VTEX_APP_ID\n\nexport default async function settings(_root: any, _args: {}, ctx: ServiceContext) {\n const settings = await ctx.clients.apps.getAppSettings(appId)\n\n return settings\n}\n```" } ]
code_product-review-interfaces_4f420417
[ { "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 product-review-interfaces/example/react/typings/storefront.d.ts from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport { FunctionComponent, ReactElement } from 'react'\n\ndeclare global {\n interface StorefrontFunctionComponent<P = {}> extends FunctionComponent<P> {\n schema?: object\n }\n\n interface StorefrontComponent<P = {}, S = {}> extends Component<P, S> {\n schema: object\n }\n}\n\n```" } ]
code_product-review-interfaces_2416f435
[ { "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 product-review-interfaces/example/react/typings/vtex.product-context.d.ts from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.product-context' {\n import { Context } from 'react'\n\n interface ProductContext {\n product: any\n }\n\n export const ProductContext = Context\n}\n\n```" } ]
code_product-review-interfaces_78ebb72c
[ { "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 product-review-interfaces/example/react/typings/css.d.ts from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module '*.css' {\n const css: any\n export default css\n}\n\n```" } ]
code_product-review-interfaces_72bc8852
[ { "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 product-review-interfaces/example/react/typings/graphql.d.ts from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module '*.graphql' {\n import { DocumentNode } from 'graphql'\n\n const value: DocumentNode\n export default value\n}\n\n```" } ]
code_product-review-interfaces_2b4ff287
[ { "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 product-review-interfaces/example/react/typings/vtex.product-summary.d.ts from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.product-summary' {\n import { Context } from 'react'\n\n interface ProductSummary {\n product: any\n }\n\n export const ProductSummaryContext = Context\n}\n\n```" } ]
code_product-review-interfaces_6765000b
[ { "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 product-review-interfaces/example/react/components/withSettings.tsx from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport settings from '../graphql/appSettings.graphql'\nimport { graphql } from 'react-apollo'\n\nexport interface Settings {\n storeId: string\n productBinding: string\n}\n\nconst withSettings = graphql<{}, Settings>(settings)\n\nexport default withSettings\n\n```" } ]
code_product-review-interfaces_42ab4499
[ { "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 product-review-interfaces/example/react/components/Stars.tsx from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React, { FunctionComponent, useMemo } from 'react'\nimport Star from './Star'\nimport styles from '../styles.css'\n\nconst Stars: FunctionComponent<StarsProps> = ({ rating }) => {\n const stars = useMemo(\n () => [null, null, null, null, null].map((_, index) => index < rating),\n [rating]\n )\n\n return (\n <div className={`${styles.stars} c-on-base`}>\n {stars.map((value, index) => (\n <Star key={index} filled={value} />\n ))}\n </div>\n )\n}\n\ninterface StarsProps {\n rating: number\n}\n\nexport default Stars\n\n```" } ]
code_product-review-interfaces_b3a0751e
[ { "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 product-review-interfaces/example/react/components/Star.tsx from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React, { FunctionComponent } from 'react'\nimport styles from '../styles.css'\n\nconst Star: FunctionComponent<StarProps> = ({ filled }) => {\n const style = filled ? styles['star--filled'] : styles['star--empty']\n const content = filled ? '★' : '☆'\n\n return <span className={`${styles.star} ${style}`}>{content}</span>\n}\n\ninterface StarProps {\n filled: boolean\n}\n\nexport default Star\n\n```" } ]
code_product-review-interfaces_4e3a6b37
[ { "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 product-review-interfaces/example/react/graphql/appSettings.graphql from the product-review-interfaces VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```graphql\nquery appSettings {\n appSettings {\n storeId\n productBinding\n }\n}\n```" } ]
code_icommkt_5185372b
[ { "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 icommkt/docs/README.md from the icommkt VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n📢 Use this project, [contribute](https://github.com/vtex-apps/icommkt) to it or open issues to help evolve it using [Store Discussion](https://github.com/vtex-apps/store-discussion).\n\n# Icommkt\n<!-- DOCS-IGNORE:start -->\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<!-- DOCS-IGNORE:end -->\n\nEmail & Marketing Automation Platform. Boost your business with high performance campaigns\n\n## Configuration\n\nIt is possible to install in your store either by using App Store or the VTEX IO Toolbelt.\n\n### Using VTEX App Store\n\n1. Access the **Apps** section in your account's admin page and look for the Icommkt box;\n2. Then, click on the **Install** button;\n3. You'll see a warning message about needing to enter the necessary configurations. Scroll down and type in your **Public domain** in the `Icommkt` field.\n4. Click on **Save**.\n\n### Using VTEX IO Toolbelt\n\n1. [Install](https://vtex.io/docs/recipes/development/installing-an-app/) the `vtex.icommkt@0.x` app. You can confirm that the app has now been installed by running `vtex ls` again. \n2. Access the **Apps** section in your account's admin page and look for the Icommkt box. Once you find it, click on the box.\n3. Fill in the `Icommkt` field with your **Public domain**.\n4. Click on **Save**.\n\n<!-- DOCS-IGNORE:start -->\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<!-- markdownlint-enable -->\n<!-- prettier-ignore-end -->\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind are welcome!\n<!-- DOCS-IGNORE:end -->\n\n```" } ]
code_icommkt_76e3021f
[ { "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 icommkt/react/index.tsx from the icommkt VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport { canUseDOM } from 'vtex.render-runtime'\n\nimport { PixelMessage } from './typings/events'\n\nexport function handleEvents(e: PixelMessage) {\n switch (e.data.eventName) {\n case 'vtex:pageView': {\n break\n }\n default: {\n break\n }\n }\n}\n\nif (canUseDOM) {\n window.addEventListener('message', handleEvents)\n}\n\n```" } ]
code_icommkt_7c3f9fc1
[ { "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 icommkt/react/package.json from the icommkt VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"scripts\": {\n \"test\": \"vtex-test-tools test\"\n },\n \"devDependencies\": {\n \"@apollo/react-testing\": \"^3.1.3\",\n \"@types/graphql\": \"^14.5.0\",\n \"@types/jest\": \"^25.1.5\",\n \"@types/node\": \"^13.11.0\",\n \"@types/react\": \"^16.9.31\",\n \"@types/react-intl\": \"^3.0.0\",\n \"@vtex/test-tools\": \"^3.1.0\",\n \"apollo-cache-inmemory\": \"^1.6.5\",\n \"apollo-client\": \"^2.6.8\",\n \"graphql\": \"^14.5.4\",\n \"react-intl\": \"^3.11.0\",\n \"typescript\": \"3.8.3\"\n }\n}\n\n```" } ]
code_icommkt_d9ab5b8c
[ { "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 icommkt/store/interfaces.json from the icommkt VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"pixel.APPNAME\": {\n \"component\": \"index\"\n }\n}\n```" } ]
code_icommkt_17cd8ca2
[ { "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 icommkt/react/typings/events.d.ts from the icommkt VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport interface PixelMessage extends MessageEvent {\n data:\n | ProductViewData\n | ProductClickData\n | OrderPlacedData\n | OrderPlacedTrackedData\n | PageViewData\n | ProductImpressionData\n | AddToCartData\n | RemoveToCartData\n | CartChangedData\n | HomePageInfo\n | ProductPageInfoData\n | SearchPageInfoData\n | UserData\n | CartIdData\n}\n\nexport interface EventData {\n event: string\n eventName: string\n currency: string\n}\n\nexport interface PageInfoData extends EventData {\n event: 'pageInfo'\n eventName: 'vtex:pageInfo'\n accountName: string\n pageTitle: string\n pageUrl: string\n}\n\nexport interface UserData extends PageInfoData {\n eventType: 'userData'\n eventName: 'vtex:userData'\n firstName?: string\n lastName?: string\n document?: string\n id?: string\n email?: string\n phone?: string\n isAuthenticated: boolean\n}\n\nexport interface CartIdData extends PageInfoData {\n eventType: 'cartId'\n eventName: 'vtex:cartId'\n cartId: string\n}\n\nexport interface HomePageInfo extends PageInfoData {\n eventType: 'homeView'\n}\n\nexport interface ProductPageInfoData extends PageInfoData {\n eventType: 'productPageInfo'\n}\n\nexport interface SearchPageInfoData extends PageInfoData {\n eventType:\n | 'internalSiteSearchView'\n | 'categoryView'\n | 'departmentView'\n | 'emptySearchView'\n category?: CategoryMetaData\n department?: DepartmentMetaData\n search?: SearchMetaData\n}\n\ninterface CategoryMetaData {\n id: string\n name: string\n}\n\ninterface DepartmentMetaData {\n id: string\n name: string\n}\n\ninterface SearchMetaData {\n term: string\n category: CategoryMetaData\n results: number\n}\n\nexport interface PageViewData extends EventData {\n event: 'pageView'\n eventName: 'vtex:pageView'\n pageTitle: string\n pageUrl: string\n referrer: string\n}\n\nexport interface AddToCartData extends EventData {\n event: 'addToCart'\n eventName: 'vtex:addToCart'\n items: CartItem[]\n}\n\nexport interface RemoveToCartData extends EventData {\n event: 'removeFromCart'\n eventName: 'vtex:removeFromCart'\n items: CartItem[]\n}\n\nexport interface CartChangedData extends EventData {\n event: 'cartChanged'\n eventName: 'vtex:cartChanged'\n items: CartItem[]\n}\n\nexport interface OrderPlacedData extends Order, EventData {\n event: 'orderPlaced'\n eventName: 'vtex:orderPlaced'\n}\n\nexport interface OrderPlacedTrackedData extends Order, EventData {\n event: 'orderPlacedTracked'\n eventName: 'vtex:orderPlacedTracked'\n}\n\nexport interface ProductViewData extends EventData {\n event: 'productView'\n eventName: 'vtex:productView'\n product: Product\n}\n\nexport interface ProductClickData extends EventData {\n event: 'productClick'\n eventName: 'vtex:productClick'\n product: ProductSummary\n}\n\nexport interface ProductImpressionData extends EventData {\n event: 'productImpression'\n eventName: 'vtex:productImpression'\n impressions: Impression[]\n product?: ProductSummary // deprecated, use impressions list!\n position?: number // deprecated, use impressions list!\n list: string\n}\n\ninterface CartItem {\n brand: string\n category: string\n detailUrl: string\n imageUrl: string\n name: string\n price: number\n productId: string\n productRefId: string\n quantity: number\n skuId: string\n variant: string\n}\n\nexport interface Order {\n accountName: string\n corporateName: string\n coupon: string\n currency: string\n openTextField: string\n orderGroup: string\n salesChannel: string\n visitorAddressCity: string\n visitorAddressComplement: string\n visitorAddressCountry: string\n visitorAddressNeighborhood: string\n visitorAddressNumber: string\n visitorAddressPostalCode: string\n visitorAddressState: string\n visitorAddressStreet: string\n visitorContactInfo: string[]\n visitorContactPhone: string\n visitorType: string\n transactionId: string\n transactionDate: string\n transactionAffiliation: string\n transactionTotal: number\n transactionShipping: number\n transactionSubtotal: number\n transactionDiscounts: number\n transactionTax: number\n transactionCurrency: string\n transactionPaymentType: PaymentType[]\n transactionShippingMethod: ShippingMethod[]\n transactionLatestShippingEstimate: Date\n transactionProducts: ProductOrder[]\n transactionPayment: {\n id: string\n }\n}\n\nexport interface Impression {\n product: ProductSummary\n position: number\n}\n\nexport interface PaymentType {\n group: string\n paymentSystemName: string\n installments: number\n value: number\n}\n\nexport interface ShippingMethod {\n itemId: string\n selectedSla: string\n}\n\nexport interface ProductOrder {\n id: string\n name: string\n sku: string\n skuRefId: string\n skuName: string\n productRefId: string\n ean: string\n slug: string\n brand: string\n brandId: string\n seller: string\n sellerId: string\n category: string\n categoryId: string\n categoryTree: string[]\n categoryIdTree: string[]\n priceTags: PriceTag[]\n originalPrice: number\n price: number\n sellingPrice: number\n tax: number\n quantity: number\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n components: any[]\n measurementUnit: string\n unitMultiplier: number\n}\n\nexport interface PriceTag {\n identifier: string\n isPercentual: boolean\n value: number\n}\n\nexport interface Product {\n brand: string\n brandId: string\n categories: string[]\n categoryId: string\n categoryTree: Array<{ id: string; name: string }>\n detailUrl: string\n items: Item[]\n linkText: string\n productId: string\n productName: string\n productReference: string\n selectedSku: Item\n}\n\nexport interface Item {\n itemId: string\n name: string\n ean: string\n referenceId: { Key: string; Value: string }\n imageUrl: string\n sellers: Seller[]\n}\n\nexport interface ProductSummary {\n brand: string\n brandId: string\n categories: string[]\n items: ItemSummary[]\n linkText: string\n productId: string\n productName: string\n productReference: string\n sku: ItemSummary\n}\n\ninterface ItemSummary {\n itemId: string\n ean: string\n name: string\n referenceId: { Key: string; Value: string }\n seller: Seller\n sellers: Seller[]\n}\n\nexport interface Seller {\n commertialOffer: CommertialOffer\n sellerId: string\n}\n\nexport interface CommertialOffer {\n Price: number\n ListPrice: number\n AvailableQuantity: number\n}\n\n```" } ]
code_icommkt_9e1a3633
[ { "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 icommkt/react/typings/vtex.render-runtime.d.ts from the icommkt VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.render-runtime' {\n export const canUseDOM: boolean\n}\n\n```" } ]
code_icommkt_86ba1aee
[ { "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 icommkt/react/typings/global.d.ts from the icommkt VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ninterface Window extends Window {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n dataLayer: any[]\n}\n\n```" } ]
code_checkout-summary_4cf8faec
[ { "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 checkout-summary/messages/sl.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Popusti\",\n \"store/checkout-summary.Tax\": \"Davki\",\n \"store/checkout-summary.Items\": \"Skupaj\",\n \"store/checkout-summary.Shipping\": \"Dobava\",\n \"store/checkout-summary.Summary\": \"Povzetek\",\n \"store/checkout-summary.Total\": \"Skupaj\",\n \"store/checkout-summary.disclaimer\": \"Dostava in davki, izračunani v košarici.\",\n \"admin/editor.checkout-summary.label\": \"Povzetek\",\n \"admin/editor.checkout-summary.title\": \"Naziv\"\n}\n\n```" } ]
code_checkout-summary_b0222b8a
[ { "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 checkout-summary/messages/hu.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Kedvezmények\",\n \"store/checkout-summary.Tax\": \"Adók\",\n \"store/checkout-summary.Items\": \"Részösszeg\",\n \"store/checkout-summary.Shipping\": \"Kézbesítés\",\n \"store/checkout-summary.Summary\": \"Összegzés\",\n \"store/checkout-summary.Total\": \"Összesen\",\n \"store/checkout-summary.disclaimer\": \"A szállítás és adók a kosárban kerülnek kiszámításra.\",\n \"admin/editor.checkout-summary.label\": \"Összegzés\",\n \"admin/editor.checkout-summary.title\": \"Cím\"\n}\n\n```" } ]
code_checkout-summary_176f873e
[ { "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 checkout-summary/messages/nl.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Kortingen\",\n \"store/checkout-summary.Tax\": \"Belastingen\",\n \"store/checkout-summary.Items\": \"Subtotaal\",\n \"store/checkout-summary.Shipping\": \"Levering\",\n \"store/checkout-summary.Summary\": \"Overzicht\",\n \"store/checkout-summary.Total\": \"Totaal\",\n \"store/checkout-summary.disclaimer\": \"Verzendings- en belastingkosten worden in de winkelwagen berekend.\",\n \"admin/editor.checkout-summary.label\": \"Overzicht\",\n \"admin/editor.checkout-summary.title\": \"Titel\"\n}\n\n```" } ]
code_checkout-summary_073bf265
[ { "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 checkout-summary/messages/ja.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"ディスカウント\",\n \"store/checkout-summary.Tax\": \"税金\",\n \"store/checkout-summary.Items\": \"小計\",\n \"store/checkout-summary.Shipping\": \"配送\",\n \"store/checkout-summary.Summary\": \"サマリ\",\n \"store/checkout-summary.Total\": \"合計\",\n \"store/checkout-summary.disclaimer\": \"送料と税金はカートで計算されます。\",\n \"admin/editor.checkout-summary.label\": \"サマリ\",\n \"admin/editor.checkout-summary.title\": \"タイトル\"\n}\n\n```" } ]
code_checkout-summary_149e6875
[ { "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 checkout-summary/messages/de.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Rabatt\",\n \"store/checkout-summary.Tax\": \"Steuern\",\n \"store/checkout-summary.Items\": \"Zwischensumme\",\n \"store/checkout-summary.Shipping\": \"Lieferung\",\n \"store/checkout-summary.Summary\": \"Zusammenfassung\",\n \"store/checkout-summary.Total\": \"Gesamt\",\n \"store/checkout-summary.disclaimer\": \"Versandkosten und Steuern werden im Warenkorb berechnet.\",\n \"admin/editor.checkout-summary.label\": \"Zusammenfassung\",\n \"admin/editor.checkout-summary.title\": \"Titel\"\n}\n\n```" } ]
code_checkout-summary_4fb21b19
[ { "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 checkout-summary/messages/ru.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Скидки\",\n \"store/checkout-summary.Tax\": \"Налоги\",\n \"store/checkout-summary.Items\": \"Промежуточный итог\",\n \"store/checkout-summary.Shipping\": \"Доставка\",\n \"store/checkout-summary.Summary\": \"Содержание\",\n \"store/checkout-summary.Total\": \"Всего\",\n \"store/checkout-summary.disclaimer\": \"Стоимость доставки и налоги рассчитываются в корзине.\",\n \"admin/editor.checkout-summary.label\": \"Содержание\",\n \"admin/editor.checkout-summary.title\": \"Название\"\n}\n\n```" } ]
code_checkout-summary_b878808c
[ { "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 checkout-summary/messages/pl.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Zniżki\",\n \"store/checkout-summary.Tax\": \"Podatki\",\n \"store/checkout-summary.Items\": \"Podsuma\",\n \"store/checkout-summary.Shipping\": \"Dostawa\",\n \"store/checkout-summary.Summary\": \"Podsumowanie\",\n \"store/checkout-summary.Total\": \"Suma\",\n \"store/checkout-summary.disclaimer\": \"Wysyłka i podatki obliczone w Koszyku.\",\n \"admin/editor.checkout-summary.label\": \"Podsumowanie\",\n \"admin/editor.checkout-summary.title\": \"Tytuł\"\n}\n\n```" } ]
code_checkout-summary_7c088cf8
[ { "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 checkout-summary/messages/uk.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Знижки\",\n \"store/checkout-summary.Tax\": \"Податки\",\n \"store/checkout-summary.Items\": \"Проміжний підсумок\",\n \"store/checkout-summary.Shipping\": \"Доставка\",\n \"store/checkout-summary.Summary\": \"Підсумок\",\n \"store/checkout-summary.Total\": \"Разом\",\n \"store/checkout-summary.disclaimer\": \"Вартість доставлення й податки розраховуються в кошику.\",\n \"admin/editor.checkout-summary.label\": \"Підсумок\",\n \"admin/editor.checkout-summary.title\": \"Назва\"\n}\n\n```" } ]
code_checkout-summary_3d7df645
[ { "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 checkout-summary/messages/fi.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Alennukset\",\n \"store/checkout-summary.Tax\": \"Verot\",\n \"store/checkout-summary.Items\": \"Välisumma\",\n \"store/checkout-summary.Shipping\": \"Toimitus\",\n \"store/checkout-summary.Summary\": \"Yhteenveto\",\n \"store/checkout-summary.Total\": \"Yhteensä\",\n \"store/checkout-summary.disclaimer\": \"Toimituskulut ja verot lasketaan ostoskorissa.\",\n \"admin/editor.checkout-summary.label\": \"Yhteenveto\",\n \"admin/editor.checkout-summary.title\": \"Nimi\"\n}\n\n```" } ]
code_checkout-summary_10e03016
[ { "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 checkout-summary/messages/sk.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Zľavy\",\n \"store/checkout-summary.Tax\": \"Daň\",\n \"store/checkout-summary.Items\": \"Medzisúčet\",\n \"store/checkout-summary.Shipping\": \"Dodanie\",\n \"store/checkout-summary.Summary\": \"Zhrnutie\",\n \"store/checkout-summary.Total\": \"Celkom\",\n \"store/checkout-summary.disclaimer\": \"Poštovné a dane sa počítajú v košíku.\",\n \"admin/editor.checkout-summary.label\": \"Zhrnutie\",\n \"admin/editor.checkout-summary.title\": \"Názov\"\n}\n\n```" } ]
code_checkout-summary_62641825
[ { "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 checkout-summary/messages/id-ID.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Diskon\",\n \"store/checkout-summary.Tax\": \"Pajak\",\n \"store/checkout-summary.Items\": \"Subtotal\",\n \"store/checkout-summary.Shipping\": \"Pengiriman\",\n \"store/checkout-summary.Summary\": \"Ringkasan\",\n \"store/checkout-summary.Total\": \"Total\",\n \"store/checkout-summary.disclaimer\": \"Pengiriman dan pajak dihitung di Troli.\",\n \"admin/editor.checkout-summary.label\": \"Ringkasan\",\n \"admin/editor.checkout-summary.title\": \"Judul\",\n \"store/checkout-summary.installments.default\": \"Hingga {installmentsNumber}x {installmentValue}{hasInterest, select, true {, {interestRate} bunga} false { interest-free}}\",\n \"admin/editor.checkout-summary.installments.description\": \"Nilai tersedia untuk interpolasi: '{installmentsNumber}, {installmentValue}, {installmentsTotalValue}, {interestRate}, {hasInterest}, {paymentSystemName}'\",\n \"admin/editor.checkout-summary.installments.title\": \"Cicilan\"\n}\n\n```" } ]
code_checkout-summary_aabb34e3
[ { "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 checkout-summary/messages/pt.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Descontos\",\n \"store/checkout-summary.Tax\": \"Impostos\",\n \"store/checkout-summary.Items\": \"Subtotal\",\n \"store/checkout-summary.Summary\": \"Resumo\",\n \"store/checkout-summary.Shipping\": \"Entrega\",\n \"store/checkout-summary.Total\": \"Total\",\n \"store/checkout-summary.disclaimer\": \"Taxas e frete calculados no Carrinho\",\n \"admin/editor.checkout-summary.label\": \"Resumo\",\n \"admin/editor.checkout-summary.title\": \"Título\",\n \"store/checkout-summary.installments.default\": \"Em até {installmentsNumber}x {installmentValue}{hasInterest, select, true {, {interestRate} de juros} false { sem juros}}\",\n \"admin/editor.checkout-summary.installments.description\": \"Valores disponiveis para interpolação: '{installmentsNumber}, {installmentValue}, {installmentsTotalValue}, {interestRate}, {hasInterest}, {paymentSystemName}'\",\n \"admin/editor.checkout-summary.installments.title\": \"Parcelamento\"\n}\n\n```" } ]
code_checkout-summary_66541257
[ { "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 checkout-summary/messages/en.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Discounts\",\n \"store/checkout-summary.Tax\": \"Taxes\",\n \"store/checkout-summary.Items\": \"Subtotal\",\n \"store/checkout-summary.Shipping\": \"Delivery\",\n \"store/checkout-summary.Summary\": \"Summary\",\n \"store/checkout-summary.Total\": \"Total\",\n \"store/checkout-summary.disclaimer\": \"Shipping and taxes calculated in the Cart.\",\n \"admin/editor.checkout-summary.label\": \"Summary\",\n \"admin/editor.checkout-summary.title\": \"Title\",\n \"store/checkout-summary.installments.default\": \"Up to {installmentsNumber}x {installmentValue}{hasInterest, select, true {, {interestRate} of interest} false { interest-free}}\",\n \"admin/editor.checkout-summary.installments.description\": \"Values available for interpolation: '{installmentsNumber}, {installmentValue}, {installmentsTotalValue}, {interestRate}, {hasInterest}, {paymentSystemName}'\",\n \"admin/editor.checkout-summary.installments.title\": \"Installments\"\n}\n\n```" } ]
code_checkout-summary_d6021357
[ { "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 checkout-summary/messages/it.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Sconti\",\n \"store/checkout-summary.Tax\": \"Imposte\",\n \"store/checkout-summary.Items\": \"Subtotale\",\n \"store/checkout-summary.Shipping\": \"Spedizione\",\n \"store/checkout-summary.Summary\": \"Riepilogo\",\n \"store/checkout-summary.Total\": \"Totale\",\n \"store/checkout-summary.disclaimer\": \"Tasse e spese di spedizione calcolate nel carrello.\",\n \"admin/editor.checkout-summary.label\": \"Riepilogo\",\n \"admin/editor.checkout-summary.title\": \"Titolo\"\n}\n\n```" } ]
code_checkout-summary_58ab51ee
[ { "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 checkout-summary/messages/fr.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Réductions\",\n \"store/checkout-summary.Tax\": \"Taxes\",\n \"store/checkout-summary.Items\": \"Sous-total\",\n \"store/checkout-summary.Shipping\": \"Livraison\",\n \"store/checkout-summary.Summary\": \"Résumé\",\n \"store/checkout-summary.Total\": \"Total\",\n \"store/checkout-summary.disclaimer\": \"Les frais d’expédition et les taxes sont calculés au niveau du panier.\",\n \"admin/editor.checkout-summary.label\": \"Résumé\",\n \"admin/editor.checkout-summary.title\": \"Titre\"\n}\n\n```" } ]
code_checkout-summary_f1320282
[ { "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 checkout-summary/messages/el.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Εκπτώσεις\",\n \"store/checkout-summary.Tax\": \"Φόροι\",\n \"store/checkout-summary.Items\": \"Υποσύνολο\",\n \"store/checkout-summary.Shipping\": \"Παράδοση\",\n \"store/checkout-summary.Summary\": \"Περίληψη\",\n \"store/checkout-summary.Total\": \"Σύνολο\",\n \"store/checkout-summary.disclaimer\": \"Μεταφορικά και φόροι υπολογίστηκαν στο Καρότσι.\",\n \"admin/editor.checkout-summary.label\": \"Περίληψη\",\n \"admin/editor.checkout-summary.title\": \"Τίτλος\"\n}\n\n```" } ]
code_checkout-summary_1107c7e2
[ { "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 checkout-summary/messages/ro.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Discounturi\",\n \"store/checkout-summary.Tax\": \"Taxe\",\n \"store/checkout-summary.Items\": \"Subtotal\",\n \"store/checkout-summary.Shipping\": \"Livrare\",\n \"store/checkout-summary.Summary\": \"Sumar\",\n \"store/checkout-summary.Total\": \"Total\",\n \"store/checkout-summary.disclaimer\": \"Costurile de transport și taxele sunt calculate la Coș.\",\n \"admin/editor.checkout-summary.label\": \"Sumar\",\n \"admin/editor.checkout-summary.title\": \"Titlu\"\n}\n\n```" } ]
code_checkout-summary_9ba0db49
[ { "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 checkout-summary/messages/ca.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Descomptes\",\n \"store/checkout-summary.Tax\": \"Impostos\",\n \"store/checkout-summary.Items\": \"Subtotal\",\n \"store/checkout-summary.Shipping\": \"Lliurament\",\n \"store/checkout-summary.Summary\": \"Resum\",\n \"store/checkout-summary.Total\": \"Total\",\n \"store/checkout-summary.disclaimer\": \"Les despeses de lliurament i els impostos es calculen al carretó.\",\n \"admin/editor.checkout-summary.label\": \"Resum\",\n \"admin/editor.checkout-summary.title\": \"Títol\"\n}\n\n```" } ]
code_checkout-summary_e0b54a85
[ { "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 checkout-summary/messages/ko.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"할인\",\n \"store/checkout-summary.Tax\": \"세금\",\n \"store/checkout-summary.Items\": \"소계\",\n \"store/checkout-summary.Shipping\": \"배달\",\n \"store/checkout-summary.Summary\": \"요약\",\n \"store/checkout-summary.Total\": \"총액\",\n \"store/checkout-summary.disclaimer\": \"장바구니에서 계산되는 배송 및 세금입니다.\",\n \"admin/editor.checkout-summary.label\": \"요약\",\n \"admin/editor.checkout-summary.title\": \"제목\"\n}\n\n```" } ]
code_checkout-summary_6c3a8fc1
[ { "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 checkout-summary/messages/cs.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Slevy\",\n \"store/checkout-summary.Tax\": \"Daně\",\n \"store/checkout-summary.Items\": \"Mezisoučet\",\n \"store/checkout-summary.Shipping\": \"Doručení\",\n \"store/checkout-summary.Summary\": \"Souhrn\",\n \"store/checkout-summary.Total\": \"Celkem\",\n \"store/checkout-summary.disclaimer\": \"Poštovné a daně vypočtené v košíku.\",\n \"admin/editor.checkout-summary.label\": \"Souhrn\",\n \"admin/editor.checkout-summary.title\": \"Název\"\n}\n\n```" } ]
code_checkout-summary_9c597404
[ { "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 checkout-summary/messages/no.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Rabatter\",\n \"store/checkout-summary.Tax\": \"Skatter\",\n \"store/checkout-summary.Items\": \"Delsum\",\n \"store/checkout-summary.Shipping\": \"Levering\",\n \"store/checkout-summary.Summary\": \"Sammendrag\",\n \"store/checkout-summary.Total\": \"Total\",\n \"store/checkout-summary.disclaimer\": \"Frakt og avgifter beregnes i handlekurven.\",\n \"admin/editor.checkout-summary.label\": \"Sammendrag\",\n \"admin/editor.checkout-summary.title\": \"Tittel\"\n}\n\n```" } ]
code_checkout-summary_f0d13f03
[ { "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 checkout-summary/messages/da.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Rabatter\",\n \"store/checkout-summary.Tax\": \"Moms\",\n \"store/checkout-summary.Items\": \"Subtotal\",\n \"store/checkout-summary.Shipping\": \"Levering\",\n \"store/checkout-summary.Summary\": \"Opsummering\",\n \"store/checkout-summary.Total\": \"I alt\",\n \"store/checkout-summary.disclaimer\": \"Forsendelse og afgifter beregnet i indkøbskurven.\",\n \"admin/editor.checkout-summary.label\": \"Opsummering\",\n \"admin/editor.checkout-summary.title\": \"Titel\"\n}\n\n```" } ]
code_checkout-summary_977cafe0
[ { "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 checkout-summary/messages/th.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"ส่วนลด\",\n \"store/checkout-summary.Tax\": \"ภาษี\",\n \"store/checkout-summary.Items\": \"ยอดรวม\",\n \"store/checkout-summary.Shipping\": \"การจัดส่ง\",\n \"store/checkout-summary.Summary\": \"ภาพรวม\",\n \"store/checkout-summary.Total\": \"รวมทั้งหมด\",\n \"store/checkout-summary.disclaimer\": \"ค่าจัดส่งและภาษีที่คำนวณได้ในรถเข็น\",\n \"admin/editor.checkout-summary.label\": \"ภาพรวม\",\n \"admin/editor.checkout-summary.title\": \"ชื่อหัวข้อ\",\n \"store/checkout-summary.installments.default\": \"นานสูงสุด {installmentsNumber}x {installmentValue}{hasInterest, select, true {, {interestRate} ของดอกเบี้ย} false { interest-free}}\",\n \"admin/editor.checkout-summary.installments.description\": \"ค่าที่มีสำหรับการประมาณค่าในช่วง: '{installmentsNumber}, {installmentValue}, {installmentsTotalValue}, {interestRate}, {hasInterest}, {paymentSystemName}'\",\n \"admin/editor.checkout-summary.installments.title\": \"การผ่อนชำระ\"\n}\n\n```" } ]
code_checkout-summary_df845b4d
[ { "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 checkout-summary/messages/sv.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Rabatter\",\n \"store/checkout-summary.Tax\": \"Skatter\",\n \"store/checkout-summary.Items\": \"Delbelopp\",\n \"store/checkout-summary.Shipping\": \"Leverans\",\n \"store/checkout-summary.Summary\": \"Summering\",\n \"store/checkout-summary.Total\": \"Totalt\",\n \"store/checkout-summary.disclaimer\": \"Frakt och moms beräknas i kundvagnen.\",\n \"admin/editor.checkout-summary.label\": \"Summering\",\n \"admin/editor.checkout-summary.title\": \"Rubrik\"\n}\n\n```" } ]
code_checkout-summary_51b9368c
[ { "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 checkout-summary/messages/nn.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Rabatter\",\n \"store/checkout-summary.Tax\": \"Skatter\",\n \"store/checkout-summary.Items\": \"Delsum\",\n \"store/checkout-summary.Shipping\": \"Levering\",\n \"store/checkout-summary.Summary\": \"Sammendrag\",\n \"store/checkout-summary.Total\": \"Total\",\n \"store/checkout-summary.disclaimer\": \"Frakt og avgifter beregnes i handlekurven.\",\n \"admin/editor.checkout-summary.label\": \"Sammendrag\",\n \"admin/editor.checkout-summary.title\": \"Tittel\"\n}\n\n```" } ]
code_checkout-summary_1dd6b994
[ { "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 checkout-summary/messages/es.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"Descuentos\",\n \"store/checkout-summary.Tax\": \"Impuestos\",\n \"store/checkout-summary.Items\": \"Subtotal\",\n \"store/checkout-summary.Shipping\": \"Entrega\",\n \"store/checkout-summary.Summary\": \"Resumen\",\n \"store/checkout-summary.Total\": \"Total\",\n \"store/checkout-summary.disclaimer\": \"Tasas y fletes calculados en el carrito\",\n \"admin/editor.checkout-summary.label\": \"Resumen\",\n \"admin/editor.checkout-summary.title\": \"Título\",\n \"store/checkout-summary.installments.default\": \"Hasta {installmentsNumber}x {installmentValue}{hasInterest, select, true {, {interestRate} de interés} false { sin interés}}\",\n \"admin/editor.checkout-summary.installments.description\": \"Valores disponibles para interpolación: '{installmentsNumber}, {installmentValue}, {installmentsTotalValue}, {interestRate}, {hasInterest}, {paymentSystemName}'\",\n \"admin/editor.checkout-summary.installments.title\": \"Cuotas\"\n}\n\n```" } ]
code_checkout-summary_63b15e0a
[ { "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 checkout-summary/messages/ar.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"store/checkout-summary.Discounts\": \"الخصم\",\n \"store/checkout-summary.Tax\": \"الضرائب\",\n \"store/checkout-summary.Items\": \"تكلفة الطلب\",\n \"store/checkout-summary.Shipping\": \"تكلفة التوصيل\",\n \"store/checkout-summary.Summary\": \"الملخص\",\n \"store/checkout-summary.Total\": \"المجموع\",\n \"store/checkout-summary.disclaimer\": \"الشحن والضرائب المحسوبة في سلة التسوق.\",\n \"admin/editor.checkout-summary.label\": \"الملخص\",\n \"admin/editor.checkout-summary.title\": \"العنوان\",\n \"store/checkout-summary.installments.default\": \"لغاية {installmentsNumber}x {installmentValue}{hasInterest, select, true {, {interestRate} من الفوائد} false { interest-free}}\",\n \"admin/editor.checkout-summary.installments.description\": \"القيم المتاحة للاستيفاء: '{installmentsNumber}, {installmentValue}, {installmentsTotalValue}, {interestRate}, {hasInterest}, {paymentSystemName}'\",\n \"admin/editor.checkout-summary.installments.title\": \"الدفعات\"\n}\n\n```" } ]
code_checkout-summary_7fc08802
[ { "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 checkout-summary/docs/README.md from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# Summary\n\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors-)\n\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n\nThe Summary block displays the order totalizers and allows the user to add coupon codes. Currently, the Summary block only works out of the box within the [Minicart](https://github.com/vtex-apps/minicart) and the [Checkout Cart](https://github.com/vtex-apps/checkout-cart).\n\n![image](https://user-images.githubusercontent.com/8902498/71037159-eb04da80-20fd-11ea-983e-ce49d2ca27c9.png)\n\nCompact version:\n\n![image](https://user-images.githubusercontent.com/8902498/71039765-b7c54a00-2103-11ea-9e38-32fc9eb174ba.png)\n\n## Configuration\n\n1. Add the Summary app to your theme's dependencies in `manifest.json`. For example:\n\n```json\n{\n \"dependencies\": {\n \"vtex.checkout-summary\": \"0.x\"\n }\n}\n```\n\n2. Add the `checkout-summary.compact` block to the `minicart-summary` block of the Minicart or the `checkout-summary` block to the `summary-wrapper` block of the Checkout Cart. For example:\n\n```json\n{\n \"minicart-summary#example\": {\n \"blocks\": [\"checkout-summary.compact\"]\n }\n}\n```\n\n### Advanced Customization\n\nThe `checkout-summary` block is made up of other smaller blocks. Currently, its default implementation is as follows:\n\n```json\n{\n \"checkout-summary\": {\n \"children\": [\"flex-layout.row#summary-coupon\", \"summary-totalizers\"]\n },\n \"flex-layout.row#summary-coupon\": {\n \"children\": [\"summary-coupon\"],\n \"props\": {\n \"marginBottom\": 6\n }\n },\n \"summary-coupon\": {\n \"blocks\": [\"coupon\"]\n }\n}\n```\n\nBy default implementation we mean that whenever you use `checkout-summary` in your store you're actually using the `json` above behind the scenes.\n\nTherefore, in order to customize the Checkout Summary configuration, you can simply use the default implementation in your code and change it as you wish.\nFor more information on which props you need to pass to the Summary component, [see below](#components).\n\nThis app exports all of the following blocks. You can see more detailed information of the\n`checkout-summary`, `checkout-summary.compact`, and `summary-totalizers` blocks in the [Components](#components) section.\n\n```jsonc\n{\n \"checkout-summary\": {\n \"props\": {\n \"title\": \"Order Summary\"\n }\n },\n \"checkout-summary.compact\": {\n \"props\": {\n \"totalizersToShow\": [\"Items\"]\n }\n },\n \"summary-totalizers\": {\n \"props\": {\n \"showTotal\": true,\n \"showDeliveryTotal\": true,\n \"showOriginalTotal\": false\n }\n },\n \"summary-coupon\": {\n // this block doesn't have any props\n },\n \"summary-installments\": {\n \"props\": {\n \"message\": \"Up to {installmentsNumber}x {installmentValue}\",\n \"markers\": []\n }\n }\n}\n```\n\nAdditionally, you can also include a [Drawer](https://vtex.io/docs/components/content-blocks/vtex.store-drawer) inside the `checkout-summary`.\n\nNotice the following: the block declared as children of the `drawer-trigger` block will appear alongside the Summary title.\n\n```jsonc\n{\n \"checkout-summary\": {\n \"blocks\": [\"drawer#my-drawer\"],\n \"children\": [\"flex-layout.row#summary-coupon\", \"summary-totalizers\"]\n },\n \"drawer#my-drawer\": {\n \"blocks\": [\"drawer-trigger#my-trigger\"]\n },\n \"drawer-trigger#my-trigger\": {\n \"children\": [\n // whatever you put inside here will\n // appear alongside the summary title\n ]\n }\n}\n```\n\n## Components\n\n### SummaryTotalizers\n\nThe component rendered when the `summary-totalizers` block is used.\n\n#### Props\n\n| Prop name | Type | Default | Description |\n| ------------------- | --------- | ------- | ------------------------------------------------------------------------------------------------ |\n| `showTotal` | `boolean` | `true` | Whether to display the overall order total |\n| `showDeliveryTotal` | `boolean` | `true` | Whether to display the shipping/delivery total |\n| `showOriginalTotal` | `boolean` | `false` | Whether to display the original items value (sum of item list prices) next to the items subtotal |\n\n### SummarySmall\n\nThe component rendered when used the `checkout-summary.compact` block.\n\n#### Props\n\n| Prop name | Type | Default |\n| ---------------------------------------------------- | -------- | ------------------- |\n| [`totalizers`](#summarysmall-totalizers) | `array` | `undefined` |\n| [`totalizersToShow`](#summarysmall-totalizersToShow) | `array` | `['Items']` |\n| [`total`](#summarysmall-total) | `number` | `undefined` |\n| [`totalCalculation`](#summarysmall-totalCalculation) | `enum` | `visibleTotalizers` |\n\n##### SummarySmall totalizers\n\n`Array<{ id: string; value: number | null; name: string }>`\n\nSame as the [Summary totalizers](#summary-totalizers) prop.\n\n##### SummarySmall total\n\nSame as the [Summary total](#summary-total) prop.\n\n##### SummarySmall totalCalculation\n\nControls how the `Total` shown in the bottom of the summary is calculated. Possible values are: `visibleTotalizers`, which means that the `Total` shown will only take into account visible totalizers (the ones included in the `totalizersToShow` array), and `allTotalizers`, which will take into account all totalizers from `orderForm`, even if they're not being displayed.\n\n##### SummarySmall totalizersToShow\n\n`string[]`\n\nId of the totalizers that should be displayed inside this component, e.g.:\n\n```js\n;[\n // Value of the subtotal\n 'Items',\n // Delivery value\n 'Shipping',\n]\n```\n\n### SummaryInstallments\n\nThe component rendered when used the `summary-installments` block. Renders the product installments. If more than one option is available, the one with the biggest number of installments will be displayed.\n\n#### Props\n\n| Prop name | Type | Description | Default value |\n| ------------ | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |\n| `markers` | `[string]` | IDs of your choosing to identify the block's rendered message and customize it using the admin's Site Editor. Learn how to use them accessing the documentation on [Using the Markers prop to customize a block's message](https://vtex.io/docs/recipes/style/using-the-markers-prop-to-customize-a-blocks-message). Notice the following: a block's message can also be customized in the Store Theme source code using the `message` prop. | `[]` |\n| `blockClass` | `string` | Block ID of your choosing to be used in [CSS customization](https://vtex.io/docs/recipes/style/using-css-handles-for-store-customization#using-the-blockclass-property). | `undefined` |\n| `message` | `string` | Defines the block's default text i.e. the block message. You can also define which text message a block will render on the UI using the admin's Site Editor. | `undefined` |\n\n#### Message variables\n\n| Message variables | Type | Description |\n| ------------------------ | --------- | ----------------------------------------------------------------- |\n| `installmentsNumber` | `string` | Number of installments. |\n| `installmentValue` | `string` | Value of each installment. |\n| `installmentsTotalValue` | `string` | Total value of installments. |\n| `interestRate` | `string` | Interest rate. |\n| `paymentSystemName` | `string` | Payment System of the installments. |\n| `hasInterest` | `boolean` | Whether the installments have interest (`true`) or not (`false`). |\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| `installments` |\n| `installmentsNumber` |\n| `installmentValue` |\n| `installmentsTotalValue` |\n| `interestRate` |\n| `paymentSystemName` |\n| `summaryTitle` |\n| `summaryContent` |\n| `summarySmallContent` |\n| `summarySmallDisclaimer` |\n| `summaryItemContainer` |\n| `summaryItemLabel` |\n| `summaryItemPrice` |\n| `summaryItemOriginalPrice` |\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<!-- 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```" } ]
code_checkout-summary_a8e7d13e
[ { "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 checkout-summary/react/SummaryContext.tsx from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React, { createContext, useContext, PropsWithChildren } from 'react'\n\nimport { SummaryProps } from './Summary'\n\nconst SummaryContext = createContext<SummaryProps | undefined>(undefined)\n\nexport function useSummary() {\n const context = useContext(SummaryContext)\n\n if (context === undefined) {\n throw new Error('useSummary must be used within a SummaryProvider')\n }\n\n return context\n}\n\nfunction SummaryContextProvider({\n coupon,\n insertCoupon,\n loading,\n totalizers,\n total,\n originalTotal,\n children,\n paymentData,\n}: PropsWithChildren<SummaryProps>) {\n return (\n <SummaryContext.Provider\n value={{\n coupon,\n insertCoupon,\n loading,\n totalizers,\n total,\n originalTotal,\n paymentData,\n }}\n >\n {children}\n </SummaryContext.Provider>\n )\n}\n\nexport default SummaryContextProvider\n\n```" } ]
code_checkout-summary_599cb8d2
[ { "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 checkout-summary/react/SummarySmall.tsx from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React, { PropsWithChildren } from 'react'\nimport { FormattedMessage } from 'react-intl'\nimport { useCssHandles } from 'vtex.css-handles'\nimport { PaymentData } from 'vtex.checkout-graphql'\n\nimport { Totalizer } from './modules/types'\nimport SummaryContextProvider from './SummaryContext'\n\ninterface Props {\n totalizers: Totalizer[]\n total: number\n originalTotal?: number\n totalizersToShow?: string[]\n totalCalculation?: 'visibleTotalizers' | 'allTotalizers'\n paymentData: PaymentData\n}\n\nconst CSS_HANDLES = ['summarySmallContent', 'summarySmallDisclaimer'] as const\n\nfunction SummarySmall({\n total,\n originalTotal = 0,\n children,\n totalizers,\n totalizersToShow = ['Items'],\n totalCalculation = 'visibleTotalizers',\n paymentData,\n}: PropsWithChildren<Props>) {\n const handles = useCssHandles(CSS_HANDLES)\n\n const filteredTotalizers = totalizers.filter((totalizer) =>\n totalizersToShow.includes(totalizer.id)\n )\n\n const totalToDisplay =\n totalCalculation === 'visibleTotalizers'\n ? filteredTotalizers.reduce((acc, totalizer) => {\n return (acc += totalizer.value ?? 0)\n }, 0)\n : total\n\n const shouldDisplayShippingDisclaimer = !totalizersToShow.includes('Shipping')\n\n return (\n <SummaryContextProvider\n totalizers={filteredTotalizers}\n total={totalToDisplay}\n originalTotal={originalTotal}\n paymentData={paymentData}\n >\n <div className={`${handles.summarySmallContent} c-on-base`}>\n {children}\n </div>\n {shouldDisplayShippingDisclaimer && (\n <span className={`${handles.summarySmallDisclaimer} t-small db mv4`}>\n <FormattedMessage id=\"store/checkout-summary.disclaimer\" />\n </span>\n )}\n </SummaryContextProvider>\n )\n}\n\nexport default SummarySmall\n\n```" } ]
code_checkout-summary_279a8883
[ { "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 checkout-summary/react/SummaryTotalizers.tsx from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React, { Fragment } from 'react'\nimport { Loading } from 'vtex.render-runtime'\n\nimport SummaryItem from './components/SummaryItem'\nimport { Totalizer } from './modules/types'\nimport { useSummary } from './SummaryContext'\n\nconst minTotalizerValue = 0\nconst tba = null\nconst shippingData = {\n id: 'Shipping',\n name: '',\n value: tba,\n __typename: 'Totalizer',\n}\n\nconst isShippingPresent = (totalizers: Totalizer[]) => {\n return totalizers.some((t) => t.id === 'Shipping')\n}\n\ninterface Props {\n showTotal?: boolean\n showDeliveryTotal?: boolean\n showOriginalTotal?: boolean\n}\n\nfunction SummaryTotalizers({\n showTotal = true,\n showDeliveryTotal = true,\n showOriginalTotal = false,\n}: Props) {\n const { loading, totalizers, total, originalTotal } = useSummary()\n\n if (loading) {\n return <Loading />\n }\n\n if (!isShippingPresent(totalizers) && showDeliveryTotal) {\n totalizers.push(shippingData)\n }\n\n const orderHasNoValue = totalizers.length === 0\n\n return (\n <Fragment>\n {totalizers.map((totalizer) => (\n <SummaryItem\n key={totalizer.id}\n label={totalizer.id}\n name={totalizer.id === 'CustomTax' ? totalizer.name : ''}\n value={totalizer.value}\n originalValue={showOriginalTotal ? originalTotal : 0}\n large={false}\n />\n ))}\n\n {showTotal && (\n <SummaryItem\n label=\"Total\"\n value={orderHasNoValue ? null : total || minTotalizerValue}\n large\n />\n )}\n </Fragment>\n )\n}\n\nexport default SummaryTotalizers\n\n```" } ]
code_checkout-summary_e0be6d67
[ { "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 checkout-summary/react/package.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"scripts\": {\n \"test\": \"vtex-test-tools test\"\n },\n \"dependencies\": {\n \"@vtex/css-handles\": \"^1.0.0\",\n \"classnames\": \"^2.2.6\",\n \"ramda\": \"^0.26.1\",\n \"react\": \"^16.8.3\",\n \"react-dom\": \"^16.8.3\",\n \"react-intl\": \"3\"\n },\n \"devDependencies\": {\n \"@apollo/react-testing\": \"3\",\n \"@types/classnames\": \"^2.2.7\",\n \"@types/graphql\": \"^14.2.0\",\n \"@types/jest\": \"^25.1.4\",\n \"@types/node\": \"^13.9.8\",\n \"@types/prop-types\": \"^15.7.0\",\n \"@types/ramda\": \"^0.26.5\",\n \"@types/react\": \"^16.9.31\",\n \"@types/react-intl\": \"^2.3.17\",\n \"@vtex/test-tools\": \"^3.3.2\",\n \"@vtex/tsconfig\": \"^0.4.4\",\n \"apollo-cache-inmemory\": \"^1.6.5\",\n \"apollo-client\": \"^2.5.1\",\n \"graphql\": \"^14.6.0\",\n \"typescript\": \"3.9.7\",\n \"vtex.checkout-graphql\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.checkout-graphql@0.56.1/public/@types/vtex.checkout-graphql\",\n \"vtex.coupon\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.coupon@0.10.3/public/@types/vtex.coupon\",\n \"vtex.css-handles\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.css-handles@0.4.4/public/@types/vtex.css-handles\",\n \"vtex.flex-layout\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.flex-layout@0.15.2/public/@types/vtex.flex-layout\",\n \"vtex.format-currency\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.format-currency@0.3.0/public/@types/vtex.format-currency\",\n \"vtex.formatted-price\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.formatted-price@0.4.0/public/@types/vtex.formatted-price\",\n \"vtex.order-coupon\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.order-coupon@0.7.1/public/@types/vtex.order-coupon\",\n \"vtex.render-runtime\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.render-runtime@8.126.11/public/@types/vtex.render-runtime\",\n \"vtex.store-drawer\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.store-drawer@0.15.0/public/@types/vtex.store-drawer\",\n \"vtex.styleguide\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.135.3/public/@types/vtex.styleguide\"\n },\n \"version\": \"0.23.0\"\n}\n\n```" } ]
code_checkout-summary_0e374ebe
[ { "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 checkout-summary/react/SummaryCoupon.tsx from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { ExtensionPoint, Loading } from 'vtex.render-runtime'\nimport { OrderCoupon } from 'vtex.order-coupon'\n\nimport { useSummary } from './SummaryContext'\n\nfunction SummaryCoupon() {\n const { coupon, insertCoupon, loading } = useSummary()\n\n if (loading) {\n return <Loading />\n }\n\n return (\n <OrderCoupon.OrderCouponProvider>\n <ExtensionPoint id=\"coupon\" coupon={coupon} insertCoupon={insertCoupon} />\n </OrderCoupon.OrderCouponProvider>\n )\n}\n\nexport default SummaryCoupon\n\n```" } ]
code_checkout-summary_372acede
[ { "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 checkout-summary/react/SummaryInstallments.tsx from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { defineMessages, FormattedNumber } from 'react-intl'\nimport { InstallmentOption } from 'vtex.checkout-graphql'\nimport { useCssHandles } from 'vtex.css-handles'\nimport { FormattedCurrency } from 'vtex.format-currency'\nimport { IOMessageWithMarkers } from 'vtex.native-types'\nimport { Loading } from 'vtex.render-runtime'\n\nimport { useSummary } from './SummaryContext'\n\nconst CSS_HANDLES = [\n 'installments',\n 'installmentsNumber',\n 'installmentValue',\n 'installmentsTotalValue',\n 'interestRate',\n 'paymentSystemName',\n] as const\n\ninterface SummaryInstallmentsProps {\n message: string\n markers: string[]\n}\n\nfunction SummaryInstallments(props: SummaryInstallmentsProps) {\n const { loading, paymentData } = useSummary()\n const { message, markers } = props\n const handles = useCssHandles(CSS_HANDLES)\n\n const { installmentOptions, paymentSystems } = paymentData\n\n if (loading) {\n return <Loading />\n }\n\n if (!installmentOptions) {\n return null\n }\n\n let maxInstallments: InstallmentOption | undefined\n\n installmentOptions.forEach((installmentOption) => {\n const currentValueIsEmpty =\n !maxInstallments || Object.keys(maxInstallments).length === 0\n\n if (\n currentValueIsEmpty ||\n installmentOption.installments.length >\n (maxInstallments?.installments.length ?? 0)\n ) {\n maxInstallments = installmentOption\n }\n })\n\n const maxInstallment: any =\n maxInstallments?.installments[maxInstallments?.installments.length - 1]\n\n const paymentSystemName = paymentSystems.filter(\n (paymentSystem) => paymentSystem.id === maxInstallments?.paymentSystem\n )\n\n const { count, value, total, interestRate, hasInterestRate } = maxInstallment\n\n return (\n <span className={handles.installments}>\n <IOMessageWithMarkers\n message={message}\n markers={markers}\n handleBase=\"installments\"\n values={{\n installmentsNumber: (\n <span\n key=\"installmentsNumber\"\n className={handles.installmentsNumber}\n >\n {count && <FormattedNumber value={count} />}\n </span>\n ),\n installmentValue: (\n <span key=\"installmentValue\" className={handles.installmentValue}>\n {value && <FormattedCurrency value={value / 100} />}\n </span>\n ),\n installmentsTotalValue: (\n <span\n key=\"installmentsTotalValue\"\n className={handles.installmentsTotalValue}\n >\n {total && <FormattedCurrency value={total / 100} />}\n </span>\n ),\n interestRate: (\n <span key=\"interestRate\" className={handles.interestRate}>\n {interestRate && (\n <FormattedNumber value={interestRate} style=\"percent\" />\n )}\n </span>\n ),\n paymentSystemName: (\n <span key=\"paymentSystemName\" className={handles.paymentSystemName}>\n {paymentSystemName[0]?.name}\n </span>\n ),\n hasInterest: hasInterestRate,\n }}\n />\n </span>\n )\n}\n\nconst messages = defineMessages({\n title: {\n id: 'admin/editor.checkout-summary.installments.title',\n },\n description: {\n id: 'admin/editor.checkout-summary.installments.description',\n },\n default: {\n id: 'store/checkout-summary.installments.default',\n },\n})\n\nSummaryInstallments.schema = {\n title: messages.title.id,\n}\n\nexport default SummaryInstallments\n\n```" } ]
code_checkout-summary_f47a4fd2
[ { "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 checkout-summary/react/SummarySmall.test.tsx from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { render } from '@vtex/test-tools/react'\n\nimport SummarySmall from './SummarySmall'\n\nconst totalizers = [\n {\n id: 'Items',\n name: 'Total dos Itens',\n value: 32999,\n },\n]\n\ntest('should render shipping disclaimer if shipping totalizer is not shown', () => {\n const { queryByText } = render(\n <SummarySmall total={32999} totalizers={totalizers} />\n )\n\n const disclaimer = queryByText('Shipping and taxes calculated in the Cart.')\n\n expect(disclaimer).toBeInTheDocument()\n})\n\ntest('should not render shipping disclaimer if shipping totalizer is shown', () => {\n const { queryByText } = render(\n <SummarySmall\n total={32999}\n totalizers={totalizers}\n totalizersToShow={['Shipping']}\n />\n )\n\n const disclaimer = queryByText('Shipping and taxes calculated at the Cart.')\n\n expect(disclaimer).not.toBeInTheDocument()\n})\n\n```" } ]
code_checkout-summary_f27a501f
[ { "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 checkout-summary/react/Summary.tsx from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React, { PropsWithChildren } from 'react'\nimport { defineMessages, FormattedMessage } from 'react-intl'\nimport { useCssHandles } from 'vtex.css-handles'\nimport { ExtensionPoint } from 'vtex.render-runtime'\nimport { PaymentData } from 'vtex.checkout-graphql'\n\nimport { Totalizer } from './modules/types'\nimport SummaryContextProvider from './SummaryContext'\n\nconst messages = defineMessages({\n label: {\n id: 'admin/editor.checkout-summary.label',\n },\n title: {\n id: 'store/checkout-summary.Summary',\n },\n})\n\nconst CSS_HANDLES = ['summaryTitle', 'summaryContent'] as const\n\ninterface InsertCouponResult {\n success: boolean\n errorKey: string\n}\n\ninterface SiteEditorSummaryProps {\n title: string\n}\n\nexport interface SummaryProps {\n coupon?: string\n insertCoupon?: (coupon: string) => Promise<InsertCouponResult>\n loading?: boolean\n totalizers: Totalizer[]\n paymentData: PaymentData\n total: number\n originalTotal?: number\n}\n\ntype Props = PropsWithChildren<SummaryProps & SiteEditorSummaryProps>\n\nfunction Summary({\n children,\n loading,\n totalizers,\n total,\n originalTotal = 0,\n coupon,\n insertCoupon,\n title,\n paymentData,\n}: Props) {\n const handles = useCssHandles(CSS_HANDLES)\n\n return (\n <SummaryContextProvider\n coupon={coupon}\n insertCoupon={insertCoupon}\n loading={loading}\n totalizers={totalizers}\n total={total}\n originalTotal={originalTotal}\n paymentData={paymentData}\n >\n {/* Removing the div below may break the layout. See PR #25 */}\n <div>\n <h5\n className={`${handles.summaryTitle} t-heading-5 mt0 mb5 flex justify-between items-center`}\n >\n <FormattedMessage id={title} />\n <ExtensionPoint id=\"drawer\" />\n </h5>\n <div className={`${handles.summaryContent} c-on-base`}>{children}</div>\n </div>\n </SummaryContextProvider>\n )\n}\n\nSummary.schema = {\n title: messages.label.id,\n}\n\nexport default Summary\n\n```" } ]
code_checkout-summary_129cb397
[ { "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 checkout-summary/store/contentSchemas.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"definitions\": {\n \"Summary\": {\n \"properties\": {\n \"title\": {\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"default\": \"store/checkout-summary.Summary\"\n }\n }\n },\n \"SummaryInstallments\": {\n \"type\": \"object\",\n \"properties\": {\n \"message\": {\n \"title\": \"admin/editor.checkout-summary.installments.title\",\n \"description\": \"admin/editor.checkout-summary.installments.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"default\": \"store/checkout-summary.installments.default\"\n }\n }\n }\n }\n}\n\n```" } ]
code_checkout-summary_b8bb9018
[ { "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 checkout-summary/store/blocks.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"checkout-summary\": {\n \"children\": [\"flex-layout.row#summary-coupon\", \"summary-totalizers\"]\n },\n\n \"flex-layout.row#summary-coupon\": {\n \"children\": [\"summary-coupon\"],\n \"props\": {\n \"marginBottom\": 6\n }\n },\n\n \"summary-coupon\": {\n \"blocks\": [\"coupon\"]\n }\n}\n\n```" } ]
code_checkout-summary_a9bdf73b
[ { "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 checkout-summary/store/interfaces.json from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"checkout-summary\": {\n \"component\": \"Summary\",\n \"allowed\": [\n \"drawer\"\n ],\n \"composition\": \"children\",\n \"content\": {\n \"$ref\": \"#/definitions/Summary\"\n }\n },\n \"checkout-summary.compact\": {\n \"component\": \"SummarySmall\",\n \"allowed\": [\n \"summary-totalizers\"\n ],\n \"composition\": \"children\"\n },\n \"summary-coupon\": {\n \"component\": \"SummaryCoupon\",\n \"allowed\": [\n \"coupon\"\n ],\n \"preview\": {\n \"type\": \"box\",\n \"height\": 32,\n \"width\": 240,\n \"options\": {\n \"padding\": 0\n }\n }\n },\n \"summary-totalizers\": {\n \"component\": \"SummaryTotalizers\",\n \"preview\": {\n \"type\": \"text\",\n \"height\": 108,\n \"fullWidth\": true,\n \"options\": {\n \"padding\": 0,\n \"fontSize\": 24,\n \"paragraph\": false\n }\n }\n },\n \"summary-installments\": {\n \"component\": \"SummaryInstallments\",\n \"content\": {\n \"$ref\": \"app:vtex.checkout-summary#/definitions/SummaryInstallments\"\n }\n }\n}\n```" } ]
code_checkout-summary_89c6e732
[ { "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 checkout-summary/react/typings/css.d.ts from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module '*.css' {\n const css: any\n export default css\n}\n\n```" } ]
code_checkout-summary_e6cab9ec
[ { "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 checkout-summary/react/typings/graphql.d.ts from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module '*.graphql' {\n import { DocumentNode } from 'graphql'\n\n const value: DocumentNode\n export default value\n}\n\n```" } ]
code_checkout-summary_a239b251
[ { "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 checkout-summary/react/typings/vtex.styleguide.d.ts from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\ndeclare module 'vtex.styleguide' {\n import { ComponentType } from 'react'\n\n export const Input: ComponentType<InputProps>\n\n interface InputProps {\n [key: string]: any\n }\n}\n\n```" } ]
code_checkout-summary_2a198683
[ { "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 checkout-summary/react/components/SummaryItem.tsx from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { defineMessages, FormattedMessage } from 'react-intl'\nimport { FormattedPrice } from 'vtex.formatted-price'\nimport { useCssHandles } from 'vtex.css-handles'\n\nimport { slugify } from '../modules/slugify'\n\ndefineMessages({\n Shipping: {\n id: 'store/checkout-summary.Shipping',\n defaultMessage: 'Delivery',\n },\n Items: {\n id: 'store/checkout-summary.Items',\n defaultMessage: 'Subtotal',\n },\n Total: {\n id: 'store/checkout-summary.Total',\n defaultMessage: 'Total',\n },\n Discounts: {\n id: 'store/checkout-summary.Discounts',\n defaultMessage: 'Discounts',\n },\n Tax: {\n id: 'store/checkout-summary.Tax',\n defaultMessage: 'Taxes',\n },\n})\n\ninterface Props {\n label: string\n name?: string\n large: boolean\n value: number | null\n originalValue?: number\n}\n\nconst CSS_HANDLES = [\n 'summaryItemContainer',\n 'summaryItemLabel',\n 'summaryItemPrice',\n 'summaryItemOriginalPrice',\n] as const\n\nfunction SummaryItem({ label, name, large, value, originalValue = 0 }: Props) {\n const handles = useCssHandles(CSS_HANDLES)\n const itemId = slugify(label)\n\n return (\n <div\n className={`flex w-100 c-on-base lh-copy items-center ${\n handles.summaryItemContainer\n } ${large ? 'f4 mt4 pb5' : 'mt3'}`}\n >\n <div\n id={itemId}\n className={`${handles.summaryItemLabel} flex-none fw6 fw5-l`}\n >\n {name ||\n (label && (\n <FormattedMessage id={`store/checkout-summary.${label}`} />\n ))}\n </div>\n {itemId === 'items' && value && originalValue > value && (\n <div\n id=\"original-items-price\"\n className={`flex-auto tr c-danger strike ${\n handles.summaryItemOriginalPrice\n } ${large ? 'fw6 fw5-l' : ''}`}\n >\n <FormattedPrice value={originalValue / 100} />\n </div>\n )}\n <div\n id={`${itemId}-price`}\n className={`flex-auto tr ${handles.summaryItemPrice} ${\n large ? 'fw6 fw5-l' : ''\n }`}\n >\n <FormattedPrice value={value ? value / 100 : value} />\n </div>\n </div>\n )\n}\n\nexport default SummaryItem\n\n```" } ]
code_checkout-summary_670ad5a7
[ { "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 checkout-summary/react/modules/types.ts from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport interface Totalizer {\n id: string\n value: number | null\n name: string\n}\n\n```" } ]
code_checkout-summary_6e130a51
[ { "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 checkout-summary/react/modules/slugify.ts from the checkout-summary VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nexport const slugify = (text: string) => {\n return text.toLowerCase().replace(/\\s+/g, '-')\n}\n\n```" } ]
code_salesforce-connector_1b1e2e75
[ { "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 salesforce-connector/messages/en.json from the salesforce-connector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"admin-salesforce-settings.keywords\": \"settings, app, salesforce\",\n \"admin-salesforce-settings.label-group\": \"Salesforce Settings\",\n \"admin-salesforce-settings.title\": \"Salesforce Settings\"\n}\n\n```" } ]
code_salesforce-connector_1d866e68
[ { "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 salesforce-connector/admin/navigation.json from the salesforce-connector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"section\": \"accountSettings\",\n \"titleId\": \"admin-salesforce-settings.label-group\",\n \"subSection\": \"Salesforce Settings\",\n \"searchKeyWordsHelpers\": \"admin-salesforce-settings.keywords\",\n \"subSectionItems\": [\n {\n \"labelId\": \"admin-salesforce-settings.label-group\",\n \"path\": \"/admin/salesforce-settings\"\n }\n ]\n}\n\n```" } ]
code_salesforce-connector_9b368fb0
[ { "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 salesforce-connector/admin/routes.json from the salesforce-connector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"admin.app.frontbasecomponent\": {\n \"path\": \"/admin/app/salesforce-settings\",\n \"component\": \"SalesforceSettings\"\n }\n}\n\n```" } ]
code_salesforce-connector_3a963f32
[ { "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 salesforce-connector/docs/README.md from the salesforce-connector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```markdown\n# Salesforce Connector\n\n## Objective\n\nThe purpose of this document is to detail the implementation of the middleware responsible of connect VTEX with the Salesforce services. You can:\n\n- Create or update client in Salesforce from VTEX\n- Create order in Salesforce from VTEX\n- Create products in Salesforce from VTEX\n- Manage order states\n- Create opportunity in Salesforce for abandoned cart\n\n## Recipes\n\n### Defining routes on _service.json_ \n```json\n{\n \"memory\": 256,\n \"ttl\": 10,\n \"timeout\": 2,\n \"minReplicas\": 2,\n \"maxReplicas\": 4,\n \"workers\": 1,\n \"routes\": {\n \"UpdateClientHook\": {\n \"path\": \"/v1/vtex/clients\",\n \"public\": true\n },\n \"AbandonedCartHook\": {\n \"path\": \"/v1/vtex/abandoned-cart\",\n \"public\": true\n },\n \"AddCredentialsHook\": {\n \"path\": \"/v1/vtex/add-credentials\",\n \"public\": true\n },\n \"ConfigurationHook\": {\n \"path\": \"/v1/vtex/configuration\",\n \"public\": true\n },\n \"GetParametersHook\": {\n \"path\": \"/v1/vtex/get-parameters\",\n \"public\": true\n },\n \"GetConfigurationHook\": {\n \"path\": \"/v1/vtex/get-configuration\",\n \"public\": true\n }\n },\n \"events\": {\n \"orderState\": {\n \"sender\": \"vtex.orders-broadcast\",\n \"topics\": [\n \"payment-approved\",\n \"canceled\",\n \"ready-for-handling\",\n \"handling\",\n \"invoiced\"\n ]\n }\n }\n}\n```\n\nThe `service.json` file that sits on the root of the `node` folder holds informations about this services.\n\nFor cach _key_ on the `routes` object, there should be a **corresponding entry** on the exported Service object on `node/index.ts`, this will hook your code to a specific route.\n\n### Access Control\nYou can also provide a `public` option for each route. If `true`, that resource will be reachable for everyone on the internet. If `false`, VTEX credentials will be requested as well.\n\n#### HTTP methods\nWhen you define a route on the `service.json`, your NodeJS handlers for that route will be triggered **on every HTTP method** (GET, POST, PUT...), so, if you need to handle them separately you need to implement a \"sub-router\". Fortunately, the _node-vtex-api_ provides a helper function `method`, exported from `@vtex/api`, to accomplish that behaviour. Instead of passing your handlers directly to the corresponding route on `index.ts`, you pass a `method` call passing **an object with the desired method as key and one handler as its corresponding value**. Check this example:\n```typescript\nimport type {\n ClientsConfig,\n ServiceContext,\n RecorderState,\n EventContext,\n IOContext,\n} from '@vtex/api'\nimport { method, LRUCache, Service } from '@vtex/api'\nimport * as dotenv from 'dotenv'\n\nimport { Clients } from './clients'\nimport { orderState } from './middlewares/orderState'\nimport { updateClientHook } from './middlewares/UpdateClientHook'\nimport { abandonedCartHook } from './middlewares/AbandonedCartHook'\nimport { configurationHook } from './middlewares/configurationHook'\nimport { addCredentialsHook } from './middlewares/addCredentialsHook'\nimport { getParametersHook } from './middlewares/getParametersHook'\nimport { getConfigurationHook } from './middlewares/getConfigurationHook'\n\ndotenv.config()\n\nconst TIMEOUT_MS = 800\n\nconst memoryCache = new LRUCache<string, any>({ max: 5000 })\n\nmetrics.trackCache('status', memoryCache)\n\nconst clients: ClientsConfig<Clients> = {\n implementation: Clients,\n options: {\n default: {\n retries: 2,\n timeout: TIMEOUT_MS,\n },\n status: {\n memoryCache,\n },\n },\n}\n\ndeclare global {\n type Context = ServiceContext<Clients, State>\n\n interface StatusChangeContext extends EventContext<Clients> {\n vtex: IOContext\n body: {\n domain: string\n orderId: string\n currentState: string\n lastState: string\n currentChangeDate: string\n lastChangeDate: string\n }\n }\n\n interface State extends RecorderState {\n code: number\n }\n}\n\nexport default new Service({\n clients,\n events: {\n orderState,\n },\n routes: {\n UpdateClientHook: method({\n POST: [updateClientHook],\n }),\n AbandonedCartHook: method({\n POST: [abandonedCartHook],\n }),\n AddCredentialsHook: method({\n POST: [addCredentialsHook],\n }),\n ConfigurationHook: method({\n POST: [configurationHook],\n }),\n GetParametersHook: method({\n GET: [getParametersHook],\n }),\n GetConfigurationHook: method({\n GET: [getConfigurationHook],\n }),\n },\n})\n```\n\n### Reading a JSON body\n\nWhen writing POST or PUT handlers, for example, often you need to have access to the **request body** that comes as a JSON format, which is not provided directly by the handler function.\n\nFor this, you have to use the [co-body](https://www.npmjs.com/package/co-body) package that will parse the request into a readable JSON object, used as below: \n```typescript\nimport { json } from 'co-body'\nexport async function method(ctx: Context, next: () => Promise<any>) {\n const body = await json(ctx.req)\n```\n\n## Testing\n\n`@vtex/test-tools` and `@types/jest` should be installed on `./node` package as `devDependencies`.\n\nRun `vtex test` and [Jest](https://jestjs.io/) will do its thing.\n\nCheck the `node/__tests__/\n\n## Configure\n\n### App Setup\n\nTo configure the Salesforce connector you must do the following:\n\n![Alt text](salesforce-settings.png)\n\n1. Salesforce credentials must be added\n\n2. Salesforce configurations must be created\n\n```" } ]
code_salesforce-connector_8ff8fbe3
[ { "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 salesforce-connector/node/service.json from the salesforce-connector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"memory\": 256,\n \"ttl\": 10,\n \"timeout\": 2,\n \"minReplicas\": 2,\n \"maxReplicas\": 4,\n \"workers\": 1,\n \"routes\": {\n \"UpdateClientHook\": {\n \"path\": \"/v1/vtex/clients\",\n \"public\": true\n },\n \"AbandonedCartHook\": {\n \"path\": \"/v1/vtex/abandoned-cart\",\n \"public\": true\n },\n \"AddCredentialsHook\": {\n \"path\": \"/v1/vtex/add-credentials\",\n \"public\": true\n },\n \"ConfigurationHook\": {\n \"path\": \"/v1/vtex/configuration\",\n \"public\": true\n },\n \"GetParametersHook\": {\n \"path\": \"/v1/vtex/get-parameters\",\n \"public\": true\n },\n \"GetConfigurationHook\": {\n \"path\": \"/v1/vtex/get-configuration\",\n \"public\": true\n }\n },\n \"events\": {\n \"orderState\": {\n \"sender\": \"vtex.orders-broadcast\",\n \"topics\": [\n \"payment-approved\",\n \"canceled\",\n \"ready-for-handling\",\n \"handling\",\n \"invoiced\"\n ]\n }\n }\n}\n\n```" } ]
code_salesforce-connector_f5832956
[ { "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 salesforce-connector/node/package.json from the salesforce-connector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"dependencies\": {\n \"axios\": \"~0.24.0\",\n \"co-body\": \"^6.0.0\",\n \"dotenv\": \"^16.0.3\",\n \"jsforce\": \"^1.11.1\",\n \"nforce\": \"^1.12.2\",\n \"ramda\": \"^0.25.0\"\n },\n \"devDependencies\": {\n \"@types/co-body\": \"^0.0.3\",\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^12.0.0\",\n \"@types/ramda\": \"types/npm-ramda#dist\",\n \"@vtex/api\": \"6.46.0\",\n \"@vtex/test-tools\": \"^1.0.0\",\n \"@vtex/tsconfig\": \"^0.5.6\",\n \"jest\": \"^29.6.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"typescript\": \"3.9.7\",\n \"vtex.styleguide\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.146.9/public/@types/vtex.styleguide\"\n },\n \"resolutions\": {\n \"@types/testing-library__dom\": \"6.12.1\",\n \"@types/express\": \"4.16.0\",\n \"@types/express-serve-static-core\": \"4.16.0\"\n },\n \"scripts\": {\n \"lint\": \"tsc --noEmit --pretty\",\n \"test\": \"jest\"\n },\n \"version\": \"2.0.6\"\n}\n\n```" } ]
code_salesforce-connector_30896a12
[ { "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 salesforce-connector/node/index.ts from the salesforce-connector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```typescript\nimport type {\n ClientsConfig,\n ServiceContext,\n RecorderState,\n EventContext,\n IOContext,\n} from '@vtex/api'\nimport { method, LRUCache, Service } from '@vtex/api'\nimport * as dotenv from 'dotenv'\n\nimport { Clients } from './clients'\nimport { orderState } from './middlewares/orderState'\nimport { updateClientHook } from './middlewares/UpdateClientHook'\nimport { abandonedCartHook } from './middlewares/AbandonedCartHook'\nimport { configurationHook } from './middlewares/configurationHook'\nimport { addCredentialsHook } from './middlewares/addCredentialsHook'\nimport { getParametersHook } from './middlewares/getParametersHook'\nimport { getConfigurationHook } from './middlewares/getConfigurationHook'\n\ndotenv.config()\n\nconst TIMEOUT_MS = 800\n\nconst memoryCache = new LRUCache<string, any>({ max: 5000 })\n\nmetrics.trackCache('status', memoryCache)\n\nconst clients: ClientsConfig<Clients> = {\n implementation: Clients,\n options: {\n default: {\n retries: 2,\n timeout: TIMEOUT_MS,\n },\n status: {\n memoryCache,\n },\n },\n}\n\ndeclare global {\n type Context = ServiceContext<Clients, State>\n\n interface StatusChangeContext extends EventContext<Clients> {\n vtex: IOContext\n body: {\n domain: string\n orderId: string\n currentState: string\n lastState: string\n currentChangeDate: string\n lastChangeDate: string\n }\n }\n\n interface State extends RecorderState {\n code: number\n }\n}\n\nexport default new Service({\n clients,\n events: {\n orderState,\n },\n routes: {\n UpdateClientHook: method({\n POST: [updateClientHook],\n }),\n AbandonedCartHook: method({\n POST: [abandonedCartHook],\n }),\n AddCredentialsHook: method({\n POST: [addCredentialsHook],\n }),\n ConfigurationHook: method({\n POST: [configurationHook],\n }),\n GetParametersHook: method({\n GET: [getParametersHook],\n }),\n GetConfigurationHook: method({\n GET: [getConfigurationHook],\n }),\n },\n})\n\n```" } ]
code_salesforce-connector_db7c7b3d
[ { "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 salesforce-connector/react/package.json from the salesforce-connector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"name\": \"vtex.admin-example\",\n \"version\": \"2.0.6\",\n \"devDependencies\": {\n \"@types/node\": \"^11.12.1\",\n \"@types/react\": \"^16.8.10\",\n \"@types/react-intl\": \"^2.3.17\",\n \"@vtex/tsconfig\": \"^0.4.4\",\n \"apollo-client\": \"^2.4.7\",\n \"graphql\": \"^14.0.2\",\n \"prop-types\": \"^15.7.2\",\n \"react\": \"^16.8.6\",\n \"react-dom\": \"^16.8.6\",\n \"react-intl\": \"^2.7.2\",\n \"typescript\": \"3.9.7\",\n \"vtex.render-runtime\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.render-runtime@8.134.2/public/@types/vtex.render-runtime\",\n \"vtex.styleguide\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.146.9/public/@types/vtex.styleguide\"\n },\n \"dependencies\": {\n \"@types/faker\": \"^4.1.5\",\n \"faker\": \"^4.1.0\",\n \"axios\": \"^0.24.0\"\n }\n}\n\n```" } ]
code_salesforce-connector_2feadf3b
[ { "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 salesforce-connector/react/styles.global.css from the salesforce-connector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```css\nhtml,\nbody,\n#render-container,\n#render-provider,\n.render-container,\n.render-provider {\n height: 100%;\n}\n\n```" } ]
code_salesforce-connector_edf5b73b
[ { "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 salesforce-connector/react/SalesforceSettings.tsx from the salesforce-connector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { FormattedMessage } from 'react-intl'\nimport { Layout, PageHeader, PageBlock } from 'vtex.styleguide'\n\nimport './styles.global.css'\nimport SalesforceSettingsComponent from './components/settings/SalesforceSettingsComponent'\n\nconst ApplicationSettings = () => {\n return (\n <Layout fullWidth={true}\n pageHeader={\n <PageHeader\n title={<FormattedMessage id=\"admin-salesforce-settings.title\" />}\n />\n }\n >\n <PageBlock variation=\"full\">\n <SalesforceSettingsComponent></SalesforceSettingsComponent>\n </PageBlock>\n </Layout>\n )\n}\n\nexport default ApplicationSettings\n\n```" } ]
code_salesforce-connector_c0441be9
[ { "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 salesforce-connector/public/metadata/messages/es-AR.json from the salesforce-connector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"name\": \"SalesForce Connector\",\n \"headline\": \"Conector entre VTEX y Salesforce\",\n \"overview\": \"Este conector (aplicación ) permitirá integrar el portal ecommerce Vtex con el CRM Salesforce, el cual por medio de configuración de credenciales de Salesforce y configuración del Hook de órdenes de la plataforma ecommerce, para así proceder a realizar una creación o actualización de clientes o direcciones en Salesforce, adicionando las direcciones nuevas añadidas por el cliente y asociandolas al listado correspondiente en el CRM\",\n \"features\": [\n \"El aplicativo se debe alojar en la infraestructura del VTEX\",\n \"El aplicativo consumirá la información del CRM por medio de la capa de servicio expuesta por este, utilizando como forma de autenticación un api token, configurable desde el portal ecommerce.\",\n \"El usuario debe obtener de Salesforce y configurar en el conector las credenciales correspondientes al CRM para poder realizar los procesos\",\n \"El conector no consumirá servicios de plataformas diferentes a VTEX y Salesforce CRM.\"\n ],\n \"websiteURL\": \"https://vtex.com/\",\n \"support\": {\n \"url\": \"https://support.vtex.com/hc/requests\"\n }\n}\n\n```" } ]
code_salesforce-connector_fbfebd08
[ { "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 salesforce-connector/public/metadata/messages/pt-BR.json from the salesforce-connector VTEX app." }, { "role": "assistant", "content": "Here's the implementation:\n\n```json\n{\n \"name\": \"SalesForce Connector\",\n \"headline\": \"Conector entre VTEX e Salesforce\",\n \"overview\": \"Este conector (aplicativo) permitirá a integração do portal de ecommerce VTEX com o CRM Salesforce, que por meio da configuração das credenciais do Salesforce e configuração do Hook de pedidos da plataforma de ecommerce, procederá para criar ou atualizar clientes ou endereços no Salesforce, adicionando novos endereços adicionados pelo cliente e associando-os à lista correspondente no CRM.\",\n \"features\": [\n \"O aplicativo deve ser hospedado na infraestrutura da VTEX.\",\n \"O aplicativo consumirá as informações do CRM através da camada de serviço exposta por este, utilizando um token de API para autenticação, configurável a partir do portal de ecommerce.\",\n \"O usuário deve obter do Salesforce e configurar no conector as credenciais correspondentes ao CRM para poder realizar os processos.\",\n \"O conector não consumirá serviços de plataformas diferentes da VTEX e do Salesforce CRM.\"\n ],\n \"websiteURL\": \"https://vtex.com/\",\n \"support\": {\n \"url\": \"https://support.vtex.com/hc/requests\"\n }\n}\n\n```" } ]