id
stringlengths 12
53
| messages
listlengths 3
3
|
|---|---|
code_product-price_205e1283
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/ListPriceRange.tsx from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { defineMessages } from 'react-intl'\nimport { useProduct } from 'vtex.product-context'\nimport { FormattedCurrency } from 'vtex.format-currency'\nimport { useCssHandles, CssHandlesTypes } from 'vtex.css-handles'\nimport { IOMessageWithMarkers } from 'vtex.native-types'\n\nimport { getDefaultSeller } from './modules/seller'\nimport { hideProductPrice } from './modules/hideProductPrice'\n\nconst CSS_HANDLES = [\n 'listPriceRange',\n 'listPriceRangeMinValue',\n 'listPriceRangeMinWithTax',\n 'listPriceRangeMaxValue',\n 'listPriceRangeMaxWithTax',\n 'listPriceRangeUniqueValue',\n 'listPriceRangeUniqueWithTax',\n] as const\n\nconst messages = defineMessages({\n title: {\n id: 'admin/list-price-range.title',\n },\n messageTitle: {\n id: 'admin/list-price-range-message.title',\n },\n messageDescription: {\n id: 'admin/list-price-range-message.description',\n },\n messageDefault: {\n id: 'store/list-price-range-message.default',\n },\n noRangeMessageTitle: {\n id: 'admin/list-price-range-no-range-message.title',\n },\n noRangeMessageDescription: {\n id: 'admin/list-price-range-no-range-message.description',\n },\n noRangeMessageDefault: {\n id: 'store/list-price-range-no-range-message.default',\n },\n})\n\ninterface Props {\n message?: string\n noRangeMessage?: string\n markers?: string[]\n /** Used to override default CSS handles */\n classes?: CssHandlesTypes.CustomClasses<typeof CSS_HANDLES>\n alwaysShow?: boolean\n}\n\nfunction ListPriceRange({\n message = messages.messageDefault.id,\n noRangeMessage = messages.noRangeMessageDefault.id,\n markers = [],\n classes,\n alwaysShow = false,\n}: Props) {\n const { handles, withModifiers } = useCssHandles(CSS_HANDLES, { classes })\n const productContextValue = useProduct()\n\n const priceRange = productContextValue?.product?.priceRange\n\n if (!priceRange) {\n return null\n }\n\n if (\n priceRange.listPrice.lowPrice === priceRange.sellingPrice.lowPrice &&\n priceRange.listPrice.highPrice === priceRange.sellingPrice.highPrice\n ) {\n return null\n }\n\n const seller = getDefaultSeller(productContextValue?.selectedItem?.sellers)\n\n const commercialOffer = seller?.commertialOffer\n\n if (\n !commercialOffer ||\n hideProductPrice({\n alwaysShow,\n availableQuantity: commercialOffer.AvailableQuantity,\n })\n ) {\n return null\n }\n\n const minPrice: number = priceRange.listPrice.lowPrice\n const maxPrice: number = priceRange.listPrice.highPrice\n const hasRange = minPrice !== maxPrice\n const minPriceWithTax = minPrice + minPrice * commercialOffer.taxPercentage\n const maxPriceWithTax = maxPrice + maxPrice * commercialOffer.taxPercentage\n\n const containerClasses = withModifiers('listPriceRange', [\n alwaysShow && commercialOffer.AvailableQuantity <= 0 ? 'isUnavailable' : '',\n ])\n\n if (hasRange) {\n return (\n <span className={containerClasses}>\n <IOMessageWithMarkers\n message={message}\n markers={markers}\n handleBase=\"listPriceRange\"\n values={{\n minPriceValue: (\n <span\n key=\"minPriceValue\"\n className={`${handles.listPriceRangeMinValue} strike`}\n >\n <FormattedCurrency value={minPrice} />\n </span>\n ),\n maxPriceValue: (\n <span\n key=\"maxPriceValue\"\n className={`${handles.listPriceRangeMaxValue} strike`}\n >\n <FormattedCurrency value={maxPrice} />\n </span>\n ),\n minPriceWithTax: (\n <span\n key=\"minPriceWithTax\"\n className={`${handles.listPriceRangeMinWithTax} strike`}\n >\n <FormattedCurrency value={minPriceWithTax} />\n </span>\n ),\n maxPriceWithTax: (\n <span\n key=\"maxPriceWithTax\"\n className={`${handles.listPriceRangeMaxWithTax} strike`}\n >\n <FormattedCurrency value={maxPriceWithTax} />\n </span>\n ),\n }}\n />\n </span>\n )\n }\n\n return (\n <span className={containerClasses}>\n <IOMessageWithMarkers\n message={noRangeMessage}\n markers={markers}\n handleBase=\"listPriceRange\"\n values={{\n listPriceValue: (\n <span\n key=\"listPriceValue\"\n className={`${handles.listPriceRangeUniqueValue} strike`}\n >\n <FormattedCurrency value={maxPrice} />\n </span>\n ),\n listPriceWithTax: (\n <span\n key=\"listPriceWithTax\"\n className={`${handles.listPriceRangeUniqueWithTax} strike`}\n >\n <FormattedCurrency value={maxPriceWithTax} />\n </span>\n ),\n }}\n />\n </span>\n )\n}\n\nListPriceRange.schema = {\n title: messages.title.id,\n type: 'object',\n properties: {\n message: {\n title: messages.messageTitle.id,\n description: messages.messageDescription.id,\n },\n noRangeMessage: {\n title: messages.noRangeMessageTitle.id,\n description: messages.noRangeMessageDescription.id,\n },\n },\n}\n\nexport default ListPriceRange\n\n```"
}
] |
code_product-price_03eec1fc
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/SellingPriceRange.tsx from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { defineMessages } from 'react-intl'\nimport { useProduct } from 'vtex.product-context'\nimport { FormattedCurrency } from 'vtex.format-currency'\nimport { useCssHandles, CssHandlesTypes } from 'vtex.css-handles'\nimport { IOMessageWithMarkers } from 'vtex.native-types'\n\nimport { getDefaultSeller } from './modules/seller'\nimport { hideProductPrice } from './modules/hideProductPrice'\n\nconst CSS_HANDLES = [\n 'sellingPriceRange',\n 'sellingPriceRangeMinValue',\n 'sellingPriceRangeMinWithTax',\n 'sellingPriceRangeMaxValue',\n 'sellingPriceRangeMaxWithTax',\n 'sellingPriceRangeValue',\n 'sellingPriceRangeWithTax',\n 'sellingPriceRangeUniqueValue',\n 'sellingPriceRangeUniqueWithTax',\n] as const\n\nconst messages = defineMessages({\n title: {\n id: 'admin/selling-price-range.title',\n },\n messageTitle: {\n id: 'admin/selling-price-range-message.title',\n },\n messageDescription: {\n id: 'admin/selling-price-range-message.description',\n },\n messageDefault: {\n id: 'store/selling-price-range-message.default',\n },\n noRangeMessageTitle: {\n id: 'admin/selling-price-range-no-range-message.title',\n },\n noRangeMessageDescription: {\n id: 'admin/selling-price-range-no-range-message.description',\n },\n noRangeMessageDefault: {\n id: 'store/selling-price-range-no-range-message.default',\n },\n})\n\ninterface Props {\n message?: string\n noRangeMessage?: string\n markers?: string[]\n /** Used to override default CSS handles */\n classes?: CssHandlesTypes.CustomClasses<typeof CSS_HANDLES>\n alwaysShow?: boolean\n}\n\nfunction SellingPriceRange({\n message = messages.messageDefault.id,\n noRangeMessage = messages.noRangeMessageDefault.id,\n markers = [],\n classes,\n alwaysShow = false,\n}: Props) {\n const { handles, withModifiers } = useCssHandles(CSS_HANDLES, { classes })\n const productContextValue = useProduct()\n\n const priceRange = productContextValue?.product?.priceRange\n\n if (!priceRange) {\n return null\n }\n\n const seller = getDefaultSeller(productContextValue?.selectedItem?.sellers)\n\n const commercialOffer = seller?.commertialOffer\n\n if (\n !commercialOffer ||\n hideProductPrice({\n alwaysShow,\n availableQuantity: commercialOffer.AvailableQuantity,\n })\n ) {\n return null\n }\n\n const sellingPriceValue = commercialOffer.Price\n const listPriceValue = commercialOffer.ListPrice\n const hasListPrice = sellingPriceValue !== listPriceValue\n const minPrice: number = priceRange.sellingPrice.lowPrice\n const maxPrice: number = priceRange.sellingPrice.highPrice\n const hasRange = minPrice !== maxPrice\n const minPriceWithTax = minPrice + minPrice * commercialOffer.taxPercentage\n const maxPriceWithTax = maxPrice + maxPrice * commercialOffer.taxPercentage\n const sellingPrice = commercialOffer.PriceWithoutDiscount\n const sellingPriceWithTax =\n commercialOffer.PriceWithoutDiscount +\n commercialOffer.PriceWithoutDiscount * commercialOffer.taxPercentage\n\n const containerClasses = withModifiers('sellingPriceRange', [\n hasListPrice ? 'hasListPrice' : '',\n alwaysShow && commercialOffer.AvailableQuantity <= 0 ? 'isUnavailable' : '',\n ])\n\n if (hasRange) {\n return (\n <span className={containerClasses}>\n <IOMessageWithMarkers\n message={message}\n markers={markers}\n handleBase=\"sellingPriceRange\"\n values={{\n minPriceValue: (\n <span\n key=\"minPriceValue\"\n className={handles.sellingPriceRangeMinValue}\n >\n <FormattedCurrency value={minPrice} />\n </span>\n ),\n maxPriceValue: (\n <span\n key=\"maxPriceValue\"\n className={handles.sellingPriceRangeMaxValue}\n >\n <FormattedCurrency value={maxPrice} />\n </span>\n ),\n minPriceWithTax: (\n <span\n key=\"minPriceWithTax\"\n className={handles.sellingPriceRangeMinWithTax}\n >\n <FormattedCurrency value={minPriceWithTax} />\n </span>\n ),\n maxPriceWithTax: (\n <span\n key=\"maxPriceWithTax\"\n className={handles.sellingPriceRangeMaxWithTax}\n >\n <FormattedCurrency value={maxPriceWithTax} />\n </span>\n ),\n sellingPriceValue: (\n <span\n key=\"sellingPriceValue\"\n className={handles.sellingPriceRangeValue}\n >\n <FormattedCurrency value={sellingPrice} />\n </span>\n ),\n sellingPriceWithTax: (\n <span\n key=\"sellingPriceWithTax\"\n className={handles.sellingPriceRangeWithTax}\n >\n <FormattedCurrency value={sellingPriceWithTax} />\n </span>\n ),\n hasListPrice,\n }}\n />\n </span>\n )\n }\n\n return (\n <span className={containerClasses}>\n <IOMessageWithMarkers\n message={noRangeMessage}\n markers={markers}\n handleBase=\"sellingPriceRange\"\n values={{\n sellingPriceValue: (\n <span\n key=\"sellingPriceValue\"\n className={handles.sellingPriceRangeUniqueValue}\n >\n <FormattedCurrency value={maxPrice} />\n </span>\n ),\n sellingPriceWithTax: (\n <span\n key=\"sellingPriceWithTax\"\n className={handles.sellingPriceRangeUniqueWithTax}\n >\n <FormattedCurrency value={maxPriceWithTax} />\n </span>\n ),\n }}\n />\n </span>\n )\n}\n\nSellingPriceRange.schema = {\n title: messages.title.id,\n type: 'object',\n properties: {\n message: {\n title: messages.messageTitle.id,\n description: messages.messageDescription.id,\n },\n noRangeMessage: {\n title: messages.noRangeMessageTitle.id,\n description: messages.noRangeMessageDescription.id,\n },\n },\n}\n\nexport default SellingPriceRange\n\n```"
}
] |
code_product-price_2480ec69
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/Savings.tsx from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { defineMessages, useIntl, IntlFormatters } from 'react-intl'\nimport { useProduct } from 'vtex.product-context'\nimport { FormattedCurrency } from 'vtex.format-currency'\nimport { useCssHandles, CssHandlesTypes } from 'vtex.css-handles'\nimport { IOMessageWithMarkers } from 'vtex.native-types'\nimport { ProductSummaryContext } from 'vtex.product-summary-context'\n\nimport { getDefaultSeller } from './modules/seller'\nimport { hideProductPrice } from './modules/hideProductPrice'\n\nconst CSS_HANDLES = [\n 'savings',\n 'previousPriceValue',\n 'newPriceValue',\n 'savingsValue',\n 'savingsWithTax',\n 'savingsPercentage',\n] as const\n\nconst messages = defineMessages({\n title: {\n id: 'admin/savings.title',\n },\n description: {\n id: 'admin/savings.description',\n },\n default: {\n id: 'store/savings.default',\n },\n})\n\n// This is essentially a space char (\" \") that doesn't allow line breaks\n// It is needed because the formatNumber function returns it that way\nconst NON_BREAKING_SPACE_CHAR = String.fromCharCode(160)\n\ninterface GetFormattedSavingsPercentageParams {\n formatNumber: IntlFormatters['formatNumber']\n savingsPercentage: number\n percentageStyle: Props['percentageStyle']\n}\n\nfunction getFormattedSavingsPercentage({\n formatNumber,\n savingsPercentage,\n percentageStyle,\n}: GetFormattedSavingsPercentageParams) {\n const formattedSavingsPercentage = formatNumber(savingsPercentage, {\n style: 'percent',\n })\n\n if (percentageStyle === 'compact') {\n return formattedSavingsPercentage.replace(\n `${NON_BREAKING_SPACE_CHAR}%`,\n '%'\n )\n }\n\n return formattedSavingsPercentage\n}\n\ninterface Props {\n message?: string\n markers?: string[]\n percentageStyle?: 'locale' | 'compact'\n minimumPercentage?: number\n /** Used to override default CSS handles */\n classes?: CssHandlesTypes.CustomClasses<typeof CSS_HANDLES>\n alwaysShow?: boolean\n}\n\nfunction Savings({\n message = messages.default.id,\n markers = [],\n minimumPercentage = 0,\n percentageStyle = 'locale',\n classes,\n alwaysShow = false,\n}: Props) {\n const { handles, withModifiers } = useCssHandles(CSS_HANDLES, { classes })\n const { formatNumber } = useIntl()\n const intl = useIntl()\n const productContextValue = useProduct()\n const productSummaryValue = ProductSummaryContext.useProductSummary()\n\n const seller = getDefaultSeller(productContextValue?.selectedItem?.sellers)\n\n const commercialOffer = seller?.commertialOffer\n\n if (\n !commercialOffer ||\n hideProductPrice({\n alwaysShow,\n availableQuantity: commercialOffer.AvailableQuantity,\n }) ||\n productSummaryValue?.isLoading\n ) {\n return null\n }\n\n const previousPriceValue = commercialOffer.ListPrice\n const newPriceValue = commercialOffer.Price\n const savingsValue = previousPriceValue - newPriceValue\n const savingsWithTax =\n savingsValue + savingsValue * commercialOffer.taxPercentage\n\n const savingsPercentage = savingsValue / previousPriceValue\n\n if (savingsValue <= 0 || savingsPercentage < minimumPercentage / 100) {\n return null\n }\n\n const containerClasses = withModifiers('savings', [\n alwaysShow && commercialOffer.AvailableQuantity <= 0 ? 'isUnavailable' : '',\n ])\n\n return (\n <span\n className={containerClasses}\n aria-label={intl.formatMessage(\n { id: 'store/product-price.price-savings.aria-label' },\n { previousPriceValue, newPriceValue }\n )}\n >\n <IOMessageWithMarkers\n message={message}\n markers={markers}\n handleBase=\"savings\"\n values={{\n previousPriceValue: (\n <span\n key=\"previousPriceValue\"\n className={handles.previousPriceValue}\n >\n <FormattedCurrency value={previousPriceValue} />\n </span>\n ),\n newPriceValue: (\n <span key=\"newPriceValue\" className={handles.newPriceValue}>\n <FormattedCurrency value={newPriceValue} />\n </span>\n ),\n savingsValue: (\n <span key=\"savingsValue\" className={handles.savingsValue}>\n <FormattedCurrency value={savingsValue} />\n </span>\n ),\n savingsWithTax: (\n <span key=\"savingsWithTax\" className={handles.savingsWithTax}>\n <FormattedCurrency value={savingsWithTax} />\n </span>\n ),\n savingsPercentage: (\n <span key=\"savingsPercentage\" className={handles.savingsPercentage}>\n {getFormattedSavingsPercentage({\n formatNumber,\n savingsPercentage,\n percentageStyle,\n })}\n </span>\n ),\n }}\n />\n </span>\n )\n}\n\nSavings.schema = {\n title: messages.title.id,\n}\n\nexport default Savings\n\n```"
}
] |
code_product-price_3fdad3fd
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/PriceSuspense.tsx from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React, { PropsWithChildren } from 'react'\nimport { useCssHandles, CssHandlesTypes } from 'vtex.css-handles'\nimport { ProductSummaryContext } from 'vtex.product-summary-context'\n\nimport PriceLoadingSpinner, {\n CSS_HANDLES as LoadingSpinnerHandles,\n} from './components/PriceLoadingSpinner'\n\nconst CSS_HANDLES = [\n 'priceSuspense',\n 'priceSuspenseFallbackWrapper',\n 'priceSuspenseContentWrapper',\n ...LoadingSpinnerHandles,\n] as const\n\ninterface PriceSuspenseProps {\n Fallback?: React.ComponentType\n /** Used to override default CSS handles */\n classes?: CssHandlesTypes.CustomClasses<typeof CSS_HANDLES>\n}\n\nfunction PriceSuspense({\n children,\n Fallback,\n classes,\n}: PropsWithChildren<PriceSuspenseProps>) {\n const { isPriceLoading } = ProductSummaryContext.useProductSummary()\n const { handles } = useCssHandles(CSS_HANDLES, { classes })\n\n return (\n <div className={`relative ${handles.priceSuspense}`}>\n {isPriceLoading && (\n <div className={handles.priceSuspenseFallbackWrapper}>\n {Fallback ? <Fallback /> : <PriceLoadingSpinner handles={handles} />}\n </div>\n )}\n <div\n className={`${handles.priceSuspenseContentWrapper} ${\n isPriceLoading ? 'dn' : ''\n }`}\n >\n {children}\n </div>\n </div>\n )\n}\n\nexport default PriceSuspense\n\n```"
}
] |
code_product-price_b9c06d25
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/SpotPriceSavings.tsx from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { defineMessages, FormattedNumber } from 'react-intl'\nimport { useProduct } from 'vtex.product-context'\nimport { FormattedCurrency } from 'vtex.format-currency'\nimport { useCssHandles, CssHandlesTypes } from 'vtex.css-handles'\nimport { IOMessageWithMarkers } from 'vtex.native-types'\n\nimport { getDefaultSeller } from './modules/seller'\nimport { hideProductPrice } from './modules/hideProductPrice'\n\nconst CSS_HANDLES = [\n 'spotPriceSavings',\n 'previousPriceValue',\n 'newSpotPriceValue',\n 'spotPriceSavingsValue',\n 'spotPriceSavingsWithTax',\n 'spotPriceSavingsPercentage',\n] as const\n\nconst messages = defineMessages({\n title: {\n id: 'admin/spot-price-savings.title',\n },\n description: {\n id: 'admin/spot-price-savings.description',\n },\n default: {\n id: 'store/spot-price-savings.default',\n },\n})\n\ninterface Props {\n message?: string\n markers?: string[]\n /** Used to override default CSS handles */\n classes?: CssHandlesTypes.CustomClasses<typeof CSS_HANDLES>\n alwaysShow?: boolean\n}\n\nfunction SpotPriceSavings({\n message = messages.default.id,\n markers = [],\n classes,\n alwaysShow = false,\n}: Props) {\n const { handles, withModifiers } = useCssHandles(CSS_HANDLES, { classes })\n const productContextValue = useProduct()\n\n const seller = getDefaultSeller(productContextValue?.selectedItem?.sellers)\n\n const commercialOffer = seller?.commertialOffer\n\n if (\n !commercialOffer ||\n hideProductPrice({\n alwaysShow,\n availableQuantity: commercialOffer.AvailableQuantity,\n })\n ) {\n return null\n }\n\n const previousPriceValue = commercialOffer.ListPrice\n const spotPriceValue = commercialOffer.spotPrice\n\n const spotPriceSavingsValue = previousPriceValue - spotPriceValue\n const spotPriceSavingsWithTax =\n spotPriceSavingsValue +\n spotPriceSavingsValue * commercialOffer.taxPercentage\n\n const spotPriceSavingsPercentage = spotPriceSavingsValue / previousPriceValue\n\n if (spotPriceSavingsValue <= 0) {\n return null\n }\n\n const containerClasses = withModifiers('spotPriceSavings', [\n alwaysShow && commercialOffer.AvailableQuantity <= 0 ? 'isUnavailable' : '',\n ])\n\n return (\n <span className={containerClasses}>\n <IOMessageWithMarkers\n message={message}\n markers={markers}\n handleBase=\"savings\"\n values={{\n previousPriceValue: (\n <span\n key=\"previousPriceValue\"\n className={handles.previousPriceValue}\n >\n <FormattedCurrency value={previousPriceValue} />\n </span>\n ),\n newSpotPriceValue: (\n <span key=\"newSpotPriceValue\" className={handles.newSpotPriceValue}>\n <FormattedCurrency value={spotPriceValue} />\n </span>\n ),\n spotPriceSavingsValue: (\n <span\n key=\"spotPriceSavingsValue\"\n className={handles.spotPriceSavingsValue}\n >\n <FormattedCurrency value={spotPriceSavingsValue} />\n </span>\n ),\n spotPriceSavingsWithTax: (\n <span\n key=\"spotPriceSavingsWithTax\"\n className={handles.spotPriceSavingsWithTax}\n >\n <FormattedNumber value={spotPriceSavingsWithTax} />\n </span>\n ),\n spotPriceSavingsPercentage: (\n <span\n key=\"spotPriceSavingsPercentage\"\n className={handles.spotPriceSavingsPercentage}\n >\n <FormattedNumber\n value={spotPriceSavingsPercentage}\n style=\"percent\"\n />\n </span>\n ),\n }}\n />\n </span>\n )\n}\n\nSpotPriceSavings.schema = {\n title: messages.title.id,\n}\n\nexport default SpotPriceSavings\n\n```"
}
] |
code_product-price_5f34c5a4
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/package.json from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"scripts\": {\n \"lint\": \"tsc --noEmit && eslint --quiet --fix --ext ts,tsx .\",\n \"test\": \"vtex-test-tools test\"\n },\n \"dependencies\": {\n \"apollo-client\": \"^2.6.8\",\n \"react\": \"^16.8.6\",\n \"react-apollo\": \"^2.5.8\",\n \"react-dom\": \"^16.8.6\",\n \"react-intl\": \"^3.11.0\",\n \"slugify\": \"^1.5.3\"\n },\n \"devDependencies\": {\n \"@apollo/react-testing\": \"^3.1.3\",\n \"@types/classnames\": \"^2.2.11\",\n \"@types/graphql\": \"^14.5.0\",\n \"@types/jest\": \"^24.9.0\",\n \"@types/node\": \"^13.1.8\",\n \"@types/react\": \"^16.9.19\",\n \"@types/react-intl\": \"^3.0.0\",\n \"@vtex/test-tools\": \"^3.0.1\",\n \"@vtex/tsconfig\": \"^0.2.0\",\n \"apollo-cache-inmemory\": \"^1.6.5\",\n \"graphql\": \"^14.5.8\",\n \"typescript\": \"3.9.7\",\n \"vtex.css-handles\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.css-handles@1.0.0/public/@types/vtex.css-handles\",\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.native-types\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.native-types@0.7.5/public/@types/vtex.native-types\",\n \"vtex.product-context\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.product-context@0.9.9/public/@types/vtex.product-context\",\n \"vtex.product-price\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.product-price@1.21.0/public/@types/vtex.product-price\",\n \"vtex.product-summary-context\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.product-summary-context@0.7.1/public/@types/vtex.product-summary-context\",\n \"vtex.render-runtime\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.render-runtime@8.128.4/public/@types/vtex.render-runtime\"\n },\n \"version\": \"1.33.0\"\n}\n\n```"
}
] |
code_product-price_7c275ec4
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/Installments.tsx from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { defineMessages } from 'react-intl'\nimport { useCssHandles, CssHandlesTypes } from 'vtex.css-handles'\nimport { useProduct } from 'vtex.product-context'\n\nimport InstallmentsRenderer, {\n CSS_HANDLES,\n} from './components/InstallmentsRenderer'\nimport {\n pickMaxInstallmentsOption,\n pickMaxInstallmentsOptionWithoutInterest,\n} from './modules/pickInstallments'\nimport { getDefaultSeller } from './modules/seller'\n\nconst messages = defineMessages({\n title: {\n id: 'admin/installments.title',\n },\n description: {\n id: 'admin/installments.description',\n },\n default: {\n id: 'store/installments.default',\n },\n})\n\ninterface Props {\n message?: string\n markers?: string[]\n installmentsCriteria?: 'max-quantity' | 'max-quantity-without-interest'\n installmentOptionsFilter?: {\n paymentSystemName?: string\n installmentsQuantity?: number\n }\n /** Used to override default CSS handles */\n classes?: CssHandlesTypes.CustomClasses<typeof CSS_HANDLES>\n}\n\nfunction Installments({\n message = messages.default.id,\n markers = [],\n installmentsCriteria = 'max-quantity',\n installmentOptionsFilter,\n classes,\n}: Props) {\n const productContextValue = useProduct()\n const { handles, withModifiers } = useCssHandles(CSS_HANDLES, { classes })\n const seller = getDefaultSeller(productContextValue?.selectedItem?.sellers)\n\n const commercialOffer = seller?.commertialOffer\n\n if (\n !commercialOffer?.Installments ||\n commercialOffer?.Installments?.length === 0\n ) {\n return null\n }\n\n let [installmentsOption] = commercialOffer.Installments\n\n switch (installmentsCriteria) {\n case 'max-quantity-without-interest': {\n installmentsOption = pickMaxInstallmentsOptionWithoutInterest(\n commercialOffer.Installments,\n installmentOptionsFilter\n )\n\n break\n }\n\n default: {\n installmentsOption = pickMaxInstallmentsOption(\n commercialOffer.Installments,\n installmentOptionsFilter\n )\n\n break\n }\n }\n\n return (\n <InstallmentsRenderer\n message={message}\n markers={markers}\n installment={installmentsOption}\n handles={handles}\n handlesModifierFunction={withModifiers}\n />\n )\n}\n\nInstallments.schema = {\n title: messages.title.id,\n}\n\nexport default Installments\n\n```"
}
] |
code_product-price_4da0d045
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/SpotPrice.tsx from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { defineMessages } from 'react-intl'\nimport { useProduct } from 'vtex.product-context'\nimport { FormattedCurrency } from 'vtex.format-currency'\nimport { useCssHandles, CssHandlesTypes } from 'vtex.css-handles'\nimport { IOMessageWithMarkers } from 'vtex.native-types'\n\nimport { getDefaultSeller } from './modules/seller'\nimport { hideProductPrice } from './modules/hideProductPrice'\n\nconst CSS_HANDLES = ['spotPrice', 'spotPriceValue'] as const\n\nconst messages = defineMessages({\n title: {\n id: 'admin/spot-price.title',\n },\n description: {\n id: 'admin/spot-price.description',\n },\n default: {\n id: 'store/spot-price.default',\n },\n})\n\ninterface Props {\n message?: string\n markers?: string[]\n /** Used to override default CSS handles */\n classes?: CssHandlesTypes.CustomClasses<typeof CSS_HANDLES>\n alwaysShow?: boolean\n}\n\nfunction SpotPrice({\n message = messages.default.id,\n markers = [],\n classes,\n alwaysShow = false,\n}: Props) {\n const { handles, withModifiers } = useCssHandles(CSS_HANDLES, { classes })\n const productContextValue = useProduct()\n\n const seller = getDefaultSeller(productContextValue?.selectedItem?.sellers)\n\n const commercialOffer = seller?.commertialOffer\n\n if (\n !commercialOffer ||\n hideProductPrice({\n alwaysShow,\n availableQuantity: commercialOffer.AvailableQuantity,\n })\n ) {\n return null\n }\n\n const spotPriceValue = commercialOffer.spotPrice\n const sellingPriceValue = commercialOffer.SellingPrice\n\n if (spotPriceValue === sellingPriceValue) {\n return null\n }\n\n const containerClasses = withModifiers('spotPrice', [\n alwaysShow && commercialOffer.AvailableQuantity <= 0 ? 'isUnavailable' : '',\n ])\n\n return (\n <span className={containerClasses}>\n <IOMessageWithMarkers\n message={message}\n markers={markers}\n handleBase=\"spotPrice\"\n values={{\n spotPriceValue: (\n <span key=\"spotPriceValue\" className={handles.spotPriceValue}>\n <FormattedCurrency value={spotPriceValue} />\n </span>\n ),\n }}\n />\n </span>\n )\n}\n\nSpotPrice.schema = {\n title: messages.title.id,\n}\n\nexport default SpotPrice\n\n```"
}
] |
code_product-price_3f44c02e
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/SellingPrice.tsx from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { defineMessages, FormattedNumber } from 'react-intl'\nimport { useProduct } from 'vtex.product-context'\nimport { FormattedCurrency } from 'vtex.format-currency'\nimport { IOMessageWithMarkers } from 'vtex.native-types'\nimport { useCssHandles, CssHandlesTypes } from 'vtex.css-handles'\n\nimport { getDefaultSeller } from './modules/seller'\nimport { hideProductPrice } from './modules/hideProductPrice'\n\nconst CSS_HANDLES = [\n 'sellingPrice',\n 'sellingPriceValue',\n 'sellingPriceWithTax',\n 'sellingPriceWithUnitMultiplier',\n 'sellingPriceWithUnitMultiplierAndTax',\n 'sellingPriceWithTaxWithoutUnitMultiplier',\n 'taxPercentage',\n 'taxValue',\n 'measurementUnit',\n 'unitMultiplier',\n] as const\n\nconst messages = defineMessages({\n title: {\n id: 'admin/selling-price.title',\n },\n description: {\n id: 'admin/selling-price.description',\n },\n default: {\n id: 'store/selling-price.default',\n },\n})\n\ninterface Props {\n message?: string\n markers?: string[]\n /** Used to override default CSS handles */\n classes?: CssHandlesTypes.CustomClasses<typeof CSS_HANDLES>\n alwaysShow?: boolean\n}\n\nfunction SellingPrice({\n message = messages.default.id,\n markers = [],\n classes,\n alwaysShow = false,\n}: Props) {\n const { handles, withModifiers } = useCssHandles(CSS_HANDLES, {\n classes,\n })\n\n const productContextValue = useProduct()\n\n const seller = getDefaultSeller(productContextValue?.selectedItem?.sellers)\n\n const commercialOffer = seller?.commertialOffer\n\n if (\n !commercialOffer ||\n hideProductPrice({\n alwaysShow,\n availableQuantity: commercialOffer.AvailableQuantity,\n })\n ) {\n return null\n }\n\n const sellingPriceValue = commercialOffer.Price\n const listPriceValue = commercialOffer.ListPrice\n const { taxPercentage } = commercialOffer\n const sellingPriceWithTax =\n sellingPriceValue + sellingPriceValue * taxPercentage\n\n const measurementUnit =\n productContextValue?.selectedItem?.measurementUnit ?? ''\n\n const unitMultiplier = productContextValue?.selectedItem?.unitMultiplier ?? 1\n const sellingPriceWithUnitMultiplier = sellingPriceValue * unitMultiplier\n\n const sellingPriceWithUnitMultiplierAndTax =\n sellingPriceValue * (unitMultiplier + taxPercentage)\n \n const sellingPriceWithTaxWithoutUnitMultiplier =\n sellingPriceValue + (sellingPriceValue * taxPercentage / unitMultiplier)\n \n const taxValue = commercialOffer.Tax\n\n const hasListPrice = sellingPriceValue !== listPriceValue\n const hasMeasurementUnit = measurementUnit && measurementUnit !== 'un'\n const hasUnitMultiplier = unitMultiplier !== 1\n\n const containerClasses = withModifiers('sellingPrice', [\n hasListPrice ? 'hasListPrice' : '',\n hasMeasurementUnit ? 'hasMeasurementUnit' : '',\n hasUnitMultiplier ? 'hasUnitMultiplier' : '',\n alwaysShow && commercialOffer.AvailableQuantity <= 0 ? 'isUnavailable' : '',\n ])\n\n return (\n <span className={containerClasses}>\n <IOMessageWithMarkers\n message={message}\n markers={markers}\n handleBase=\"sellingPrice\"\n values={{\n sellingPriceValue: (\n <span key=\"sellingPriceValue\" className={handles.sellingPriceValue}>\n <FormattedCurrency value={sellingPriceValue} />\n </span>\n ),\n sellingPriceWithTax: (\n <span\n key=\"sellingPriceWithTax\"\n className={handles.sellingPriceWithTax}\n >\n <FormattedCurrency value={sellingPriceWithTax} />\n </span>\n ),\n sellingPriceWithUnitMultiplier: (\n <span\n key=\"sellingPriceWithUnitMultiplier\"\n className={handles.sellingPriceWithUnitMultiplier}\n >\n <FormattedCurrency value={sellingPriceWithUnitMultiplier} />\n </span>\n ),\n sellingPriceWithUnitMultiplierAndTax: (\n <span\n key=\"sellingPriceWithUnitMultiplierAndTax\"\n className={handles.sellingPriceWithUnitMultiplierAndTax}\n >\n <FormattedCurrency value={sellingPriceWithUnitMultiplierAndTax} />\n </span>\n ),\n sellingPriceWithTaxWithoutUnitMultiplier: (\n <span\n key=\"sellingPriceWithTaxWithoutUnitMultiplier\"\n className={handles.sellingPriceWithTaxWithoutUnitMultiplier}\n >\n <FormattedCurrency value={sellingPriceWithTaxWithoutUnitMultiplier} />\n </span>\n ),\n taxPercentage: (\n <span key=\"taxPercentage\" className={handles.taxPercentage}>\n <FormattedNumber value={taxPercentage} style=\"percent\" />\n </span>\n ),\n taxValue: (\n <span key=\"taxValue\" className={handles.taxValue}>\n <FormattedCurrency value={taxValue} />\n </span>\n ),\n hasMeasurementUnit,\n hasListPrice,\n hasUnitMultiplier,\n unitMultiplier: (\n <span key=\"unitMultiplier\" className={handles.unitMultiplier}>\n <FormattedNumber value={unitMultiplier} />\n </span>\n ),\n measurementUnit: (\n <span key=\"measurementUnit\" className={handles.measurementUnit}>\n {measurementUnit}\n </span>\n ),\n }}\n />\n </span>\n )\n}\n\nSellingPrice.schema = {\n title: messages.title.id,\n}\n\nexport default SellingPrice\n\n```"
}
] |
code_product-price_8dbe9570
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/InstallmentsList.tsx from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React, { PropsWithChildren, useMemo } from 'react'\nimport { useCssHandles, CssHandlesTypes } from 'vtex.css-handles'\nimport { ProductTypes, useProduct } from 'vtex.product-context'\nimport { Installment } from 'vtex.product-context/react/ProductTypes'\n\nimport { InstallmentsContextProvider } from './components/InstallmentsContext'\nimport pickInstallmentsList, {\n clusterInstallments,\n} from './modules/pickInstallments'\nimport { getDefaultSeller } from './modules/seller'\n\nconst CSS_HANDLES = ['installmentsListContainer'] as const\n\ninterface Props {\n paymentSystemName?: string\n installmentsToShow?: number[]\n /** Used to override default CSS handles */\n classes?: CssHandlesTypes.CustomClasses<typeof CSS_HANDLES>\n}\n\nfunction InstallmentsList({\n paymentSystemName,\n installmentsToShow,\n classes,\n children,\n}: PropsWithChildren<Props>) {\n const { handles } = useCssHandles(CSS_HANDLES, { classes })\n const productContextValue = useProduct()\n\n const seller = getDefaultSeller(productContextValue?.selectedItem?.sellers)\n\n const commercialOffer = seller?.commertialOffer\n\n if (\n !commercialOffer?.Installments ||\n commercialOffer.Installments?.length === 0\n ) {\n return null\n }\n\n let pickedInstallments: Installment[] = []\n\n if (paymentSystemName) {\n const installmentsByPaymentSystem = clusterInstallments(\n commercialOffer.Installments,\n 'PaymentSystemName'\n )\n\n if (!installmentsByPaymentSystem[paymentSystemName]) {\n return null\n }\n\n pickedInstallments = installmentsByPaymentSystem[paymentSystemName]\n } else {\n pickedInstallments = pickInstallmentsList(\n commercialOffer.Installments,\n 'PaymentSystemName'\n )\n }\n\n const filteredInstallments = installmentsToShow\n ? pickedInstallments.filter(option =>\n installmentsToShow.includes(option.NumberOfInstallments)\n )\n : pickedInstallments\n\n return (\n <div className={handles.installmentsListContainer}>\n {filteredInstallments.map((inst, i) => {\n return (\n <InstallmentsItem installment={inst} key={i}>\n {children}\n </InstallmentsItem>\n )\n })}\n </div>\n )\n}\n\ninterface ItemProps {\n installment: ProductTypes.Installment\n}\n\nfunction InstallmentsItem(props: PropsWithChildren<ItemProps>) {\n const { installment, children } = props\n const contextValue = useMemo(() => ({ installment }), [installment])\n\n return (\n <InstallmentsContextProvider value={contextValue}>\n {children}\n </InstallmentsContextProvider>\n )\n}\n\nexport default InstallmentsList\n\n```"
}
] |
code_product-price_cbd3205c
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/store/contentSchemas.json from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"definitions\": {\n \"ListPrice\": {\n \"type\": \"object\",\n \"properties\": {\n \"message\": {\n \"title\": \"admin/list-price.title\",\n \"description\": \"admin/list-price.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"default\": \"store/list-price.default\"\n }\n }\n },\n \"SellingPrice\": {\n \"type\": \"object\",\n \"properties\": {\n \"message\": {\n \"title\": \"admin/selling-price.title\",\n \"description\": \"admin/selling-price.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"default\": \"store/selling-price.default\"\n }\n }\n },\n \"SpotPrice\": {\n \"type\": \"object\",\n \"properties\": {\n \"message\": {\n \"title\": \"admin/spot-price.title\",\n \"description\": \"admin/spot-price.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"default\": \"store/spot-price.default\"\n }\n }\n },\n \"SpotPriceSavings\": {\n \"type\": \"object\",\n \"properties\": {\n \"message\": {\n \"title\": \"admin/spot-price-savings.title\",\n \"description\": \"admin/spot-price-savings.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"default\": \"store/spot-price-savings.default\"\n }\n }\n },\n \"Savings\": {\n \"type\": \"object\",\n \"properties\": {\n \"message\": {\n \"title\": \"admin/savings.title\",\n \"description\": \"admin/savings.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"default\": \"store/savings.default\"\n }\n }\n },\n \"Installments\": {\n \"type\": \"object\",\n \"properties\": {\n \"message\": {\n \"title\": \"admin/installments.title\",\n \"description\": \"admin/installments.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"default\": \"store/installments.default\"\n }\n }\n },\n \"InstallmentsListItem\": {\n \"title\": \"admin/installments-list-item.title\",\n \"type\": \"object\",\n \"properties\": {\n \"$ref\": \"app:vtex.product-price#/definitions/Installments/properties\"\n }\n },\n \"ListPriceRange\": {\n \"type\": \"object\",\n \"properties\": {\n \"message\": {\n \"title\": \"admin/list-price-range-message.title\",\n \"description\": \"admin/list-price-range-message.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"default\": \"store/list-price-range-message.default\"\n },\n \"noRangeMessage\": {\n \"title\": \"admin/list-price-range-no-range-message.title\",\n \"description\": \"admin/list-price-range-no-range-message.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"default\": \"store/list-price-range-no-range-message.default\"\n }\n }\n },\n \"SellingPriceRange\": {\n \"type\": \"object\",\n \"properties\": {\n \"message\": {\n \"title\": \"admin/selling-price-range-message.title\",\n \"description\": \"admin/selling-price-range-message.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"default\": \"store/selling-price-range-message.default\"\n },\n \"noRangeMessage\": {\n \"title\": \"admin/selling-price-range-no-range-message.title\",\n \"description\": \"admin/selling-price-range-no-range-message.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"default\": \"store/selling-price-range-no-range-message.default\"\n }\n }\n },\n \"SellerName\": {\n \"type\": \"object\",\n \"properties\": {\n \"message\": {\n \"title\": \"admin/seller-name.title\",\n \"description\": \"admin/seller-name.description\",\n \"$ref\": \"app:vtex.native-types#/definitions/text\",\n \"default\": \"store/seller-name.default\"\n }\n }\n }\n }\n}\n\n```"
}
] |
code_product-price_4c7f6b34
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/store/interfaces.json from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"product-list-price\": {\n \"component\": \"ListPrice\",\n \"composition\": \"children\",\n \"content\": {\n \"$ref\": \"app:vtex.product-price#/definitions/ListPrice\"\n }\n },\n \"product-selling-price\": {\n \"component\": \"SellingPrice\",\n \"composition\": \"children\",\n \"content\": {\n \"$ref\": \"app:vtex.product-price#/definitions/SellingPrice\"\n }\n },\n \"product-spot-price\": {\n \"component\": \"SpotPrice\",\n \"composition\": \"children\",\n \"content\": {\n \"$ref\": \"app:vtex.product-price#/definitions/SpotPrice\"\n }\n },\n \"product-spot-price-savings\": {\n \"component\": \"SpotPriceSavings\",\n \"composition\": \"children\",\n \"content\": {\n \"$ref\": \"app:vtex.product-price#/definitions/SpotPriceSavings\"\n }\n },\n \"product-price-savings\": {\n \"component\": \"Savings\",\n \"composition\": \"children\",\n \"content\": {\n \"$ref\": \"app:vtex.product-price#/definitions/Savings\"\n }\n },\n \"product-installments\": {\n \"component\": \"Installments\",\n \"composition\": \"children\",\n \"content\": {\n \"$ref\": \"app:vtex.product-price#/definitions/Installments\"\n }\n },\n \"product-installments-list\": {\n \"component\": \"InstallmentsList\",\n \"composition\": \"children\"\n },\n \"product-installments-list-item\": {\n \"component\": \"InstallmentsListItem\",\n \"content\": {\n \"$ref\": \"app:vtex.product-price#/definitions/InstallmentsListItem\"\n }\n },\n \"product-list-price-range\": {\n \"component\": \"ListPriceRange\",\n \"composition\": \"children\",\n \"content\": {\n \"$ref\": \"app:vtex.product-price#/definitions/ListPriceRange\"\n }\n },\n \"product-selling-price-range\": {\n \"component\": \"SellingPriceRange\",\n \"composition\": \"children\",\n \"content\": {\n \"$ref\": \"app:vtex.product-price#/definitions/SellingPriceRange\"\n }\n },\n \"product-seller-name\": {\n \"component\": \"SellerName\",\n \"content\": {\n \"$ref\": \"app:vtex.product-price#/definitions/SellerName\"\n }\n },\n \"product-price-suspense\": {\n \"component\": \"PriceSuspense\",\n \"composition\": \"children\"\n }\n}\n\n```"
}
] |
code_product-price_c97120a3
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/typings/installments-list-mock.d.ts from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ndeclare module 'installments-list-mock' {\n import { Installments } from '../components/InstallmentsContext'\n\n export const installmentsList: Installments[]\n export const visaInstallments: Installments[]\n export const installmentsListMastercardMax: Installments[]\n export const masterCardInstallments: Installments[]\n}\n\n```"
}
] |
code_product-price_2c8a4dc2
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/typings/css.d.ts from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ndeclare module '*.css' {\n type Styles = {\n [selector: string]: string\n }\n\n const styles: Styles\n\n export default styles\n}\n\n```"
}
] |
code_product-price_6d9beaf4
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/components/InstallmentsContext.ts from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { createContext, useContext } from 'react'\nimport { ProductTypes } from 'vtex.product-context'\n\nconst InstallmentsContext = createContext<\n { installment: ProductTypes.Installment } | undefined\n>(undefined)\n\nexport const InstallmentsContextProvider = InstallmentsContext.Provider\n\nexport function useInstallments() {\n return useContext(InstallmentsContext)\n}\n\n```"
}
] |
code_product-price_51d0fc10
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/components/InstallmentsRenderer.tsx from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { FormattedNumber } from 'react-intl'\nimport { CssHandlesTypes } from 'vtex.css-handles'\nimport { FormattedCurrency } from 'vtex.format-currency'\nimport { IOMessageWithMarkers } from 'vtex.native-types'\nimport { ProductTypes } from 'vtex.product-context'\n\nimport { slug } from '../modules/slug'\n\nexport const CSS_HANDLES = [\n 'installments',\n 'installmentsNumber',\n 'installmentValue',\n 'installmentsTotalValue',\n 'interestRate',\n 'paymentSystemName',\n] as const\n\ninterface Props {\n message: string\n markers: string[]\n installment: ProductTypes.Installment\n handles: CssHandlesTypes.CssHandlesBag<typeof CSS_HANDLES>['handles']\n handlesModifierFunction: CssHandlesTypes.CssHandlesBag<\n typeof CSS_HANDLES\n >['withModifiers']\n}\n\nfunction InstallmentsRenderer({\n message,\n markers,\n installment,\n handles,\n handlesModifierFunction: withModifiers,\n}: Props) {\n const {\n Value,\n NumberOfInstallments,\n InterestRate,\n PaymentSystemName,\n TotalValuePlusInterestRate,\n } = installment\n\n const hasMoreThanOne = NumberOfInstallments > 1\n\n const hasInterest = InterestRate !== 0\n\n const interestRatePercent = InterestRate / 100\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={withModifiers(\n 'installmentsNumber',\n `${NumberOfInstallments}`\n )}\n >\n {NumberOfInstallments && (\n <FormattedNumber value={NumberOfInstallments} />\n )}\n </span>\n ),\n installmentValue: (\n <span key=\"installmentValue\" className={handles.installmentValue}>\n <FormattedCurrency value={Value} />\n </span>\n ),\n installmentsTotalValue: (\n <span\n key=\"installmentsTotalValue\"\n className={handles.installmentsTotalValue}\n >\n <FormattedCurrency value={TotalValuePlusInterestRate} />\n </span>\n ),\n interestRate: (\n <span key=\"interestRate\" className={handles.interestRate}>\n {interestRatePercent && (\n <FormattedNumber\n value={interestRatePercent}\n style=\"percent\"\n maximumFractionDigits={2}\n minimumFractionDigits={0}\n />\n )}\n </span>\n ),\n paymentSystemName: (\n <span\n key=\"paymentSystemName\"\n className={withModifiers(\n 'paymentSystemName',\n `${slug(PaymentSystemName)}`\n )}\n >\n {PaymentSystemName}\n </span>\n ),\n hasInterest,\n hasMoreThanOne,\n }}\n />\n </span>\n )\n}\n\nexport default InstallmentsRenderer\n\n```"
}
] |
code_product-price_efdca20f
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/__tests__/pickInstallments.test.ts from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport {\n installmentsList,\n visaInstallments,\n installmentsListMastercardMax,\n} from 'installments-list-mock'\n\nimport pickInstallmentsList, {\n pickMaxInstallmentsOption,\n pickMaxInstallmentsOptionWithoutInterest,\n} from '../modules/pickInstallments'\n\ndescribe('pickInstallmentsList', () => {\n it('should pick installments of the payment method with the biggest amount of options', () => {\n const pickedInstallments = pickInstallmentsList(\n installmentsList,\n 'PaymentSystemName'\n )\n\n expect(pickedInstallments).toHaveLength(visaInstallments.length)\n expect(pickedInstallments).toEqual(visaInstallments)\n })\n\n it('should pick MasterCard because the NumberOfInstallments is bigger', () => {\n const pickedInstallments = pickInstallmentsList(\n installmentsListMastercardMax,\n 'PaymentSystemName'\n )\n\n expect(pickedInstallments[0].PaymentSystemName).toBe('Mastercard')\n\n let maxNumberOfInstallments = pickedInstallments[0].NumberOfInstallments\n let index = 0\n\n for (let i = 1; i < pickedInstallments.length; i++) {\n if (\n maxNumberOfInstallments < pickedInstallments[i].NumberOfInstallments\n ) {\n maxNumberOfInstallments = pickedInstallments[i].NumberOfInstallments\n index = i\n }\n }\n\n expect(pickedInstallments[index].NumberOfInstallments).toBe(15)\n })\n})\n\ndescribe('pickMaxInstallmentsOption', () => {\n it('should pick the installments plan with the highest NumberOfInstallments', () => {\n const pickedInstallmentsPlan = pickMaxInstallmentsOption(\n installmentsListMastercardMax\n )\n\n expect(pickedInstallmentsPlan.NumberOfInstallments).toBe(15)\n expect(pickedInstallmentsPlan.PaymentSystemName).toBe('Mastercard')\n })\n\n it('should pick the installments plan with the highest NumberOfInstallments, from a certain payment system', () => {\n const pickedInstallmentsPlan = pickMaxInstallmentsOption(installmentsList, {\n paymentSystemName: 'Customer Credit',\n })\n\n expect(pickedInstallmentsPlan.NumberOfInstallments).toBe(3)\n expect(pickedInstallmentsPlan.PaymentSystemName).toBe('Customer Credit')\n })\n\n it('should pick an installments plan with a certain number of installments', () => {\n const pickedInstallmentsPlan = pickMaxInstallmentsOption(\n installmentsListMastercardMax,\n {\n installmentsQuantity: 14,\n }\n )\n\n expect(pickedInstallmentsPlan.NumberOfInstallments).toBe(14)\n })\n\n it('should pick the installments plan with the highest NumberOfInstallments, using all filtering options', () => {\n const pickedInstallmentsPlan = pickMaxInstallmentsOption(installmentsList, {\n paymentSystemName: 'Customer Credit',\n installmentsQuantity: 2,\n })\n\n expect(pickedInstallmentsPlan.NumberOfInstallments).toBe(2)\n expect(pickedInstallmentsPlan.PaymentSystemName).toBe('Customer Credit')\n })\n})\n\ndescribe('pickMaxInstallmentsOptionWithoutInterest', () => {\n it('should pick the installments plan with the highest NumberOfInstallments and no interest', () => {\n const pickedInstallmentsPlan = pickMaxInstallmentsOptionWithoutInterest(\n installmentsListMastercardMax\n )\n\n expect(pickedInstallmentsPlan.NumberOfInstallments).toBe(14)\n expect(pickedInstallmentsPlan.PaymentSystemName).toBe('Visa')\n expect(pickedInstallmentsPlan.InterestRate).toBe(0)\n })\n\n it('should pick the installments plan with the second highest NumberOfInstallments and no interest, due to filtering rules', () => {\n const pickedInstallmentsPlan = pickMaxInstallmentsOptionWithoutInterest(\n installmentsList,\n {\n paymentSystemName: 'Customer Credit',\n }\n )\n\n expect(pickedInstallmentsPlan.NumberOfInstallments).toBe(2)\n expect(pickedInstallmentsPlan.PaymentSystemName).toBe('Customer Credit')\n expect(pickedInstallmentsPlan.InterestRate).toBe(0)\n })\n\n it(\"should pick the installments plan with the highest NumberOfInstallments overall, if there isn't an option with no interest\", () => {\n const pickedInstallmentsPlan = pickMaxInstallmentsOptionWithoutInterest(\n visaInstallments\n )\n\n expect(pickedInstallmentsPlan.NumberOfInstallments).toBe(4)\n expect(pickedInstallmentsPlan.PaymentSystemName).toBe('Visa')\n })\n})\n\n```"
}
] |
code_product-price_08915dd8
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/modules/pickInstallments.ts from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { ProductTypes } from 'vtex.product-context'\n\ntype ClusterBy = keyof ProductTypes.Installment\n\n/**\n * Pick which installments should be used. First it clusters all installments\n * by the value of clusterBy, then picks the cluster with the biggest amount of\n * installments options and then return this list sorted by the amount of installments\n * @param installmentsList All installments\n * @param clusterBy\n */\nexport default function pickInstallmentsList(\n installmentsList: ProductTypes.Installment[],\n clusterBy: ClusterBy\n) {\n const clusteredInstallments = clusterInstallments(installmentsList, clusterBy)\n\n const pickedInstallments = pickMaxOptionCount(\n clusteredInstallments,\n clusterBy\n )\n\n return pickedInstallments.sort(\n (a, b) => a.NumberOfInstallments - b.NumberOfInstallments\n )\n}\n\n/**\n * Cluster installments by the passed key of installments type\n * @param installmentsList List of installments to be clustered\n * @param clusterBy Key to be clustered by\n */\nexport function clusterInstallments(\n installmentsList: ProductTypes.Installment[],\n clusterBy: keyof ProductTypes.Installment\n) {\n const clusteredInstallments: Record<string, ProductTypes.Installment[]> = {}\n\n for (const installment of installmentsList) {\n if (!clusteredInstallments[installment[clusterBy]]) {\n clusteredInstallments[installment[clusterBy]] = []\n }\n\n clusteredInstallments[installment[clusterBy]].push(installment)\n }\n\n return clusteredInstallments\n}\n\n/**\n * Pick the cluster with the biggest amount of options, if there are multiple\n * clusters with the biggest amount it will pick the one that has an installment\n * with the biggest NumberOfInstallments of all options\n * @param clusteredInstallments\n * @param clusterBy\n */\nfunction pickMaxOptionCount(\n clusteredInstallments: Record<string, ProductTypes.Installment[]>,\n clusterBy: ClusterBy\n) {\n const clusterKeys = Object.keys(clusteredInstallments)\n let maxOptionCount = clusteredInstallments[clusterKeys[0]].length\n\n for (let i = 1; i < clusterKeys.length; i++) {\n const curOption = clusteredInstallments[clusterKeys[i]]\n\n if (maxOptionCount < curOption.length) {\n maxOptionCount = curOption.length\n }\n }\n\n const maxOptions = clusterKeys.filter(\n key => clusteredInstallments[key].length === maxOptionCount\n )\n\n if (maxOptions.length === 1) {\n return clusteredInstallments[maxOptions[0]]\n }\n\n let biggestInstallmentsOption =\n clusteredInstallments[maxOptions[0]][0].NumberOfInstallments\n\n let [biggestInstallmentsOptionKey]: Array<string | number> = maxOptions\n\n for (const key of maxOptions) {\n for (const installmentsOptions of clusteredInstallments[key]) {\n if (\n installmentsOptions.NumberOfInstallments > biggestInstallmentsOption\n ) {\n biggestInstallmentsOption = installmentsOptions.NumberOfInstallments\n biggestInstallmentsOptionKey = installmentsOptions[clusterBy]\n }\n }\n }\n\n return clusteredInstallments[biggestInstallmentsOptionKey]\n}\n\nfunction applyFiltersToInstallmentsList(\n installmentsList: ProductTypes.Installment[],\n filteringRules: {\n paymentSystemName?: string\n installmentsQuantity?: number\n }\n) {\n let filteredInstallmentsList = installmentsList\n\n if (filteringRules.paymentSystemName) {\n filteredInstallmentsList = filteredInstallmentsList.filter(\n installmentsOption =>\n installmentsOption.PaymentSystemName ===\n filteringRules.paymentSystemName\n )\n }\n\n if (filteringRules.installmentsQuantity) {\n filteredInstallmentsList = filteredInstallmentsList.filter(\n installmentsOption =>\n installmentsOption.NumberOfInstallments ===\n filteringRules.installmentsQuantity\n )\n }\n\n return filteredInstallmentsList\n}\n\nexport function pickMaxInstallmentsOption(\n installmentsList: ProductTypes.Installment[],\n filteringRules?: {\n paymentSystemName?: string\n installmentsQuantity?: number\n }\n) {\n const filteredInstallmentsList = filteringRules\n ? applyFiltersToInstallmentsList(installmentsList, filteringRules)\n : installmentsList\n\n let [maxInstallmentOption] = filteredInstallmentsList\n\n filteredInstallmentsList.forEach(installmentOption => {\n if (\n installmentOption.NumberOfInstallments >\n maxInstallmentOption.NumberOfInstallments\n ) {\n maxInstallmentOption = installmentOption\n }\n })\n\n return maxInstallmentOption\n}\n\nexport function pickMaxInstallmentsOptionWithoutInterest(\n installmentsList: ProductTypes.Installment[],\n filteringRules?: {\n paymentSystemName?: string\n installmentsQuantity?: number\n }\n) {\n const installmentsWithoutInterest = installmentsList.filter(\n installmentsOption => installmentsOption.InterestRate === 0\n )\n\n // There aren't any no-interest options\n if (installmentsWithoutInterest.length === 0) {\n return pickMaxInstallmentsOption(installmentsList, filteringRules)\n }\n\n return pickMaxInstallmentsOption(installmentsWithoutInterest, filteringRules)\n}\n\n```"
}
] |
code_product-price_7bfca5ff
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/modules/slug.ts from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport slugify from 'slugify'\n\nexport function slug(str: string) {\n const replaced =\n (typeof str === 'string' && str.replace(/[*+~.()'\"!:@&[\\]]/g, '')) || ''\n\n const slugified = slugify(replaced, { lower: true }) || ''\n\n return slugified\n}\n\n```"
}
] |
code_product-price_3dcb7f40
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/modules/seller.ts from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { ProductTypes } from 'vtex.product-context'\n\nexport function getDefaultSeller(sellers?: ProductTypes.Seller[]) {\n if (!sellers || sellers.length === 0) {\n return\n }\n\n const defaultSeller = sellers.find(seller => seller.sellerDefault)\n\n if (!defaultSeller) {\n return sellers[0]\n }\n\n return defaultSeller\n}\n\n```"
}
] |
code_product-price_62c0688d
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/modules/hideProductPrice.ts from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ninterface HideProductPriceParams {\n alwaysShow: boolean\n availableQuantity: number\n}\n/**\n * hideProductPrice -> Logic to hide or show block based on props passed by store theme\n *\n * @export\n * @param {HideProductPriceParams} {\n * alwaysShow,\n * availableQuantity,\n * }\n * @returns {boolean}\n */\nexport function hideProductPrice({\n alwaysShow,\n availableQuantity,\n}: HideProductPriceParams): boolean {\n if (alwaysShow) {\n return false\n }\n\n return availableQuantity <= 0\n}\n\n```"
}
] |
code_product-price_1de44c4a
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/components/PriceLoadingSpinner/index.tsx from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { CssHandlesTypes } from 'vtex.css-handles'\n\nimport styles from './styles.css'\n\nexport const CSS_HANDLES = ['priceLoading'] as const\n\ninterface Props {\n handles: CssHandlesTypes.CssHandlesBag<typeof CSS_HANDLES>['handles']\n}\n\nfunction PriceLoadingSpinner({ handles }: Props) {\n return (\n <div className={`${handles.priceLoading} flex items-end w-100 h1 pr6`}>\n <div className={styles.priceSpinner} />\n </div>\n )\n}\n\nexport default PriceLoadingSpinner\n\n```"
}
] |
code_product-price_2bd37d02
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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-price/react/components/PriceLoadingSpinner/styles.css from the product-price VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.priceSpinner {\n border: 2px solid rgba(0, 0, 0, 0.1);\n border-left-color: #4d4d4d;\n border-radius: 50%;\n width: 20px;\n height: 20px;\n animation: spin 0.5s linear infinite;\n}\n\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n```"
}
] |
code_checkout_61ed2637
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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/docs/README.md from the checkout VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```markdown\n# VTEX Checkout\n\n## Warning 🚨\n\nThis repository contains **experimental** code for VTEX Checkout.\n\nThis code is \"experimental\" for various reasons:\n- Some are not tested as rigorously as the main code.\n- Some are tested but not maintained.\n- It can suffer from significant changes (breaking changes) without further notice.\n\nThe only major we use in production is **0.x**.\n\n**Use it at your own risk!** ☠️\n\n```"
}
] |
code_checkout_15ed29be
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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/node/service.json from the checkout 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 \"routes\": {\n \"checkoutNext\": {\n \"path\": \"/checkout/_next/*path\",\n \"public\": true\n },\n \"checkout\": {\n \"path\": \"/checkout\",\n \"public\": true\n },\n \"cart\": {\n \"path\": \"/checkout/cart\",\n \"public\": true\n }\n }\n}\n\n```"
}
] |
code_checkout_1a6a32f0
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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/node/package.json from the checkout VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"name\": \"vtex.checkout\",\n \"version\": \"2.9.0\",\n \"private\": true,\n \"license\": \"UNLICENSED\",\n \"scripts\": {\n \"lint\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"cookie\": \"^0.4.2\"\n },\n \"devDependencies\": {\n \"@types/cookie\": \"^0.4.1\",\n \"@types/koa\": \"^2.0.39\",\n \"@types/node\": \"^12.0.0\",\n \"@vtex/api\": \"6.45.6\",\n \"typescript\": \"3.9.7\",\n \"vtex.checkout\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.checkout@2.8.3/public/@types/vtex.checkout\"\n }\n}\n\n```"
}
] |
code_checkout_1c4fcdc0
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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/node/global.d.ts from the checkout VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { ServiceContext } from '@vtex/api'\n\nimport { Clients } from './clients'\n\ndeclare global {\n type Context = ServiceContext<Clients>\n}\n\n```"
}
] |
code_checkout_42919785
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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/node/index.ts from the checkout VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { Service } from '@vtex/api'\n\nimport { Clients } from './clients'\nimport { renderPage } from './middlewares/renderPage'\n\nconst middlewares = [renderPage]\n\nexport default new Service({\n clients: {\n implementation: Clients,\n options: {},\n },\n routes: {\n checkoutNext: middlewares,\n checkout: middlewares,\n cart: middlewares,\n },\n})\n\n```"
}
] |
code_checkout_bb6f9635
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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/node/clients/fastcheckout.ts from the checkout VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { ExternalClient, IOContext, IOResponse } from '@vtex/api'\n\nconst BASE_URL = 'http://checkout.vtex.io'\n\nexport class FastCheckoutClient extends ExternalClient {\n constructor(context: IOContext) {\n super(BASE_URL, context, {\n timeout: 10_000,\n })\n }\n\n public getPage(\n pathname: string,\n cookies?: string\n ): Promise<IOResponse<string>> {\n const url = new URL(pathname, BASE_URL)\n\n url.searchParams.set('an', this.context.account)\n\n return this.http.getRaw(url.pathname + url.search, {\n headers: { 'X-Vtex-Use-Https': 'true', cookie: cookies ?? '' },\n })\n }\n}\n\n```"
}
] |
code_checkout_8f8ef5f9
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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/node/clients/index.ts from the checkout VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { IOClients } from '@vtex/api'\n\nimport { FastCheckoutClient } from './fastcheckout'\n\nexport class Clients extends IOClients {\n public get fastCheckout() {\n return this.getOrSet('fastCheckout', FastCheckoutClient)\n }\n}\n\n```"
}
] |
code_checkout_948426dc
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building 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/node/middlewares/renderPage.ts from the checkout VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { IOResponse } from '@vtex/api'\nimport { parse } from 'cookie'\n\nconst parseCookie = (cookie: string, domain?: string) => {\n const parsed = parse(cookie)\n const cookieName = Object.keys(parsed)[0] as string\n const cookieValue = parsed[cookieName]\n\n const extraOptions = {\n path: parsed.path,\n domain: domain ?? parsed.domain,\n expires: parsed.expires ? new Date(parsed.expires) : undefined,\n }\n\n return {\n name: cookieName,\n value: cookieValue,\n options: extraOptions,\n }\n}\n\nconst CHECKOUT_COOKIE = 'checkout.vtex.com'\n\nconst SetCookieWhitelist = [CHECKOUT_COOKIE, '.ASPXAUTH']\n\nconst isWhitelistedSetCookie = (cookie: string) => {\n const [key] = cookie.split('=')\n return SetCookieWhitelist.includes(key)\n}\n\nfunction forwardCheckoutCookies(rawHeaders: Record<string, any>, ctx: Context) {\n const responseSetCookies: string[] = rawHeaders?.['set-cookie'] || []\n\n const host = ctx.get('x-forwarded-host')\n const forwardedSetCookies = responseSetCookies.filter(isWhitelistedSetCookie)\n\n const parseAndClean = (cookie: string) => parseCookie(cookie, host)\n\n const cleanCookies = forwardedSetCookies.map(parseAndClean)\n\n cleanCookies.forEach(({ name, value, options }) =>\n ctx.cookies.set(name, value, options)\n )\n}\n\nexport async function renderPage(ctx: Context) {\n const pathname = ctx.path\n\n let renderResponse: IOResponse<string>\n\n try {\n const checkoutCookieValue = ctx.cookies.get(CHECKOUT_COOKIE)\n\n let checkoutCookie\n\n if (checkoutCookieValue != null) {\n checkoutCookie = `${CHECKOUT_COOKIE}=${checkoutCookieValue}`\n }\n\n renderResponse = await ctx.clients.fastCheckout.getPage(\n pathname,\n checkoutCookie\n )\n } catch (e) {\n if (!e.isAxiosError) {\n throw e\n }\n\n renderResponse = e.response\n }\n\n if (renderResponse.status === 308 /* permanent redirect */) {\n const redirectUrl = new URL(\n renderResponse.headers.location,\n `http://${ctx.get('x-forwarded-host')}`\n )\n\n if (redirectUrl.searchParams.has('an')) {\n redirectUrl.searchParams.delete('an')\n }\n\n renderResponse.headers.location = redirectUrl.pathname + redirectUrl.search\n }\n\n ctx.body = renderResponse.data\n ctx.status = renderResponse.status\n\n Object.entries(renderResponse.headers).forEach(\n ([headerName, headerValue]) => {\n if (headerName.toLowerCase() === 'set-cookie') {\n return\n }\n\n ctx.set(headerName, headerValue)\n }\n )\n\n forwardCheckoutCookies(renderResponse.headers, ctx)\n}\n\n```"
}
] |
code_biggy-bookstore-theme_e66d2bcf
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/sitemap/sitemap.json from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"urlset\": {\n \"url\": [\n {\n \"loc\": \"https://storetheme.vtex.com/about-us\"\n }\n ]\n }\n}\n```"
}
] |
code_biggy-bookstore-theme_e3f9a9d6
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/docs/README.md from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```markdown\n# Biggy Store theme\nA store-theme created during the first VTEX [hackatheme](hackatheme).\n\n## Preview\n\n\n\n\n\n\n```"
}
] |
code_biggy-bookstore-theme_f71a48eb
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/blocks.jsonc from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n/* Blocks can be defined both on the store/blocks.json file, and in any number of json\n * files inside the store/blocks directory, with any arbitrary directory structure.\n *\n * Additionally, all blocks files can support comments, such as this one, if given the\n * .jsonc file extension.\n *\n * The store/blocks.json file is intended for backwards compatibility, for miscellaneous\n * blocks, or if the app is simple enough that it doesn't warrant splitting the file.\n */\n{\n \"store.orderplaced\": {\n \"blocks\": [\"order-placed\"]\n },\n\n \"store.account\": {\n \"blocks\": [\"my-account\"],\n \"parent\": {\n \"challenge\": \"challenge.profile\"\n }\n },\n\n \"store.login\": {\n \"blocks\": [\"login-content#default\"]\n },\n\n \"login-content#default\": {\n \"props\": {\n \"isInitialScreenOptionOnly\": false,\n \"defaultOption\": 1,\n \"showPasswordVerificationIntoTooltip\": true\n }\n },\n\n \"product-summary.shelf\": {\n \"children\": [\n \"product-summary-add-to-list-button\",\n \"stack-layout#prodsum\",\n \"product-summary-name\",\n \"product-rating-inline\",\n \"product-summary-space\",\n \"product-summary-price\",\n \"product-identifier.summary\",\n \"product-summary-buy-button\"\n ]\n },\n\n \"stack-layout#prodsum\": {\n \"children\": [\n \"product-summary-image\",\n \"product-summary-specification-badges\"\n ]\n },\n\n \"product-summary-specification-badges\": {\n \"props\": {\n \"specificationGroupName\": \"Group\",\n \"specificationName\": \"On Sale\",\n \"visibleWhen\": \"True\",\n \"displayValue\": \"SPECIFICATION_NAME\"\n }\n },\n\n \"store.product-review-form\": {\n \"blocks\": [\"product-review-form\"]\n }\n}\n\n```"
}
] |
code_biggy-bookstore-theme_ccc05ca1
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/routes.json from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"store.custom#about-us\": {\n \"path\": \"/about-us\"\n },\n\n \"store.custom#landing-page\": {\n \"path\": \"/lp\"\n }\n}\n\n```"
}
] |
code_biggy-bookstore-theme_90053f33
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/styles/css/vtex.minicart.css from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.container svg {\n color: #fafafa;\n}\n\n.badge {\n background-color: #1e88e5;\n box-shadow: 1px 1px 3px 0px #33333350\n}\n```"
}
] |
code_biggy-bookstore-theme_d3bf7f50
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/styles/css/vtex.rich-text.css from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.container {\n display: flex;\n justify-content: center;\n}\n\n.container--deals {\n color: #ffffff;\n text-align: center;\n justify-content: center;\n}\n\n.container--deals .paragraph {\n margin: 0;\n}\n\n.container--link {\n justify-content: center;\n}\n\n.container--question {\n justify-content: center;\n}\n\n.container--question .paragraph {\n text-align: center;\n max-width: 540px;\n margin: 0 16px;\n padding-top: 120px;\n color: #03034E;\n}\n\n.container--question .strong {\n font-size: 32px;\n line-height: 2rem;\n font-weight: 700;\n}\n\n.container--link .paragraph {\n text-align: center;\n max-width: 540px;\n padding-top: 36px;\n padding-bottom: 84px;\n color: #03034E;\n}\n\n.container--link .strong {\n font-size: 16px;\n font-weight: 700;\n text-transform: uppercase;\n}\n\n.container--link .link {\n text-decoration: none;\n font-size: 36px;\n font-weight: 300;\n color: #03034E;\n}\n\n.container--title {\n color: #03034E;\n font-size: 28px;\n font-weight: 700;\n}\n\n@media only screen and (min-width: 640px) {\n .container--question .strong {\n font-size: 40px;\n line-height: 3rem;\n }\n\n .container--about {\n max-width: 85%;\n }\n\n .container--title {\n color: #03034E;\n font-size: 40px;\n font-weight: 700;\n max-width: 60%;\n }\n\n .container--title .paragraph {\n line-height: 1.3em;\n }\n}\n\n```"
}
] |
code_biggy-bookstore-theme_7b9622b2
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/styles/css/vtex.login.css from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.label {\n color: #fff;\n}\n\n.label:hover {\n color: #222;\n}\n```"
}
] |
code_biggy-bookstore-theme_768f02b8
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/styles/css/vtex.product-summary.css from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.SKUSelectorContainer {\n min-height: 29px;\n}\n\n.priceContainer {\n min-height: 65px;\n}\n\n.nameContainer {\n min-height: 84px;\n}\n\n@media only screen and (min-width: 1026px) {\n .buyButton {\n opacity: 0;\n transition: all 0.2s ease-out;\n }\n}\n\n.container:hover {\n transform: scale(1.025);\n transition: 0.2s;\n}\n\n.container {\n max-height: 573px;\n}\n\n.container:hover .buyButton {\n opacity: 1;\n}\n\n```"
}
] |
code_biggy-bookstore-theme_9ab16a7f
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/styles/css/vtex.store-header.css from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.headerRow--menu-link :global(.vtex-menu-2-x-styledLink) {\n color: #ffffff;\n font-size: 14px;\n}\n\n.headerRow .headerRowBackground {\n background-color: #4FC3F7;\n}\n\n.headerRow--main-header :global(.vtex-menu-2-x-styledLink) {\n font-size: 14px;\n}\n\n.headerRow--main-header-mobile .headerRowBackground {\n padding: 10px 0px;\n background-color: #4FC3F7;\n}\n\n.headerRowBackground--input-header-mobile {\n background: #4FC3F7;\n}\n\n.headerRowContainer--main-header-mobile {\n display: flex;\n justify-content: space-between;\n}\n\n.headerRowContainer--input-header-mobile {\n display: flex;\n justify-content: center;\n}\n\n@media only screen and (min-width: 640px) {\n .headerRowContainer--secondary-header {\n justify-content: flex-start;\n align-items: center;\n }\n\n .headerRowContainer--main-header {\n justify-content: space-between;\n align-items: center;\n }\n}\n\n.headerRowBackground.headerRowBackground--secondary-header {\n background-color: #e6e6e6;\n}\n```"
}
] |
code_biggy-bookstore-theme_36f1bb8d
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/styles/css/vtex.store-components.css from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.notificationBarContainer {\n background-color: #e6f1e6;\n color: #03034e;\n font-weight: 700;\n font-size: 12px;\n text-decoration: underline;\n}\n\n.searchBarContainer {\n max-width: 95%;\n padding-top: 0;\n}\n\n.searchBarIcon svg {\n color: #222;\n}\n\n.infoCardContainer--info-card-home {\n max-width: 1520px;\n margin: 0 auto;\n background-color: #e6f1e6;\n padding: 0px;\n}\n\n.newsletter {\n background-color: #03054e;\n max-width: 1528px;\n margin: 0 auto;\n}\n\n.newsletter .container {\n padding: 60px 10px;\n}\n\n.label {\n color: #fff;\n font-size: 26px;\n}\n\n.inputGroup {\n padding-bottom: 4px;\n border-bottom: 2px solid #fff;\n display: flex;\n}\n\n.inputGroup input {\n background-color: transparent;\n color: #fff;\n border: none;\n padding-left: 0px;\n}\n\n.inputGroup input::placeholder {\n color: #fff;\n font-size: 16px;\n}\n\n.inputGroup button {\n background-color: transparent;\n color: #fff;\n border: none;\n margin-right: -24px;\n}\n\n.buttonContainer {\n padding-top: 0px;\n}\n\n.imageElement--storePrint {\n max-height: 300px;\n margin-bottom: 20px;\n}\n\n@media only screen and (min-width: 640px) {\n .newsletter .container {\n padding: 140px;\n }\n\n .label {\n font-size: 40px;\n }\n\n .infoCardContainer--info-card-home .infoCardTextContainer {\n width: 30%;\n }\n\n .infoCardContainer--info-card-home .infoCardImageContainer {\n width: 70%;\n }\n\n .imageElement--storePrint {\n margin-bottom: 0px;\n max-height: 600px;\n }\n\n .searchBarContainer {\n max-width: 60%;\n margin-top: 15px;\n }\n}\n\n.skuSelectorTextContainer {\n display: none;\n}\n.skuSelectorOptionsList {\n justify-content: center;\n}\n.skuSelectorItem {\n width: 42%;\n height: 20px;\n}\n\n.skuSelectorItemTextValue {\n font-size: 10px;\n padding-left: 0;\n}\n\n.frameAround {\n border-radius: 0;\n}\n\n.diagonalCross {\n background-image: none;\n opacity: 0.2;\n}\n\n.diagonalCross ~ div {\n opacity: 0.2;\n}\n\n.SKUSelectorContainer {\n min-height: 25px;\n}\n\n.skuSelectorSubcontainer {\n margin-bottom: 0;\n}\n\n.imageElement {\n max-width: 100% !important;\n}\n\n.newsletter {\n max-width: initial;\n}\n\n.newsletter .container {\n padding: 10px;\n}\n\n.newsletter .container .inputGroup {\n border: 0px;\n}\n\n.logoContainer {\n padding-top: 9px;\n padding-bottom: 0;\n display: inline-block;\n text-align: center;\n}\n\n```"
}
] |
code_biggy-bookstore-theme_47a77c13
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/styles/css/vtex.store-footer.css from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.row--menu-row {\n padding-right: 24px;\n}\n\n.row--menu-row .rowContainer {\n align-items: flex-start;\n}\n\n.row--payment-methods {\n padding-top: 16px;\n}\n\n.socialNetworksContainer,\n.acceptedPaymentMethodContainer {\n justify-content: center;\n}\n\n.footerLayout {\n background-color: #e6e6e6;\n}\n\n```"
}
] |
code_biggy-bookstore-theme_ab622289
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/styles/css/vtex.styleguide.css from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.hideDecorators:focus {\n outline: none;\n}\n\n.hideDecorators {\n border-top-left-radius: .25rem !important;\n border-bottom-left-radius: .25rem !important;\n}\n```"
}
] |
code_biggy-bookstore-theme_4066de2c
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/styles/css/vtex.store-drawer.css from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.openIconContainer--drawer-icon svg {\n color: #000;\n}\n\n.closeIconContainer--drawer-icon {\n display: flex;\n justify-content: flex-end;\n}\n\n.menuItem .styledLink{\n color:black;\n}\n```"
}
] |
code_biggy-bookstore-theme_c786c81b
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/styles/css/vtex.flex-layout.css from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.flexRow--deals {\n background-color: #a7afbd;\n padding: 14px 0px;\n}\n\n.flexRow--deals .stretchChildrenWidth {\n align-items: center;\n}\n\n.flexRow--deals .flexCol {\n align-items: center;\n}\n\n.flexCol--filterCol {\n max-width: 500px;\n min-width: 230px;\n}\n\n.flexCol--productCountCol {\n align-items: flex-start;\n}\n\n.flexCol--orderByCol {\n align-items: flex-end;\n}\n\n.flexCol--orderByMobileCol {\n width: 42%;\n}\n\n.flexCol--filterMobileCol {\n width: 38%;\n}\n\n.flexCol--switcherMobileCol {\n width: 20%;\n}\n\n```"
}
] |
code_biggy-bookstore-theme_48948a6f
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/styles/css/vtex.menu.css from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.menuContainer--center-menu .styledLink div {\n justify-content: center;\n}\n.menuItem--side-menu-link a {\n color: #fff;\n}\n\n```"
}
] |
code_biggy-bookstore-theme_1d83d544
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/styles/css/vtex.carousel.css from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.containerImg {\n background-color: #F0F0F0;\n}\n\n.containerImg img {\n max-width: 1520px;\n}\n\n```"
}
] |
code_biggy-bookstore-theme_32d81367
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/styles/css/vtex.search-result.css from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n@media only screen and (min-width: 1026px) {\n .categoriesContainer {\n flex-direction: row;\n justify-content: center;\n }\n\n .filter {\n text-align: center;\n }\n\n .filter__container--c .filterTitle {\n display: inline-block;\n margin-bottom: 5px;\n }\n\n .flexRow--filterCol {\n text-align: center;\n }\n\n div.categoryItemChildrenContainer {\n position: absolute;\n background: #fff;\n width: 100%;\n left: 0;\n z-index: 1;\n height: 0;\n overflow: hidden;\n opacity: 0;\n transition: all 0.4s ease-out;\n box-shadow: 1px 1px rgba(0, 0, 0, 0.2);\n }\n\n div.categoryItemChildrenContainer > div {\n margin-top: 25px;\n display: flex;\n justify-content: center;\n }\n\n .categoryGroup:hover .categoryItemChildrenContainer {\n height: 70px;\n opacity: 1;\n }\n\n .categoryGroup {\n margin: 0 20px;\n }\n\n .filter__container:not(.filter__container--c) {\n position: relative;\n display: inline-block;\n text-align: center;\n width: 250px;\n }\n\n .filter_container {\n border-top: 1px solid #979899;\n border-bottom: 1px solid #979899;\n }\n\n .filterIcon {\n display: inline;\n }\n\n .filters--layout {\n text-align: center;\n }\n\n .filterTitle {\n display: inline-block;\n text-align: center;\n }\n\n .filterAvailable ~ div {\n position: absolute;\n z-index: 2;\n width: 100%;\n }\n\n .filterItem {\n display: flex;\n justify-content: center;\n }\n\n .filterItem > div {\n min-width: 100px;\n }\n\n span.categoryItemName {\n width: 250px;\n display: inline-block;\n text-align: center;\n }\n\n .filter__container--title {\n width: 100% !important;\n }\n\n .selectedCategory {\n justify-content: center;\n }\n}\n\n.galleryTitle--layout {\n text-align: center;\n letter-spacing: 2px;\n font-size: 22px;\n}\n\n.buttonShowMore {\n margin-bottom: 15px;\n}\n```"
}
] |
code_biggy-bookstore-theme_35fc7cc1
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/styles/configs/style.json from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"typeScale\": [\n 3, 2.25, 1.5, 1.25, 1, 0.875, 0.75\n ],\n \"spacing\": [0.125, 0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4, 8, 16],\n \"customMedia\": [\n { \"s\": 20 },\n { \"ns\": {\n \"value\": 40,\n \"minWidth\": true\n }\n },\n { \"m\": {\n \"value\": 40,\n \"minWidth\": true\n }\n },\n { \"l\": {\n \"value\": 64,\n \"minWidth\": true\n }\n },\n { \"xl\": {\n \"value\": 80,\n \"minWidth\": true\n }\n }\n ],\n \"colors\": {\n \"black-90\": \"rgba(0,0,0,.9)\",\n \"black-80\": \"rgba(0,0,0,.8)\",\n \"black-70\": \"rgba(0,0,0,.7)\",\n \"black-60\": \"rgba(0,0,0,.6)\",\n \"black-50\": \"rgba(0,0,0,.5)\",\n \"black-40\": \"rgba(0,0,0,.4)\",\n \"black-30\": \"rgba(0,0,0,.3)\",\n \"black-20\": \"rgba(0,0,0,.2)\",\n \"black-10\": \"rgba(0,0,0,.1)\",\n \"black-05\": \"rgba(0,0,0,.05)\",\n \"black-025\": \"rgba(0,0,0,.025)\",\n \"black-0125\": \"rgba(0,0,0,.0125)\",\n\n \"white-90\": \"rgba(255,255,255,.9)\",\n \"white-80\": \"rgba(255,255,255,.8)\",\n \"white-70\": \"rgba(255,255,255,.7)\",\n \"white-60\": \"rgba(255,255,255,.6)\",\n \"white-50\": \"rgba(255,255,255,.5)\",\n \"white-40\": \"rgba(255,255,255,.4)\",\n \"white-30\": \"rgba(255,255,255,.3)\",\n \"white-20\": \"rgba(255,255,255,.2)\",\n \"white-10\": \"rgba(255,255,255,.1)\",\n \"white-05\": \"rgba(255,255,255,.05)\",\n \"white-025\": \"rgba(255,255,255,.025)\",\n \"white-0125\": \"rgba(255,255,255,.0125)\"\n },\n \"semanticColors\": {\n \"background\": {\n \"base\": \"#ffffff\",\n \"base--inverted\": \"#222222\",\n \"action-primary\": \"#4FC3F7\",\n \"action-secondary\": \"#eef3f7\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#f2f4f5\",\n \"success\": \"#66bb6a\",\n \"success--faded\": \"#c8e6c9\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ef5350\",\n \"warning--faded\": \"#ffcdd2\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"hover-background\": {\n \"action-primary\": \"#072c75\",\n \"action-secondary\": \"#4FC3F7\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#66bb6a\",\n \"success--faded\": \"#c8e6c9\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ef5350\",\n \"warning--faded\": \"#ffcdd2\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"active-background\": {\n \"action-primary\": \"#0c389f\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#66bb6a\",\n \"success--faded\": \"#c8e6c9\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ef5350\",\n \"warning--faded\": \"#ffcdd2\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"text\": {\n \"action-primary\": \"#4FC3F7\",\n \"action-secondary\": \"#eef3f7\",\n \"link\": \"#4FC3F7\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#979899\",\n \"success\": \"#66bb6a\",\n \"success--faded\": \"#c8e6c9\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ef5350\",\n \"warning--faded\": \"#ffcdd2\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"visited-text\": {\n \"link\": \"#0c389f\"\n },\n \"hover-text\": {\n \"action-primary\": \"#072c75\",\n \"action-secondary\": \"#dbe9fd\",\n \"link\": \"#0c389f\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#66bb6a\",\n \"success--faded\": \"#c8e6c9\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ef5350\",\n \"warning--faded\": \"#ffcdd2\"\n },\n \"active-text\": {\n \"link\": \"#0c389f\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#66bb6a\",\n \"success--faded\": \"#c8e6c9\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ef5350\",\n \"warning--faded\": \"#ffcdd2\"\n },\n \"border\": {\n \"action-primary\": \"#4FC3F7\",\n \"action-secondary\": \"#eef3f7\",\n \"emphasis\": \"#f71963\",\n \"disabled\": \"#e3e4e6\",\n \"success\": \"#66bb6a\",\n \"success--faded\": \"#c8e6c9\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ef5350\",\n \"warning--faded\": \"#ffcdd2\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"transparent\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"hover-border\": {\n \"action-primary\": \"#072c75\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#66bb6a\",\n \"success--faded\": \"#c8e6c9\",\n \"danger\": \"#e13232\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ef5350\",\n \"warning--faded\": \"#ffcdd2\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"#979899\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"active-border\": {\n \"action-primary\": \"#0c389f\",\n \"action-secondary\": \"#dbe9fd\",\n \"emphasis\": \"#dd1659\",\n \"success\": \"#66bb6a\",\n \"success--faded\": \"#c8e6c9\",\n \"danger\": \"#ff4c4c\",\n \"danger--faded\": \"#ffe6e6\",\n \"warning\": \"#ef5350\",\n \"warning--faded\": \"#ffcdd2\",\n \"muted-1\": \"#727273\",\n \"muted-2\": \"transparent\",\n \"muted-3\": \"#cacbcc\",\n \"muted-4\": \"#e3e4e6\",\n \"muted-5\": \"#f2f4f5\"\n },\n \"on\": {\n \"base\": \"#222222\",\n \"base--inverted\": \"#ffffff\",\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#4FC3F7\",\n \"emphasis\": \"#ffffff\",\n \"disabled\": \"#979899\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\",\n \"muted-1\": \"#ffffff\",\n \"muted-2\": \"#ffffff\",\n \"muted-3\": \"#3f3f40\",\n \"muted-4\": \"#3f3f40\",\n \"muted-5\": \"#3f3f40\"\n },\n \"hover-on\": {\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#4FC3F7\",\n \"emphasis\": \"#ffffff\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\"\n },\n \"active-on\": {\n \"action-primary\": \"#ffffff\",\n \"action-secondary\": \"#4FC3F7\",\n \"emphasis\": \"#ffffff\",\n \"success\": \"#ffffff\",\n \"success--faded\": \"#3f3f40\",\n \"danger\": \"#ffffff\",\n \"danger--faded\": \"#3f3f40\",\n \"warning\": \"#ffffff\",\n \"warning--faded\": \"#1a1a1a\"\n }\n },\n \"borderWidths\": [0, 0.125, 0.25, 0.5, 1, 2],\n \"borderRadius\": [0, 0.125, 0.25, 0.5, 1],\n \"widths\": [1, 2, 4, 8, 16],\n \"maxWidths\": [1, 2, 4, 8, 16, 32, 48, 64, 96],\n \"heights\": [1, 2, 4, 8, 16],\n \"sizes\": [\n {\"name\": \"small\", \"value\": 2},\n {\"name\": \"regular\", \"value\": 2.5},\n {\"name\": \"large\", \"value\": 3}\n ],\n \"typography\":{\n \"measure\": [30, 34, 20],\n \"styles\": {\n \"heading-1\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"3rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-2\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"2.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-3\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"700\",\n \"fontSize\": \"1.75rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-4\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.5rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-5\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"heading-6\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"body\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"small\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"0.875rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"mini\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"0.75rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n },\n \"action\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"action--small\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"0.875rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"action--large\": {\n \"fontFamily\": \"San Francisco, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif\",\n \"fontWeight\": \"500\",\n \"fontSize\": \"1.25rem\",\n \"textTransform\": \"uppercase\",\n \"letterSpacing\": \"0\"\n },\n \"code\": {\n \"fontFamily\": \"Consolas, monaco, monospace\",\n \"fontWeight\": \"normal\",\n \"fontSize\": \"1rem\",\n \"textTransform\": \"initial\",\n \"letterSpacing\": \"0\"\n }\n }\n },\n \"opacity\": [1, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.05, 0.025, 0]\n}\n\n```"
}
] |
code_biggy-bookstore-theme_229ec6ba
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/blocks/product-assembly.jsonc from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"sticky-layout#buy-button\": {\n \"props\": {\n \"position\": \"bottom\"\n },\n \"children\": [\"flex-layout.row#buy-button\"]\n },\n \"product-assembly-options\": {\n \"children\": [\n \"flex-layout.row#product-assembly-options\",\n \"assembly-option-input-values\"\n ]\n },\n \"assembly-option-input-values\": {\n \"props\": {\n \"optionsDisplay\": \"box\"\n }\n },\n \"flex-layout.row#product-assembly-options\": {\n \"props\": {\n \"colGap\": 2,\n \"preserveLayoutOnMobile\": true,\n \"colSizing\": \"auto\"\n },\n \"children\": [\n \"flex-layout.col#product-assembly-image\",\n \"flex-layout.col#product-assembly-middle\",\n \"flex-layout.col#product-assembly-quantity\"\n ]\n },\n \"flex-layout.col#product-assembly-quantity\": {\n \"props\": {\n \"verticalAlign\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-quantity-selector\"\n ]\n },\n \"flex-layout.col#product-assembly-image\": {\n \"props\": {\n \"marginRight\": 4\n },\n \"children\": [\n \"assembly-option-item-image\"\n ]\n },\n \"flex-layout.col#product-assembly-middle\": {\n \"props\": {\n \"width\": \"grow\",\n \"verticalAlignment\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-name\",\n \"assembly-option-item-price\",\n \"assembly-option-item-children-description\",\n \"assembly-option-item-customize#first-level\"\n ]\n },\n \"assembly-option-item-customize#first-level\": {\n \"props\": {\n \"buttonProps\": {\n \"collapse\": \"left\"\n }\n },\n \"children\": [\n \"flex-layout.row#item-customize\"\n ]\n },\n \"flex-layout.row#item-customize\": {\n \"props\": {\n \"colGap\": 2,\n \"preserveLayoutOnMobile\": true,\n \"colSizing\": \"auto\"\n },\n \"children\": [\n \"flex-layout.col#product-assembly-image\",\n \"flex-layout.col#item-customize-middle\",\n \"flex-layout.col#item-customize-quantity\"\n ]\n },\n \"flex-layout.col#item-customize-middle\": {\n \"props\": {\n \"width\": \"grow\",\n \"verticalAlignment\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-name\",\n \"assembly-option-item-price\",\n \"assembly-option-item-children-description\",\n \"assembly-option-item-customize#sec-level\"\n ]\n },\n \"flex-layout.col#item-customize-quantity\": {\n \"props\": {\n \"horizontalAlign\": \"right\",\n \"verticalAlign\": \"middle\"\n },\n \"children\": [\n \"assembly-option-item-quantity-selector\"\n ]\n },\n \"assembly-option-item-customize#sec-level\": {\n \"props\": {\n \"buttonProps\": {\n \"collapse\": \"left\"\n }\n },\n \"children\": [\n \"assembly-option-item-image\",\n \"assembly-option-item-name\",\n \"assembly-option-item-price\",\n \"assembly-option-item-quantity-selector\"\n ]\n }\n}\n```"
}
] |
code_biggy-bookstore-theme_0bdccca4
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/blocks/about-us.json from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"store.custom#about-us\": {\n \"blocks\": [\n \"flex-layout.row#about-us\"\n ]\n },\n\n \"flex-layout.row#about-us\": {\n \"children\": [\n \"image#mobile-phone\",\n \"flex-layout.col#text-about-us\"\n ]\n },\n\n \"flex-layout.col#text-about-us\": {\n \"children\": [\n \"rich-text#title-about-us\",\n \"rich-text#about-us\"\n ],\n \"props\": {\n \"blockclass\": \"textColumn\",\n \"preventVerticalStretch\": true\n }\n },\n\n \"rich-text#title-about-us\": {\n \"props\": {\n \"text\":\n \"# Create meaningful and relevant experiences.\",\n \"blockClass\": \"title\"\n }\n },\n\n \"image#mobile-phone\": {\n \"props\": {\n \"src\": \"https://storecomponents.vteximg.com.br/arquivos/mobile-phone.png\",\n \"maxHeight\": \"\",\n \"maxWidth\": \"\",\n \"blockClass\": \"storePrint\"\n }\n },\n\n \"rich-text#about-us\": {\n \"props\": {\n \"text\": \"**Optimized store framework** \\n Free your front-end with our React + Node store framework. Improve usability and SEO, while driving more conversion with modular components, single page applications, and a ready-for-PWA structure. \\n **Multi-currency and language** \\n Go international with multiple storefronts to support different languages and easily manage local currencies and payment conditions. \\n **Serverless development platform** \\n Reduce loading time, improve usability, and make the best out of SEO. Developing scalable components with a comprehensive, easy-to-use toolset, you can build stores faster than ever.\",\n \"blockClass\": \"about\"\n }\n }\n}\n```"
}
] |
code_biggy-bookstore-theme_5581ce46
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/blocks/landing-page.jsonc from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"store.custom#landing-page\": {\n \"blocks\": [\n \"flex-layout.row#banner-lp\",\n \"responsive-layout.phone#lp1\",\n \"flex-layout.row#landing-page1\",\n \"responsive-layout.phone#lp2\",\n \"flex-layout.row#landing-page2\",\n \"responsive-layout.phone#lp3\",\n \"flex-layout.row#landing-page3\"\n ]\n },\n\n \"flex-layout.row#banner-lp\": {\n \"props\": {\n \"fullWidth\": true,\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"image#banner-lp\"\n ]\n },\n\n \"image#banner-lp\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerlp___c4ffc133e9dbf6562aadefc3f7e97f11.png\",\n \"alt\": \"Landing Page Banner\"\n }\n },\n\n \"flex-layout.row#landing-page1\": {\n \"props\": {\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"flex-layout.col#lp1-products\",\n \"responsive-layout.desktop#lp1\"\n ]\n },\n\n \"responsive-layout.desktop#lp1\": {\n \"children\": [\n \"flex-layout.col#lp1-card\"\n ]\n },\n\n \"responsive-layout.phone#lp1\": {\n \"children\": [\n \"flex-layout.row#lp1-card-phone\"\n ]\n },\n\n \"flex-layout.col#lp1-products\": {\n \"props\": {\n \"width\": \"70%\"\n },\n \"children\": [\n \"flex-layout.row#lp1-products\"\n ]\n },\n\n \"flex-layout.row#lp1-products\": {\n \"children\": [\n \"shelf#lp1-products\"\n ]\n },\n\n \"shelf#lp1-products\": {\n \"blocks\": [\n \"product-summary.shelf#sku\"\n ],\n \"props\": {\n \"category\": \"1/9\",\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"productList\": {\n \"maxItems\": 10,\n \"itemsPerPage\": 3,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"showTitle\": false,\n \"hideUnavailableItems\": true,\n \"summary\": {\n \"isOneClickBuy\": false,\n \"showBadge\": true,\n \"badgeText\": \"OFF\",\n \"buyButtonText\": \"Comprar\",\n \"displayBuyButton\": \"displayButtonHover\",\n \"showCollections\": false,\n \"showListPrice\": true,\n \"showLabels\": false,\n \"showInstallments\": true,\n \"showSavings\": true,\n \"name\": {\n \"showBrandName\": false,\n \"showSku\": false,\n \"showProductReference\": false\n }\n }\n }\n }\n },\n\n \"flex-layout.col#lp1-card\": {\n \"props\": {\n \"width\": \"30%\",\n \"verticalAlign\": \"middle\",\n \"horizontalAlign\": \"right\"\n },\n \"children\": [\n \"image#lp1-card\"\n ]\n },\n\n \"flex-layout.row#lp1-card-phone\": {\n \"props\": {\n \"marginTop\": 6,\n \"verticalAlign\": \"middle\",\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"image#lp1-card-phone\"\n ]\n },\n\n \"image#lp1-card\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerlp2___5c1534ae7ca0bc36356136d1ccac648d.png\"\n }\n },\n\n \"image#lp1-card-phone\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerlp2flipsmall___7f3a4abb4b6347751efa5330ac61f563.png\"\n }\n },\n\n \"flex-layout.row#landing-page2\": {\n \"props\": {\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"responsive-layout.desktop#lp2\",\n \"flex-layout.col#lp2-products\"\n ]\n },\n\n \"responsive-layout.desktop#lp2\": {\n \"children\": [\n \"flex-layout.col#lp2-card\"\n ]\n },\n\n \"responsive-layout.phone#lp2\": {\n \"children\": [\n \"flex-layout.row#lp2-card-phone\"\n ]\n },\n\n \"flex-layout.col#lp2-card\": {\n \"props\": {\n \"width\": \"30%\",\n \"verticalAlign\": \"middle\",\n \"horizontalAlign\": \"left\"\n },\n \"children\": [\n \"image#lp2-card\"\n ]\n },\n\n \"flex-layout.row#lp2-card-phone\": {\n \"props\": {\n \"verticalAlign\": \"middle\",\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"image#lp2-card-phone\"\n ]\n },\n\n \"image#lp2-card\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerlp2flip___6d82e6686be9c73a77ada8afe817e53a.png\"\n }\n },\n\n \"image#lp2-card-phone\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerlp2small___a13366cc34cc7ba994c15416887835e4.png\"\n }\n },\n\n \"flex-layout.col#lp2-products\": {\n \"props\": {\n \"width\": \"70%\"\n },\n \"children\": [\n \"flex-layout.row#lp2-products\"\n ]\n },\n\n \"flex-layout.row#lp2-products\": {\n \"children\": [\n \"shelf#lp2-products\"\n ]\n },\n\n \"shelf#lp2-products\": {\n \"blocks\": [\n \"product-summary.shelf#sku\"\n ],\n \"props\": {\n \"category\": \"1/6\",\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"productList\": {\n \"maxItems\": 10,\n \"itemsPerPage\": 3,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"showTitle\": false,\n \"hideUnavailableItems\": true,\n \"summary\": {\n \"isOneClickBuy\": false,\n \"showBadge\": true,\n \"badgeText\": \"OFF\",\n \"buyButtonText\": \"Comprar\",\n \"displayBuyButton\": \"displayButtonHover\",\n \"showCollections\": false,\n \"showListPrice\": true,\n \"showLabels\": false,\n \"showInstallments\": true,\n \"showSavings\": true,\n \"name\": {\n \"showBrandName\": false,\n \"showSku\": false,\n \"showProductReference\": false\n }\n }\n }\n }\n },\n\n \"flex-layout.row#landing-page3\": {\n \"props\": {\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"flex-layout.col#lp3-products\",\n \"responsive-layout.desktop#lp3\"\n ]\n },\n\n \"responsive-layout.phone#lp3\": {\n \"children\": [\n \"flex-layout.row#lp3-card-phone\"\n ]\n },\n\n \"responsive-layout.desktop#lp3\": {\n \"children\": [\n \"flex-layout.col#lp3-card\"\n ]\n },\n\n \"flex-layout.col#lp3-products\": {\n \"props\": {\n \"width\": \"70%\"\n },\n \"children\": [\n \"flex-layout.row#lp3-products\"\n ]\n },\n\n \"flex-layout.row#lp3-products\": {\n \"children\": [\n \"shelf#lp3-products\"\n ]\n },\n\n \"shelf#lp3-products\": {\n \"blocks\": [\n \"product-summary.shelf#sku\"\n ],\n \"props\": {\n \"category\": \"1/8\",\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"productList\": {\n \"maxItems\": 10,\n \"itemsPerPage\": 3,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"showTitle\": false,\n \"hideUnavailableItems\": true,\n \"summary\": {\n \"isOneClickBuy\": false,\n \"showBadge\": true,\n \"badgeText\": \"OFF\",\n \"buyButtonText\": \"Comprar\",\n \"displayBuyButton\": \"displayButtonHover\",\n \"showCollections\": false,\n \"showListPrice\": true,\n \"showLabels\": false,\n \"showInstallments\": true,\n \"showSavings\": true,\n \"name\": {\n \"showBrandName\": false,\n \"showSku\": false,\n \"showProductReference\": false\n }\n }\n }\n }\n },\n\n \"flex-layout.col#lp3-card\": {\n \"props\": {\n \"width\": \"30%\",\n \"verticalAlign\": \"middle\",\n \"horizontalAlign\": \"right\"\n },\n \"children\": [\n \"image#lp3-card\"\n ]\n },\n\n \"flex-layout.row#lp3-card-phone\": {\n \"props\": {\n \"verticalAlign\": \"middle\",\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"image#lp3-card-phone\"\n ]\n },\n\n \"image#lp3-card\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerlp2___5c1534ae7ca0bc36356136d1ccac648d.png\"\n }\n },\n\n \"image#lp3-card-phone\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerlp2flipsmall___7f3a4abb4b6347751efa5330ac61f563.png\"\n }\n }\n} \n```"
}
] |
code_biggy-bookstore-theme_e2e54355
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/blocks/product.json from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"store.product\": {\n \"children\": [\n \"flex-layout.row#product-breadcrumb\",\n \"flex-layout.row#product-main\",\n \"shelf.relatedProducts\",\n \"product-reviews\",\n \"product-questions-and-answers\"\n ]\n },\n \"flex-layout.row#product-breadcrumb\": {\n \"props\": {\n \"marginTop\": 4\n },\n \"children\": [\"breadcrumb\"]\n },\n \"flex-layout.row#product-main\": {\n \"props\": {\n \"colGap\": 7,\n \"rowGap\": 7,\n \"marginTop\": 4,\n \"marginBottom\": 7,\n \"paddingTop\": 7,\n \"paddingBottom\": 7\n },\n \"children\": [\"flex-layout.col#stack\", \"flex-layout.col#right-col\"]\n },\n\n \"stack-layout\": {\n \"children\": [\n \"flex-layout.row#product-image\",\n \"product-specification-badges\"\n ]\n },\n\n \"product-specification-badges\": {\n \"props\": {\n \"specificationGroupName\": \"Group\",\n \"specificationName\": \"On Sale\",\n \"visibleWhen\": \"True\",\n \"displayValue\": \"SPECIFICATION_NAME\"\n }\n },\n\n \"flex-layout.col#stack\": {\n \"children\": [\"stack-layout\"],\n \"props\": {\n \"width\": \"60%\",\n \"rowGap\": 0\n }\n },\n \"flex-layout.row#product-image\": {\n \"children\": [\"product-images\"]\n },\n \"product-images\": {\n \"props\": {\n \"displayThumbnailsArrows\": true\n }\n },\n \"flex-layout.col#right-col\": {\n \"props\": {\n \"preventVerticalStretch\": true,\n \"rowGap\": 0\n },\n \"children\": [\n \"product-name\",\n \"product-rating-summary\",\n \"product-price#product-details\",\n \"product-separator\",\n \"product-quantity\",\n \"product-identifier.product\",\n \"sku-selector\",\n \"product-assembly-options\",\n \"flex-layout.row#buy-button\",\n \"availability-subscriber\",\n \"shipping-simulator\",\n \"share#default\"\n ]\n },\n\n \"product-price#product-details\": {\n \"props\": {\n \"showInstallments\": true,\n \"showSavings\": true\n }\n },\n\n \"flex-layout.row#buy-button\": {\n \"props\": {\n \"marginTop\": 4,\n \"marginBottom\": 7\n },\n \"children\": [\"buy-button\"]\n },\n\n \"share#default\": {\n \"props\": {\n \"social\": {\n \"Facebook\": true,\n \"WhatsApp\": true,\n \"Twitter\": false,\n \"Pinterest\": true\n }\n }\n }\n}\n\n```"
}
] |
code_biggy-bookstore-theme_0df185a0
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/blocks/search.jsonc from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"store.search\": {\n \"blocks\": [\"search-result-layout\"]\n },\n \"store.search#brand\": {\n \"blocks\": [\"search-result-layout\"],\n \"props\": {\n \"context\": {\n \"orderByField\": \"OrderByReleaseDateDESC\",\n \"hideUnavailableItems\": true,\n \"maxItemsPerPage\": 10\n }\n }\n },\n\n \"store.search#department\": {\n \"blocks\": [\"search-result-layout\"]\n },\n\n \"store.search#category\": {\n \"blocks\": [\"search-result-layout\"]\n },\n\n \"store.search#subcategory\": {\n \"blocks\": [\"search-result-layout\"]\n },\n\n \"search-result-layout\": {\n \"blocks\": [\n \"search-result-layout.desktop\",\n \"search-result-layout.mobile\",\n \"search-not-found-layout\"\n ]\n },\n\n \"search-result-layout.desktop\": {\n \"children\": [\n \"flex-layout.row#searchbread\",\n \"flex-layout.row#searchtitle\",\n \"flex-layout.row#filter\",\n \"flex-layout.row#result\"\n ],\n \"props\": {\n \"pagination\": \"show-more\",\n \"mobileLayout\": {\n \"mode1\": \"small\",\n \"mode2\": \"normal\"\n }\n }\n },\n \"flex-layout.row#searchbread\": {\n \"children\": [\"breadcrumb.search\"],\n \"props\": {\n \"preserveLayoutOnMobile\": true,\n \"fullWidth\": true\n }\n },\n \"flex-layout.row#searchtitle\": {\n \"children\": [\"search-title.v2\"]\n },\n \"flex-layout.row#filter\": {\n \"children\": [\"filter-navigator.v3\"],\n \"props\": {\n \"blockClass\": \"filterCol\",\n \"fullWidth\": true,\n \"sticky\": true\n }\n },\n \"flex-layout.row#result\": {\n \"children\": [\"flex-layout.col#content\"]\n },\n \"flex-layout.col#content\": {\n \"children\": [\n \"flex-layout.row#searchinfo\",\n \"flex-layout.row#fetchprevious\",\n \"flex-layout.row#products\",\n \"flex-layout.row#fetchmore\"\n ],\n \"props\": {\n \"width\": \"grow\"\n }\n },\n \"flex-layout.row#searchinfo\": {\n \"children\": [\"flex-layout.col#productCount\", \"flex-layout.col#orderby\"]\n },\n \"flex-layout.col#productCount\": {\n \"children\": [\"total-products.v2\"],\n \"props\": {\n \"blockClass\": \"productCountCol\"\n }\n },\n \"flex-layout.col#orderby\": {\n \"children\": [\"order-by.v2\"],\n \"props\": {\n \"blockClass\": \"orderByCol\"\n }\n },\n \"flex-layout.row#fetchprevious\": {\n \"props\": {\n \"marginBottom\": 3\n },\n \"children\": [\"search-fetch-previous\"]\n },\n \"flex-layout.row#fetchmore\": {\n \"props\": {\n \"marginTop\": 3\n },\n \"children\": [\"search-fetch-more\"]\n },\n \"flex-layout.row#products\": {\n \"children\": [\"search-content\"]\n },\n \"search-content\": {\n \"blocks\": [\"gallery\", \"not-found\"]\n },\n\n \"search-result-layout.mobile\": {\n \"children\": [\n \"flex-layout.row#searchinfomobile\",\n \"flex-layout.row#searchbread\",\n \"flex-layout.row#productCountMobile\",\n \"flex-layout.row#contentmobile\"\n ],\n \"props\": {\n \"pagination\": \"show-more\",\n \"mobileLayout\": {\n \"mode1\": \"small\",\n \"mode2\": \"normal\"\n }\n }\n },\n \"flex-layout.row#contentmobile\": {\n \"children\": [\"search-content\"],\n \"props\": {\n \"preserveLayoutOnMobile\": true\n }\n },\n\n \"flex-layout.row#searchinfomobile\": {\n \"children\": [\n \"flex-layout.col#orderByMobile\",\n \"flex-layout.col#filterMobile\",\n \"flex-layout.col#switcherMobile\"\n ],\n \"props\": {\n \"preserveLayoutOnMobile\": true,\n \"colSizing\": \"auto\",\n \"colJustify\": \"around\"\n }\n },\n\n \"flex-layout.col#orderByMobile\": {\n \"children\": [\"order-by.v2\"],\n \"props\": {\n \"blockClass\": \"orderByMobileCol\"\n }\n },\n\n \"flex-layout.row#productCountMobile\": {\n \"children\": [\"total-products.v2\"],\n \"props\": {\n \"blockClass\": \"productCountMobileRow\"\n }\n },\n\n \"flex-layout.col#filterMobile\": {\n \"children\": [\"filter-navigator.v3\"],\n \"props\": {\n \"blockClass\": \"filterMobileCol\"\n }\n },\n \"flex-layout.col#switcherMobile\": {\n \"children\": [\"search-layout-switcher\"],\n \"props\": {\n \"blockClass\": \"switcherMobileCol\"\n }\n },\n \"search-not-found-layout\": {\n \"children\": [\"flex-layout.row#searchbread\", \"flex-layout.row#notfound\"]\n },\n\n \"flex-layout.row#notfound\": {\n \"children\": [\"not-found\"],\n \"props\": {\n \"fullWidth\": true\n }\n },\n\n \"breadcrumb\": {\n \"props\": {\n \"showOnMobile\": true\n }\n },\n \"product-summary.shelf#sku\": {\n \"children\": [\n \"product-summary-image\",\n \"product-summary-name\",\n \"product-summary-description\",\n \"product-summary-price\",\n \"product-rating-inline\",\n \"product-summary-sku-selector\",\n \"product-summary-buy-button\",\n \"product-rating-inline\"\n ]\n },\n \"gallery\": {\n \"blocks\": [\"product-summary.shelf#sku\"]\n }\n}\n\n```"
}
] |
code_biggy-bookstore-theme_5572e171
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/blocks/home/top-shelves.json from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"flex-layout.row#top-shelves\": {\n \"children\": [\n \"flex-layout.col#top-shelf1\",\n \"flex-layout.col#top-shelf2\",\n \"flex-layout.col#top-shelf3\",\n \"flex-layout.col#top-shelf4\"\n ],\n \"props\": {\n \"blockClass\": \"top-shelves\"\n }\n },\n \"flex-layout.col#top-shelf1\": {\n \"children\": [\n \"shelf#shelf1\"\n ]\n },\n \"shelf#shelf1\": {\n \"blocks\": [\"product-summary.shelf#sku\"],\n \"props\": {\n \"category\": \"1/9\",\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"productList\": {\n \"maxItems\": 10,\n \"itemsPerPage\": 1,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"titleText\": \"Best Sellers\",\n \"hideUnavailableItems\": true,\n \"paginationDotsVisibility\": \"hidden\",\n \"summary\": {\n \"isOneClickBuy\": false,\n \"showBadge\": true,\n \"badgeText\": \"OFF\",\n \"buyButtonText\": \"Buy\",\n \"displayBuyButton\": \"displayButtonHover\",\n \"showCollections\": false,\n \"showListPrice\": true,\n \"showLabels\": false,\n \"showInstallments\": true,\n \"showSavings\": true,\n \"name\": {\n \"showBrandName\": false,\n \"showSku\": false,\n \"showProductReference\": false\n }\n }\n }\n }\n },\n \"flex-layout.col#top-shelf2\": {\n \"children\": [\n \"shelf#shelf2\"\n ]\n },\n \"shelf#shelf2\": {\n \"blocks\": [\"product-summary.shelf#sku\"],\n \"props\": {\n \"category\": \"1/6\",\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"productList\": {\n \"maxItems\": 10,\n \"itemsPerPage\": 1,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"titleText\": \"New Releases\",\n \"hideUnavailableItems\": true,\n \"paginationDotsVisibility\": \"hidden\",\n \"summary\": {\n \"isOneClickBuy\": false,\n \"showBadge\": true,\n \"badgeText\": \"OFF\",\n \"buyButtonText\": \"Buy\",\n \"displayBuyButton\": \"displayButtonHover\",\n \"showCollections\": false,\n \"showListPrice\": true,\n \"showLabels\": false,\n \"showInstallments\": true,\n \"showSavings\": true,\n \"name\": {\n \"showBrandName\": false,\n \"showSku\": false,\n \"showProductReference\": false\n }\n }\n }\n }\n },\n \"flex-layout.col#top-shelf3\": {\n \"children\": [\n \"shelf#shelf3\"\n ]\n },\n \"shelf#shelf3\": {\n \"blocks\": [\"product-summary.shelf#sku\"],\n \"props\": {\n \"category\": \"1/8\",\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"productList\": {\n \"maxItems\": 10,\n \"itemsPerPage\": 1,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"titleText\": \"Offers\",\n \"hideUnavailableItems\": true,\n \"paginationDotsVisibility\": \"hidden\",\n \"summary\": {\n \"isOneClickBuy\": false,\n \"showBadge\": true,\n \"badgeText\": \"OFF\",\n \"buyButtonText\": \"Buy\",\n \"displayBuyButton\": \"displayButtonHover\",\n \"showCollections\": false,\n \"showListPrice\": true,\n \"showLabels\": false,\n \"showInstallments\": true,\n \"showSavings\": true,\n \"name\": {\n \"showBrandName\": false,\n \"showSku\": false,\n \"showProductReference\": false\n }\n }\n }\n }\n },\n \"flex-layout.col#top-shelf4\": {\n \"children\": [\n \"shelf#shelf4\"\n ]\n },\n \"shelf#shelf4\": {\n \"blocks\": [\"product-summary.shelf#sku\"],\n \"props\": {\n \"category\": \"3/10\",\n \"orderBy\": \"OrderByTopSaleDESC\",\n \"productList\": {\n \"maxItems\": 10,\n \"itemsPerPage\": 1,\n \"scroll\": \"BY_PAGE\",\n \"arrows\": true,\n \"titleText\": \"eBooks\",\n \"hideUnavailableItems\": true,\n \"paginationDotsVisibility\": \"hidden\",\n \"summary\": {\n \"isOneClickBuy\": false,\n \"showBadge\": true,\n \"badgeText\": \"OFF\",\n \"buyButtonText\": \"Buy\",\n \"displayBuyButton\": \"displayButtonHover\",\n \"showCollections\": false,\n \"showListPrice\": true,\n \"showLabels\": false,\n \"showInstallments\": true,\n \"showSavings\": true,\n \"name\": {\n \"showBrandName\": false,\n \"showSku\": false,\n \"showProductReference\": false\n }\n }\n }\n }\n }\n}\n```"
}
] |
code_biggy-bookstore-theme_45a26f4d
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/blocks/home/home.jsonc from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"store.home\": {\n \"blocks\": [\"flex-layout.row#banner-home\", \"flex-layout.row#top-shelves\", \"flex-layout.row#deals\"]\n },\n\n \"flex-layout.row#banner-home\": {\n \"props\": {\n \"fullWidth\": true,\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\n \"image#banner-home\"\n ]\n},\n\n\"image#banner-home\": {\n \"props\": {\n \"src\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bannerhome___61eea668a733cfec1868ed36b2e5954d.png\",\n \"alt\": \"Home Page Banner\",\n \"link\": {\n \"url\": \"lp\",\n \"attributeTitle\": \"Landing Page\",\n \"newTab\": false\n }\n }\n},\n\n \"info-card#home\": {\n \"props\": {\n \"id\": \"info-card-home\",\n \"isFullModeStyle\": false,\n \"textPosition\": \"left\",\n \"imageUrl\": \"https://storecomponents.vteximg.com.br/arquivos/banner-infocard2.png\",\n \"headline\": \"Clearance Sale\",\n \"callToActionText\": \"DISCOVER\",\n \"callToActionUrl\": \"/sale/d\",\n \"blockClass\": \"info-card-home\",\n \"textAlignment\": \"center\"\n }\n },\n\n \"flex-layout.col#promo-banner1\": {\n \"props\": {\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\"image#promo-banner1\"]\n },\n\n \"flex-layout.col#promo-banner2\": {\n \"props\": {\n \"horizontalAlign\": \"center\"\n },\n \"children\": [\"image#promo-banner2\"]\n },\n\n \"image#promo-banner1\": {\n \"props\": {\n \"src\": \"https://images-submarino.b2w.io/spacey/2019/10/31/2-samsung-intel-inside-Q4-odyssey-sub-home-bottom-duplo-600x230.png\",\n \"alt\": \"Promo Banner 1\",\n \"link\": \"#\"\n }\n },\n\n \"image#promo-banner2\": {\n \"props\": {\n \"src\": \"https://images-submarino.b2w.io/spacey/2019/10/31/2-samsung-intel-inside-Q4-odyssey-sub-home-bottom-duplo-600x230.png\",\n \"alt\": \"Promo Banner 2\",\n \"link\": \"#\"\n }\n }\n}\n\n```"
}
] |
code_biggy-bookstore-theme_2e70e5a3
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/blocks/home/deals.json from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"flex-layout.row#deals\": {\n \"children\": [\n \"flex-layout.col#deals1\",\n \"flex-layout.col#deals2\",\n \"flex-layout.col#deals3\",\n \"flex-layout.col#deals4\"\n ],\n \"props\": {\n \"blockClass\": \"deals\"\n }\n },\n \"flex-layout.col#deals1\": {\n \"children\": [\n \"image#deal1\",\n \"rich-text#deal1\"\n ]\n },\n \"image#deal1\": {\n \"props\": {\n \"src\": \"https://storecomponents.vteximg.com.br/arquivos/box.png\",\n \"maxHeight\": \"24px\"\n }\n },\n \"rich-text#deal1\": {\n \"props\": {\n \"text\": \"Free shipping\",\n \"blockClass\": \"deals\"\n }\n },\n \"flex-layout.col#deals2\": {\n \"children\": [\n \"image#deal2\",\n \"rich-text#deal2\"\n ]\n },\n \"image#deal2\": {\n \"props\": {\n \"src\": \"https://storecomponents.vteximg.com.br/arquivos/delivery-fast.png\",\n \"maxHeight\": \"24px\"\n }\n },\n \"rich-text#deal2\": {\n \"props\": {\n \"text\": \"One day delivery\",\n \"blockClass\": \"deals\"\n }\n },\n \"flex-layout.col#deals3\": {\n \"children\": [\n \"image#deal3\",\n \"rich-text#deal3\"\n ]\n },\n \"image#deal3\": {\n \"props\": {\n \"src\": \"https://storecomponents.vteximg.com.br/arquivos/store.png\",\n \"maxHeight\": \"24px\"\n }\n },\n \"rich-text#deal3\": {\n \"props\": {\n \"text\": \"Pick up in store\",\n \"blockClass\": \"deals\"\n }\n },\n \"flex-layout.col#deals4\": {\n \"children\": [\n \"image#deal4\",\n \"rich-text#deal4\"\n ]\n },\n \"image#deal4\": {\n \"props\": {\n \"src\": \"https://storecomponents.vteximg.com.br/arquivos/coupon.png\",\n \"maxHeight\": \"24px\"\n }\n },\n \"rich-text#deal4\": {\n \"props\": {\n \"text\": \"Exclusive deals\",\n \"blockClass\": \"deals\"\n }\n }\n}\n```"
}
] |
code_biggy-bookstore-theme_33959209
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/blocks/footer/footer.json from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"footer\": {\n \"blocks\": [\"footer-layout.desktop\", \"footer-layout.mobile\"]\n },\n \"footer-layout.desktop\": {\n \"children\": [\"flex-layout.row#newsletter-footer\", \"flex-layout.row#main-footer\"]\n },\n \"flex-layout.row#newsletter-footer\": {\n \"props\": {\n \"fullWidth\": true,\n \"marginBottom\": 6\n },\n \"children\": [\"flex-layout.col#footer-1-desktop-1\"]\n },\n \"flex-layout.row#main-footer\": {\n \"children\": [\"flex-layout.col#footer-1\", \"flex-layout.col#footer-2\"]\n },\n \"flex-layout.col#footer-2\": {\n \"children\": [\"accepted-payment-methods\", \"flex-layout.row#footer-1-desktop\"]\n },\n \"flex-layout.col#footer-1\": {\n \"children\": [\"social-networks\", \"flex-layout.row#footer-2-desktop\"]\n },\n \"flex-layout.col#footer-1-desktop-1\": {\n \"children\": [\"newsletter\"]\n },\n \"flex-layout.col#footer-1-desktop-2\": {\n \"children\": [\"social-networks\"]\n },\n \"social-networks\": {\n \"props\": {\n \"socialNetworks\": [\n {\n \"name\": \"Facebook\",\n \"url\": \"https://www.facebook.com/vtexonline/\"\n },\n {\n \"name\": \"Instagram\",\n \"url\": \"https://www.instagram.com/vtextruecloud/\"\n },\n {\n \"name\": \"Twitter\",\n \"url\": \"https://twitter.com/vtexonline\"\n },\n {\n \"name\": \"Youtube\",\n \"url\": \"https://www.youtube.com/user/VTEXTV\"\n }\n ]\n }\n },\n \"accepted-payment-methods\": {\n \"props\": {\n \"paymentMethods\": [\"MasterCard\", \"Visa\", \"Diners Club\"]\n }\n },\n \"flex-layout.row#footer-2-desktop\": {\n \"children\": [\"vtex.menu@2.x:menu#About\"],\n \"props\": {\n \"paddingTop\": 4,\n \"paddingBottom\": 4\n }\n },\n \"flex-layout.row#footer-1-desktop\": {\n \"children\": [\"vtex.menu@2.x:menu#About-2\"],\n \"props\": {\n \"paddingTop\": 4,\n \"paddingBottom\": 4\n }\n },\n \"flex-layout.row#footer-3-desktop\": {\n \"children\": [\"rich-text#footer\"],\n \"props\": {\n \"blockClass\": \"credits\"\n }\n },\n \"rich-text#footer\": {\n \"props\": {\n \"text\": \"X, todos os direitos reservados.\",\n \"blockClass\": \"footer\"\n }\n },\n\n \"footer-layout.mobile\": {\n \"children\": [\n \"newsletter\",\n \"flex-layout.row#1-footer-mobile\",\n \"flex-layout.row#2-footer-mobile\",\n \"flex-layout.row#3-footer-mobile\"\n ]\n },\n \"flex-layout.row#1-footer-mobile\": {\n \"children\": [\n \"flex-layout.col#footer-1-mobile-1\",\n \"flex-layout.col#footer-1-mobile-2\"\n ],\n \"props\": {\n \"paddingTop\": 6,\n \"paddingBottom\": 4,\n \"preserveLayoutOnMobile\": true\n }\n },\n \"flex-layout.col#footer-1-mobile-1\": {\n \"children\": [\"social-networks\"]\n },\n \"flex-layout.col#footer-1-mobile-2\": {\n \"children\": [\"accepted-payment-methods\"],\n \"props\": {\n \"blockClass\": \"payment-methods\"\n }\n },\n \"flex-layout.row#2-footer-mobile\": {\n \"props\": {\n \"paddingTop\": 4,\n \"paddingBottom\": 4\n },\n \"children\": [\"vtex.menu@2.x:menu#About\"]\n },\n \"flex-layout.row#3-footer-mobile\": {\n \"props\": {\n \"text\": \"All stock and product photos are from photos.icons8.com =)\",\n \"blockClass\": \"footer\",\n \"paddingTop\": 4\n },\n \"children\": [\"rich-text#footer\"]\n }\n}\n\n```"
}
] |
code_biggy-bookstore-theme_18c628d2
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/blocks/footer/menu.json from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"vtex.menu@2.x:menu#About\": {\n \"props\": {\n \"orientation\": \"vertical\",\n \"blockClass\": \"center-menu\"\n },\n \"children\": [\n \"menu-item#aboutus\",\n \"menu-item#contact\",\n \"menu-item#help\",\n \"menu-item#terms\"\n ]\n },\n \"vtex.menu@2.x:menu#About-2\": {\n \"props\": {\n \"orientation\": \"vertical\",\n \"blockClass\": \"center-menu\"\n },\n \"children\": [\n \"menu-item#work\",\n \"menu-item#store\",\n \"menu-item#info\",\n \"menu-item#clients\"\n ]\n },\n \"menu-item#clients\": {\n \"props\": {\n \"id\": \"menu-item-clients\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"clients\",\n \"text\": \"clients\"\n }\n }\n },\n \"menu-item#info\": {\n \"props\": {\n \"id\": \"menu-item-info\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Info\",\n \"text\": \"Info\"\n }\n }\n },\n \"menu-item#work\": {\n \"props\": {\n \"id\": \"menu-item-work\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Work with us\",\n \"text\": \"Work with us\"\n }\n }\n },\n \"menu-item#store\": {\n \"props\": {\n \"id\": \"menu-item-store\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Stores\",\n \"text\": \"Stores\"\n }\n }\n },\n \"menu-item#aboutus\": {\n \"props\": {\n \"id\": \"menu-item-aboutus\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"About Us\",\n \"text\": \"About Us\"\n }\n }\n },\n \"menu-item#contact\": {\n \"props\": {\n \"id\": \"menu-item-contact\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Contact Us\",\n \"text\": \"Contact Us\"\n }\n }\n },\n \"menu-item#help\": {\n \"props\": {\n \"id\": \"menu-item-help\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Help\",\n \"text\": \"Help\"\n }\n }\n },\n \"menu-item#terms\": {\n \"props\": {\n \"id\": \"menu-item-terms\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Terms and Policies\",\n \"text\": \"Terms and Policies\"\n }\n }\n }\n}\n\n```"
}
] |
code_biggy-bookstore-theme_081518af
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/blocks/header/header.json from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"header\": {\n \"blocks\": [\"header-layout.desktop\", \"header-layout.mobile\"]\n },\n \"header.full\": {\n \"blocks\": [\"header-layout.desktop\", \"header-layout.mobile\"]\n },\n \"header-layout.desktop\": {\n \"children\": [\"header-row#1-desktop\", \"header-row#2-desktop\"]\n },\n \"header-row#1-desktop\": {\n \"children\": [\n \"logo#desktop\",\n \"search-bar\",\n \"locale-switcher\",\n \"login\",\n \"minicart\"\n ],\n \"props\": {\n \"sticky\": true,\n \"blockClass\": \"main-header\"\n }\n },\n \"header-row#2-desktop\": {\n \"children\": [\"drawer\", \"vtex.menu@2.x:menu#category-menu\"],\n \"props\": {\n \"sticky\": true,\n \"blockClass\": \"secondary-header\"\n }\n },\n \"logo#desktop\": {\n \"props\": {\n \"title\": \"Logo\",\n \"href\": \"/\",\n \"url\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bigbooks2___28c1d5ad941ed86393e60332562eca06.png\",\n \"width\": \"180\"\n }\n },\n\n \"minicart\": {\n \"blocks\": [\"product-summary\"],\n \"props\": {\n \"type\": \"popup\",\n \"showRemoveButton\": true,\n \"showDiscount\": true,\n \"showSku\": true,\n \"labelMiniCartEmpty\": \"Your cart is empty :(\",\n \"labelButtonFinishShopping\": \"Go to checkout\",\n \"enableQuantitySelector\": true,\n \"maxQuantity\": 10,\n \"labelClasses\": \"gray\",\n \"blockClass\": \"minicart-icon\"\n }\n },\n\n \"header-layout.mobile\": { \n \"children\": [\"header-row#1-mobile\", \"header-row#2-mobile\"]\n },\n \"header-row#1-mobile\": {\n \"children\": [\"drawer\", \"logo#mobile\", \"minicart\"],\n \"props\": {\n \"sticky\": true,\n \"blockClass\": \"main-header-mobile\"\n }\n },\n \"header-row#2-mobile\": {\n \"children\": [\"search-bar\"],\n \"props\": {\n \"sticky\": true,\n \"blockClass\": \"input-header-mobile\",\n \"paddingTop\": 0\n }\n },\n \"drawer\": {\n \"children\": [\"flex-layout.row#drawer\"],\n \"props\": {\n \"blockClass\": \"drawer-icon\"\n }\n },\n\n \"flex-layout.row#drawer\": {\n \"children\": [\n \"flex-layout.col#drawer\"\n ]\n },\n\n \"flex-layout.col#drawer\": {\n \"children\": [\n \"rich-text#drawer-head\",\n \"menu#drawer\"\n ]\n },\n\n \"rich-text#drawer-head\": {\n \"props\" : {\n \"text\": \"Categories\"\n }\n },\n\n \"menu#drawer\": {\n \"children\": [\"menu-item#category-drawer1\", \"menu-item#category-drawer2\", \"menu-item#category-drawer3\", \"menu-item#category-drawer4\", \"menu-item#category-drawer5\"],\n \"props\": {\n \"orientation\": \"vertical\"\n }\n },\n\n \"menu-item#category-drawer1\": {\n \"props\": {\n \"id\": \"menu-item-category-decoration\",\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": true,\n \"tagTitle\": \"History\",\n \"text\": \"History\"\n }\n }\n },\n \"menu-item#category-drawer2\": {\n \"props\": {\n \"id\": \"menu-item-category-decoration\",\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": true,\n \"tagTitle\": \"Romance\",\n \"text\": \"Romance\"\n }\n }\n },\n \"menu-item#category-drawer3\": {\n \"props\": {\n \"id\": \"menu-item-category-decoration\",\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": true,\n \"tagTitle\": \"Business\",\n \"text\": \"Business\"\n }\n }\n },\n \"menu-item#category-drawer4\": {\n \"props\": {\n \"id\": \"menu-item-category-decoration\",\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": true,\n \"tagTitle\": \"Art\",\n \"text\": \"Art\"\n }\n }\n },\n \"menu-item#category-drawer5\": {\n \"props\": {\n \"id\": \"menu-item-category-decoration\",\n \"type\": \"custom\",\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": true,\n \"tagTitle\": \"Biographie\",\n \"text\": \"Biographie\"\n }\n }\n },\n\n \"logo#mobile\": {\n \"props\": {\n \"title\": \"Logo\",\n \"href\": \"/\",\n \"url\": \"https://bookstoretheme.vteximg.com.br/assets/vtex.file-manager-graphql/images/bigbooks3___4ca412ca4dd79337bd2f30e1fa4671e9.png\",\n \"width\": \"70\"\n }\n }\n}\n\n```"
}
] |
code_biggy-bookstore-theme_308d2fb5
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/blocks/header/category-menu.json from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"vtex.menu@2.x:menu#category-menu\": {\n \"children\": [\"menu-item#option1\", \"menu-item#option2\", \"menu-item#option3\"]\n },\n \"menu-item#option1\": {\n \"props\": {\n \"blockClass\": \"side-menu-link\",\n \"id\": \"menu-item-category-decoration\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": true,\n \"tagTitle\": \"Today's Deals\",\n \"text\": \"Today's Deals\"\n }\n }\n },\n \"menu-item#option2\": {\n \"props\": {\n \"blockClass\": \"side-menu-link\",\n \"id\": \"menu-item-category-decoration\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": true,\n \"tagTitle\": \"eBooks\",\n \"text\": \"eBooks\"\n }\n }\n },\n \"menu-item#option3\": {\n \"props\": {\n \"blockClass\": \"side-menu-link\",\n \"id\": \"menu-item-category-decoration\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": true,\n \"tagTitle\": \"New Releases\",\n \"text\": \"New Releases\"\n }\n }\n }\n}\n\n```"
}
] |
code_biggy-bookstore-theme_ef2afa8e
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of biggy-bookstore-theme/store/blocks/header/top-menu.json from the biggy-bookstore-theme VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"vtex.menu@2.x:menu#websites\": {\n \"children\": [\n \"menu-item#shop\",\n \"menu-item#about-us\"\n ]\n },\n \"menu-item#shop\": {\n \"props\": {\n \"id\": \"menu-item-shop\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"#\",\n \"noFollow\": false,\n \"tagTitle\": \"Shop\",\n \"text\": \"Shop\"\n }\n }\n },\n \"menu-item#about-us\": {\n \"props\": {\n \"id\": \"menu-item-about-us\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"internal\",\n \"href\": \"/about-us\",\n \"noFollow\": false,\n \"tagTitle\": \"about-us\",\n \"text\": \"About Us\"\n }\n }\n },\n \"vtex.menu@2.x:menu#institutional\": {\n \"children\": [\n \"menu-item#vtex-website\"\n ]\n },\n \"menu-item#vtex-website\": {\n \"props\": {\n \"id\": \"menu-item-vtex-website\",\n \"type\": \"custom\",\n \"iconId\": null,\n \"highlight\": false,\n \"itemProps\": {\n \"type\": \"external\",\n \"href\": \"http://vtex.com\",\n \"noFollow\": false,\n \"tagTitle\": \"visit vtex.com\",\n \"text\": \"visit vtex.com\"\n }\n }\n }\n}\n\n```"
}
] |
code_orders-tracking_a00da70e
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of orders-tracking/docs/README.md from the orders-tracking VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```markdown\n# Orders Tracking Boilerplate\n \n## How to create a new tracking app?\n\n1. Copy the provided `tracking-integration-boilerplate` \n2. Suppose that your app name is `vtex.custom-tracking-integration`\n3. Create a private endpoint that responds in the path: `/_v/tracking/config`\n * In this path you will configure what service you will use to track the packages that you receive\n * This is an example of a valid configuration:\n \n ```\n {\n \"displayName\": \"Custom Tracking Integration\",\n \"webHookUrl\": \"{{vtexio-public}}/_v/vtex.custom-tracking-integration/trackPackages\",\n \"requiredExtraConfigs\": [\n {\n \"title\": \"myCustomField\"\n }\n ]\n }\n ```\n \nThis example is saying that:\n* The display name (the name that we will use to show to the user) is `My Custom Tracking` \n* The webhook URL that the tracking service has to call, when a matched package arrives, is `{{vtexio-public}}/_v/vtex.my-custom-tracking/trackPackages`\n - When you use `{{vtexio-public}}` the tracking service knows how to convert it to the current `account` and `workspace` that should be used\n* You new app is telling to the tracking service that it needs an extra field and that it is called `myCustomField`. This field will be presented to the users so that they can fill it in.\n - This field will be sent to your app in a dictionary with its value.\n\n4. On your configuration route, remember to create a policy that allows the `vtex.tracking-builder` to reach it: \n\nFor instance:\n```\n\"routes\": {\n \"trackingConfig\": {\n \"path\": \"/_v/tracking/config\",\n \"public\": false,\n \"policies\": [{\n \"effect\": \"allow\",\n \"actions\": [\"get\"],\n \"principals\": [\n \"vrn:apps:*:*:*:app/vtex.tracking-builder@*\"\n ]\n }]\n }\n }\n```\n\n#### How is the request that my app will receive?\n\n```\nPOST {configured endpoint}\n\n{\n \"account\": \"\",\n \"workspace\": \"\",\n \"appName\": \"\",\n \"config\": {\n \"myCustomField\": \"user-defined-value\"\n },\n \"packages\" : [\n {\n \"orderId\": \"\",\n \"invoiceNumber\": \"\",\n \"trackingNumber\": \"\"\n }\n ]\n}\n```\n\n#### What my app has to return? \n\n```\n[\n {\n \"package\": {\n \"orderId\": \"RECEIVED-ORDER-ID\",\n \"invoiceNumber\": \"RECEIVED-INVOICE-NUMBER\",\n \"trackingNumber\": \"RECEIVED-TRACKING-NUMBER\"\n },\n \"trackingHistory\": {\n \"delivered\": false | true,\n \"returned\": false | true,\n \"stopTracking\": false | true,\n \"events\": [\n {\n \"city\": \"City\",\n \"state\": \"State\",\n \"description\": \"Event Description\",\n \"date\": \"2019-01-01T14:34:30.313Z\"\n }\n ]\n }\n }\n]\n```\n\n```"
}
] |
code_orders-tracking_fbbc9999
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of orders-tracking/dotnet/service.json from the orders-tracking VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"stack\": \"dotnet\",\n \"memory\": 256,\n \"runtimeArgs\": [],\n \"routes\": {\n \"TrackingConfig\": {\n \"path\": \"/_v/tracking/config\",\n \"public\": false,\n \"policies\": [{\n \"effect\": \"allow\",\n \"actions\": [\"get\"],\n \"principals\": [\n \"vrn:apps:*:*:*:app/vtex.tracking-builder@*\"\n ]\n }]\n },\n \"TrackPackages\": {\n \"path\": \"/_v/your-company.tracking-integration-boilerplate/trackPackages\",\n \"public\": true\n }\n },\n \"events\": {\n \"onAppsLinked\": {\n \"sender\": \"apps\",\n \"keys\": [\"linked\"]\n }\n }\n}\n\n```"
}
] |
code_marketplace-financial-commission_dd741d0b
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/messages/en.json from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"admin/navigation.section-title\": \"Commission Report\",\n \"admin/navigation.dashboard-title\": \"Dashboard\",\n \"admin/navigation.detail-title\": \"Seller Invoice Detail\",\n \"admin/navigation.settings\": \"Settings\"\n}\n\n```"
}
] |
code_marketplace-financial-commission_b5fdd582
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/admin/navigation.json from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n[\n {\n \"adminVersion\": 4,\n \"section\": \"orders\",\n \"titleId\": \"admin/navigation.section-title\",\n \"subSection\": \"commissionReport\",\n \"subSectionItems\": [\n {\n \"labelId\": \"admin/navigation.dashboard-title\",\n \"path\": \"/admin/commission-report\"\n },\n {\n \"labelId\": \"admin/navigation.detail-title\",\n \"path\": \"/admin/commission-report/detail\"\n },\n {\n \"labelId\": \"admin/navigation.settings\",\n \"path\": \"/admin/commission-report/settings\"\n }\n ]\n }\n]\n\n```"
}
] |
code_marketplace-financial-commission_50af1b0d
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/admin/routes.json from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"admin.app.dashboard\": {\n \"component\": \"commissionReport\",\n \"path\": \"/admin/app/commission-report\"\n },\n \"admin.app.detail\": {\n \"component\": \"commissionReportDetail\",\n \"path\": \"/admin/app/commission-report/detail/*seller\"\n },\n \"admin.app.settings\": {\n \"component\": \"commissionReportSettings\",\n \"path\": \"/admin/app/commission-report/settings\"\n },\n \"admin.app.settings-detail\": {\n \"component\": \"commissionReportSettingsDetail\",\n \"path\": \"/admin/app/commission-report/settings/detail/*sellerId\"\n },\n \"admin.app.invoiceDetail\": {\n \"component\": \"invoiceMarketplaceDetail\",\n \"path\": \"/admin/app/commission-report/invoice/:id\"\n }\n}\n\n```"
}
] |
code_marketplace-financial-commission_6dedef55
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/docs/README.md from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```markdown\n## ⚠️ Maintenance ⚠️\n*Starting June 1st 2023, this application will no longer be maintained by VTEX.*\n\n---\n\nThis app and all affiliated services are provided “as is”, without warranty of any kind, either express or implied. Neither the publisher nor its partners, affiliates, employees, or contractors guarantee that this app will meet your requirements, provide uninterrupted use, or operate without delay or without error. Neither the publisher nor its partners, affiliates, employees, or contractors assume any responsibility for any errors and malfunctions within the app and will not provide support or maintenance of any kind.\n\nAll provisions and warranties of any kind, express or implied, including but not limited to any guarantees of performance, process integrity, or particular functionalities, are hereby disclaimed and excluded unless otherwise prohibited or restricted by applicable law.\n\n# Financial commission for Marketplace\n\nMarketplace Financial App is an application that is responsible for displaying, generating sales commissions from affiliated sellers.\n\n## **Install**:\n\nInstall `vtex.marketplace-financial-app` and `vtex.marketplace-financial-commission-cron` in your account.\n\n```powershell\nvtex install vtex.marketplace-financial-app@0.1.x\n```\n\n```powershell\nvtex install vtex.marketplace-financial-commission-cron@1.1.x\n```\n\n> **Note**. For more information about the `vtex.marketplace-financial-commission-cron` app [click here](https://github.com/vtex-apps/marketplace-financial-commission-cron).\n\n</br>\n\n## **Features**:\n\n- **Dashboard module**\n\n - List and filter all sellers\n - Aggregation of commissions for all orders in the range. \n - Totalizers for the specified date range.\n- **Orders Module**\n\n - List and filter all orders of the salesperson\n - List and filter all vendor's invoices\n - Order status and amount to be invoiced\n - At the end of the invoicing cycle, the orders to be posted are those with status Invoiced.\n - Once an order is created, the current commission will be fixed and will not change with a change in the seller's commission.\n - Detail per order commission per item. \n\n- **Invoices Module**\n\n - List All Seller Invoices at the end of the billing cycle, the orders to be counted are the ones with status: Partial, Paid or Unpaid\n - email sent to Sellers\n \n</br>\n\n## **Components financial commission**:\n\nThis app allows you create the interface to show the information about the commissions of the sellers.\n\nAdd the components financial app in your new apps in the section dependencies of the manifest file.\n\n```powershell\n\"dependencies\":{\n \"vtex.components-financial-commission\": \"0.x\"\n}\n```\n\nImport the components that you need in your project, for example:\n\n```jsx\nimport { detail as Detail } from 'vtex.components-financial-commission'\n\nreturn (\n <Detail\n dataSellers={dataSellers}\n ordersQuery={SEARCH_ORDERS}\n invoiceMutation={CREATE_INVOICE}\n invoicesQuery={SELLER_INVOICES}\n settingsQuery={GET_SETTINGS}\n />\n )\n\n/** Types */\ninterface DetailProps {\n account?: string\n dataSellers?: {\n getSellers: {\n pagination: Pagination\n sellers: [DataSellerSelect]\n }\n }\n ordersQuery: DocumentNode\n invoiceMutation: DocumentNode\n invoicesQuery: DocumentNode\n settingsQuery?: DocumentNode\n}\n```\n\nThe components available with the assigned types:\n\n```jsx\nimport { settings as Settings } from 'vtex.components-financial-commission'\n\nreturn (\n <Settings\n getSellersQuery={GET_SELLERS}\n createSettingsMutation={CREATE_SETTINGS}\n getSettingsQuery={GET_SETTINGS}\n editToken={EDIT_TOKEN}\n createTokenMutation={CREATE_TOKEN}\n getTokenQuery={GET_TOKEN}\n />\n )\n\n/** Types */\ninterface DetailProps {\n account?: string\n dataSellers?: {\n getSellers: {\n pagination: Pagination\n sellers: [DataSellerSelect]\n }\n }\n ordersQuery: DocumentNode\n invoiceMutation: DocumentNode\n invoicesQuery: DocumentNode\n settingsQuery?: DocumentNode\n}\n```\n\n```tsx\nimport { commissionReport as Report } from 'vtex.components-financial-commission'\n\nreturn (\n <Report\n getSellersQuery={GET_SELLERS}\n searchStatsQuery={SEARCH_STATS}\n searchSellersQuery={SEARCH_SELLERS}\n />\n )\n\n/** Types */\ninterface ReportProps {\n getSellersQuery: DocumentNode\n searchStatsQuery: DocumentNode\n searchSellersQuery: DocumentNode\n}\n```\n\n```tsx\nimport { settingsDetail as SettingsDetail } from 'vtex.components-financial-commission'\n\nreturn (\n <SettingsDetail\n createTokenMutation={CREATE_TOKEN}\n editToken={EDIT_TOKEN}\n getTokenQuery={GET_TOKEN}\n createSettingsMutation={CREATE_SETTINGS}\n getSettingsQuery={GET_SETTINGS}\n />\n )\n\n/** Types */\n\ninterface SettingsDetailProps {\n createTokenMutation: DocumentNode\n editToken: DocumentNode\n getTokenQuery: DocumentNode\n createSettingsMutation: DocumentNode\n getSettingsQuery: DocumentNode\n}\n```\n\n```jsx\nimport { invoiceDetail as InvoiceDetail } from 'vtex.components-financial-commission'\n\nreturn (\n <InvoiceDetail\n invoiceQuery={GET_INVOICE}\n getTemplate={GET_TEMPLATE}\n sendEmail={SEND_EMAIL}\n />\n )\n\n/** Types */\n\ninterface InvoiceDetailProps {\n invoiceQuery: DocumentNode\n getTemplate: DocumentNode\n sendEmail: DocumentNode\n}\n```\n\nUse the types to identify the data to pass between props of the components.\n\n`⚠️` See more details about this app related with the technical topics [Components financial](https://github.com/vtex-apps/components-financial-commission/)\n\n</br>\n\n## Interfaces\n\nTo access of the Dashboard of Commission Report App search the option **Orders** and then the option **Commission Report**.\n\nThe first screen that be will show you is the dashboard\n\n\n\nThe filter for this section allows you:\n\n1. Choose a seller name o multi seller names to get only the information related to the sellers selected\n2. Choose the start and final date of the commission reports.\n3. Filter the information with the values selected.\n4. Clear filters.\n\n\n\nTo go to detail of seller orders and invoices, press the actions button and then `Detail`\n\n\n\nIn the window **Seller Invoice Detail**, you can see the sellers orders and invoices. (If you come from the previous window, the filter has the status order by default `invoiced`, remove the value of the filter to get the status of all orders).\n\n\n\nInvoice detail:\n\n\n\nThe **Settings** section was built to define the integration type.\n\nIf you select the integration option `External`, it will be necessary to add the token of an external app to provide the information of orders and invoices of sellers.\n\nPress the button `Generate a new one` to get the credentials of connect with external services\n\n\n\nThe Internal option not requires a token because the information of orders and invoices is search in the VTEX database.\n\nOnly you must select the billing cycle [Daily, WEEKLY, MONTHLY]\n\n\n\nEach seller has its settings to be configured. To assign a different configuration to the seller, you must scroll to the **sellers' list**. Then, press the button `Actions` and then `Detail`.\n\n\n\nGenerate a token to get the information from external sources only for the selected seller. (The option Billing Cycle only will be available if in the Settings window the chosen option selected for the type integration is `Internal`).\n\n\n\n</br>\n\n## API REST \n \nEndpoints exposed for the integration process with the financial commission app, for more information [click here](API_REST_README.md).\n\n</br>\n\n### Important:\n\n`🚫` Please, don't upload the file `yarn.lock`. Remove this file of the `commit`.\n\n`✅` When you clone the project, create your work branch from `develop`.\n\n`✅` Upload your changes by making a `pull request`.\n\n`⚠️` Not forget to update the version and documentation. This last only if this is necessary.\n\n```"
}
] |
code_marketplace-financial-commission_47fe3253
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/graphql/schema.graphql from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```graphql\ntype Query {\n \"\"\"\n Retrieve all onboarded sellers\n \"\"\"\n getSellers(listSellersParams: ListSellersParams): PaginatedSellers\n @cacheControl(scope: PUBLIC, maxAge: LONG)\n \"\"\"\n Retrieve paginated Invoices for a given seller\n \"\"\"\n invoicesBySeller(sellerInvoiceParams: SellerInvoiceParams): ListInvoices\n @cacheControl(scope: PRIVATE, maxAge: LONG)\n \"\"\"\n Retrieves an Invoice\n \"\"\"\n getInvoice(id: String!): Invoice @cacheControl(scope: PRIVATE, maxAge: SHORT)\n \"\"\"\n Retrieve marketplace dashboard in a date range\n \"\"\"\n searchSellersDashboard(\n searchDashboardParams: SearchDashboardParams\n ): SearchResponse @cacheControl(scope: PUBLIC, maxAge: LONG)\n\n \"\"\"\n Retrieve Statistics General to marketplace in a date range\n \"\"\"\n searchStatisticsDashboard(\n searchStatsDashboardParams: SearchStatsDashboardParams\n ): SearchStatsResponse @cacheControl(scope: PUBLIC, maxAge: LONG)\n\n \"\"\"\n Retrieve orders to seller\n \"\"\"\n orders(searchOrdersParams: SearchOrdersParams): SearchOrdersResponse\n @cacheControl(scope: PUBLIC, maxAge: LONG)\n\n \"\"\"\n Get data token\n \"\"\"\n getToken(accountId: ID!): GetTokenResponse\n @cacheControl(scope: PUBLIC, maxAge: LONG)\n\n getSettings(id: String): SettingsSeller\n @cacheControl(scope: PUBLIC, maxAge: LONG)\n \"\"\"\n Retrieve template for order detail\n \"\"\"\n getTemplate: String @cacheControl(scope: PRIVATE, maxAge: LONG)\n}\n\ntype Mutation {\n createToken(accountId: ID!): CreateTokenResponse\n editToken(accountId: ID!, tokenInput: TokenInput!): EditTokenResponse\n \"\"\"\n Attempts to create an Invoice\n \"\"\"\n createInvoice(invoiceData: InvoiceDataInput!): String\n\n \"\"\"\n Attempts to create an settings\n \"\"\"\n createSettings(settingsData: SettingsDataInput!): SettingsResponse\n sendEmail(emailData: EmailDataInput!): String\n}\n\n```"
}
] |
code_marketplace-financial-commission_ec46f1e3
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/routes.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { method } from '@vtex/api'\n\nimport {\n sendMail,\n searchSellers,\n searchStatistics,\n sellers,\n sellersResponse,\n orders,\n resolveInvoice,\n invoicesBySeller,\n generateInvoices,\n errorHandler,\n eligibleSellers,\n templateMethod,\n policy,\n createInvoiceExternal,\n getInvoiceExternal,\n authenticationValidationVtex,\n} from './middlewares'\nimport { createTokenAuth } from './middlewares/authentication/createTokenAuth'\nimport { seller } from './middlewares/sellers/seller'\nimport { authentication } from './middlewares/authentication/authentication'\nimport { updateToken } from './middlewares/authentication/updateToken'\nimport { getToken } from './middlewares/authentication/getToken'\nimport { generate } from './middlewares/dashboard/generate/generate'\nimport { validateParamsExternal } from './middlewares/invoiceExternal/validateParamsExternal'\nimport { getTypeIntegration } from './middlewares/typeIntegration/getTypeIntegration'\nimport { deleteInvoiceExternal } from './middlewares/invoiceExternal/deleteInvoiceExternal'\nimport { updateInvoiceExternal } from './middlewares/invoiceExternal/updateInvoiceExternal'\nimport { switchUser } from './middlewares/authentication/switchUser'\nimport { authenticationMarketplace } from './middlewares/authentication/authenticationMarketplace'\n\nconst template = templateMethod\n\nconst routes = {\n mail: method({\n POST: [sendMail],\n }),\n _mail: method({\n POST: [sendMail],\n }),\n sellers: method({\n GET: [sellers, sellersResponse],\n }),\n template: method({\n GET: [template],\n }),\n _template: method({\n GET: [template],\n }),\n generateDashboard: method({\n POST: [sellers, generate],\n }),\n searchSellersDashboard: method({\n GET: [searchSellers],\n }),\n searchStatisticsDashboard: method({\n GET: [searchStatistics],\n }),\n singleInvoice: method({\n GET: [seller, authentication, resolveInvoice],\n POST: [seller, authentication, resolveInvoice],\n DELETE: [seller, authentication, resolveInvoice],\n PATCH: [seller, authentication, resolveInvoice],\n }),\n _singleInvoice: method({\n GET: [seller, policy, resolveInvoice],\n POST: [seller, policy, resolveInvoice],\n }),\n invoicesBySeller: method({\n POST: [seller, authentication, invoicesBySeller],\n }),\n _invoicesBySeller: method({\n POST: [seller, policy, invoicesBySeller],\n }),\n generateInvoices: method({\n GET: [errorHandler, eligibleSellers, generateInvoices],\n }),\n orders: method({\n GET: [seller, authentication, orders],\n }),\n _orders: method({\n GET: [seller, policy, orders],\n }),\n token: method({\n POST: [authenticationValidationVtex, switchUser, createTokenAuth],\n PUT: [authenticationValidationVtex, switchUser, updateToken],\n GET: [authenticationValidationVtex, switchUser, getToken],\n }),\n invoiceExternal: method({\n POST: [\n authenticationMarketplace,\n validateParamsExternal,\n createInvoiceExternal,\n ],\n GET: [authenticationMarketplace, getInvoiceExternal],\n DELETE: [\n authenticationMarketplace,\n validateParamsExternal,\n deleteInvoiceExternal,\n ],\n PATCH: [\n authenticationMarketplace,\n validateParamsExternal,\n updateInvoiceExternal,\n ],\n }),\n typeIntegration: method({\n GET: [getTypeIntegration],\n }),\n}\n\nexport { routes }\n\n```"
}
] |
code_marketplace-financial-commission_084c40f0
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/service.json from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"stack\": \"nodejs\",\n \"memory\": 512,\n \"ttl\": 60,\n \"timeout\": 60,\n \"minReplicas\": 2,\n \"maxReplicas\": 12,\n \"cpu\": {\n \"type\": \"shared\",\n \"value\": 80,\n \"scalingPercentage\": 95\n },\n \"routes\": {\n \"mail\": {\n \"path\": \"/_v/mail\",\n \"public\": true\n },\n \"_mail\": {\n \"path\": \"/_v/policy/financial-commission/mail\",\n \"public\": false,\n \"access\": \"authenticated\",\n \"policies\": [\n {\n \"effect\": \"allow\",\n \"actions\": [\"post\"],\n \"principals\": [\n \"vrn:apps:*:*:*:app/vtex.seller-financial-commission@*\",\n \"vrn:vtex.vtex-id:*:*:*:user/*@vtex.com.br\"\n ]\n }\n ]\n },\n \"sellers\": {\n \"path\": \"/_v/sellers/list\",\n \"public\": true\n },\n \"template\": {\n \"path\": \"/_v/segment/template\",\n \"public\": true\n },\n \"_template\": {\n \"path\": \"/_v/policy/financial-commission/template\",\n \"public\": false,\n \"access\": \"authenticated\",\n \"policies\": [\n {\n \"effect\": \"allow\",\n \"actions\": [\"get\"],\n \"principals\": [\n \"vrn:apps:*:*:*:app/vtex.seller-financial-commission@*\",\n \"vrn:vtex.vtex-id:*:*:*:user/*@vtex.com.br\"\n ]\n }\n ]\n },\n \"generateDashboard\": {\n \"path\": \"/dashboard/generate\",\n \"public\": false,\n \"policies\": [\n {\n \"effect\": \"allow\",\n \"actions\": [\"post\"],\n \"principals\": [\n \"vrn:apps:*:*:*:app/vtex.marketplace-financial-commission-cron@*\"\n ]\n }\n ]\n },\n \"searchSellersDashboard\": {\n \"path\": \"/_v/dashboard/sellers/search\",\n \"public\": true\n },\n \"searchStatisticsDashboard\": {\n \"path\": \"/_v/dashboard/statistics/search\",\n \"public\": true\n },\n \"singleInvoice\": {\n \"path\": \"/_v/private/financial-commission/:sellerId/invoice/*id\",\n \"public\": true\n },\n \"_singleInvoice\": {\n \"path\": \"/_v/policy/financial-commission/:sellerId/invoice/*id\",\n \"public\": false,\n \"access\": \"authenticated\",\n \"policies\": [\n {\n \"effect\": \"allow\",\n \"actions\": [\"get\", \"post\"],\n \"principals\": [\n \"vrn:apps:*:*:*:app/vtex.seller-financial-commission@*\",\n \"vrn:vtex.vtex-id:*:*:*:user/*@vtex.com.br\"\n ]\n }\n ]\n },\n \"invoicesBySeller\": {\n \"path\": \"/_v/financial-commission/:sellerId/invoices\",\n \"public\": true\n },\n \"_invoicesBySeller\": {\n \"path\": \"/_v/policy/financial-commission/:sellerId/invoices\",\n \"public\": false,\n \"access\": \"authenticated\",\n \"policies\": [\n {\n \"effect\": \"allow\",\n \"actions\": [\"post\"],\n \"principals\": [\n \"vrn:apps:*:*:*:app/vtex.seller-financial-commission@*\",\n \"vrn:vtex.vtex-id:*:*:*:user/*@vtex.com.br\"\n ]\n }\n ]\n },\n \"generateInvoices\": {\n \"path\": \"/invoice/generate\",\n \"public\": false,\n \"policies\": [\n {\n \"effect\": \"allow\",\n \"actions\": [\"get\"],\n \"principals\": [\n \"vrn:apps:*:*:*:app/vtex.marketplace-financial-commission-cron@*\"\n ]\n }\n ]\n },\n \"orders\": {\n \"path\": \"/_v/private/orders\",\n \"public\": true\n },\n \"_orders\": {\n \"path\": \"/_v/policy/private/orders\",\n \"public\": false,\n \"access\": \"authenticated\",\n \"policies\": [\n {\n \"effect\": \"allow\",\n \"actions\": [\"get\"],\n \"principals\": [\n \"vrn:apps:*:*:*:app/vtex.seller-financial-commission@*\",\n \"vrn:vtex.vtex-id:*:*:*:user/*@vtex.com.br\"\n ]\n }\n ]\n },\n \"token\": {\n \"path\": \"/_v/financial-commission/token/*sellerId\",\n \"public\": true\n },\n \"invoiceExternal\": {\n \"path\": \"/_v/private/financial-commission/external/invoice/*id\",\n \"public\": true\n },\n \"typeIntegration\": {\n \"path\": \"/_v/policy/financial-commission/typeIntegration\",\n \"public\": false,\n \"access\": \"authenticated\",\n \"policies\": [\n {\n \"effect\": \"allow\",\n \"actions\": [\"get\"],\n \"principals\": [\n \"vrn:apps:*:*:*:app/vtex.seller-financial-commission@*\",\n \"vrn:apps:*:*:*:app/vtex.marketplace-financial-commission-cron@*\",\n \"vrn:vtex.vtex-id:*:*:*:user/*@vtex.com.br\"\n ]\n }\n ]\n }\n }\n}\n\n```"
}
] |
code_marketplace-financial-commission_1997c7ca
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/utils.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nexport function getDatesInvoiced(dateRange?: DateRange): DatesInvoice {\n if (dateRange?.start !== undefined && dateRange?.end !== undefined) {\n const start = new Date(dateRange.start)\n const end = new Date(dateRange.end)\n const [formattedDateInitial] = start.toISOString().split('T')\n const [formattedDateEnd] = end.toISOString().split('T')\n\n return {\n dateInvoiceInitial: formattedDateInitial.concat('T00:00:00.001Z'),\n dateInvoiceEnd: formattedDateEnd.concat('T23:59:59.999Z'),\n formattedDate: formattedDateInitial,\n }\n }\n\n const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))\n const [formattedDate] = yesterday.toISOString().split('T')\n\n return {\n dateInvoiceInitial: formattedDate.concat('T00:00:00.001Z'),\n dateInvoiceEnd: formattedDate.concat('T23:59:59.999Z'),\n formattedDate,\n }\n}\n\nexport function createKeyToken(): string {\n let result = ''\n const characters =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'\n\n const charactersLength = characters.length\n\n for (let i = 0; i < 70; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength))\n }\n\n return result\n}\n\nexport function numberOfDays(date1: Date, date2: Date) {\n const date1utc = Date.UTC(\n date1.getFullYear(),\n date1.getMonth(),\n date1.getDate()\n )\n\n const date2utc = Date.UTC(\n date2.getFullYear(),\n date2.getMonth(),\n date2.getDate()\n )\n\n const day = 1000 * 60 * 60 * 24\n\n return (date2utc - date1utc) / day + 1\n}\n\n```"
}
] |
code_marketplace-financial-commission_9841db3c
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/package.json from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"dependencies\": {\n \"@vtex/api\": \"6.45.12\",\n \"@vtex/clients\": \"^2.19.4\",\n \"co-body\": \"^6.0.0\",\n \"polly-js\": \"^1.8.3\",\n \"ramda\": \"^0.25.0\",\n \"node-fetch\": \"^2.6.1\"\n },\n \"devDependencies\": {\n \"@types/co-body\": \"^6.1.0\",\n \"@types/jest\": \"^27.4.1\",\n \"@types/node\": \"^12.0.0\",\n \"@types/node-fetch\": \"^2.6.1\",\n \"@types/ramda\": \"types/npm-ramda#dist\",\n \"@vtex/api\": \"6.45.12\",\n \"@vtex/test-tools\": \"^3.4.3\",\n \"@vtex/tsconfig\": \"^0.5.6\",\n \"tslint\": \"^5.0.0\",\n \"tslint-config-vtex\": \"^2.1.0\",\n \"typescript\": \"3.9.7\",\n \"vtex.format-currency\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.format-currency@0.4.1/public/@types/vtex.format-currency\",\n \"vtex.native-types\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.native-types@0.8.0/public/@types/vtex.native-types\",\n \"vtex.render-runtime\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.render-runtime@8.132.4/public/@types/vtex.render-runtime\",\n \"vtex.sellers-graphql\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.sellers-graphql@8.5.4/public/@types/vtex.sellers-graphql\",\n \"vtex.styleguide\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.146.1/public/@types/vtex.styleguide\"\n },\n \"scripts\": {\n \"lint\": \"tsc --noEmit --pretty\"\n },\n \"version\": \"0.3.24\"\n}\n\n```"
}
] |
code_marketplace-financial-commission_fad2fc8c
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/constants.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nexport const config = {\n BUCKET_VBASE: 'FinancialDSH',\n BUCKET_VBASE_TOKEN: 'TokenConfig',\n PRIVATE_KEY: 'daMud5nb5ZEHipscucqAGu5pPM224HUM',\n SETTINGS_BUCKET: 'settings',\n RETRY_SELLERS_BUCKET: 'retry',\n MANUAL_JOB_BUCKET: 'manual',\n AUTO_JOB_BUCKET: 'automatic',\n APIREST_JOB_BUCKET: 'api-rest',\n INVOICE_MAIL_TEMPLATE: 'invoice-detail',\n INVOICE_MAIL_TEMPLATE_EXTERNAL: 'invoice-detail-external',\n INVOICE_EXTERNAL_BUCKET: 'invoice-ext',\n} as const\n\nexport const TypeIntegration = {\n EXTERNAL: 'external',\n INTERNAL: 'internal',\n}\n\nexport const validationMessage = {\n DEFAULT_ERRORMESSAGE_FIELD_IS_REQUIRED: 'This field is required',\n ERROR_MESSAGE_DATE_FORMAT:\n 'Invalid date format. The date format is yyyy-mm-dd.',\n ERROR_MESSAGE_DATE_RANGE_MONTH_AND_YEAR: 'Range of year or month incorrect',\n ERROR_MESSAGE_DATE_RANGE_DAY: 'Day incorrect',\n ERROR_MESSAGE_DATE_BETWEEN_DAYS:\n 'Only a date range of no more than 30 days is allowed.',\n ERROR_MESSAGE_DATE_END_EQUAL_OR_GREATER:\n 'End date cannot be equal to or greater than the current current day or date..',\n ERROR_EMAIL: 'Please enter valid email',\n ERROR_JSONDATA: 'jsonData Invalid please check',\n} as const\n\nexport const JOB_STATUS = {\n ONGOING: 'ONGOING',\n COMPLETE: 'COMPLETE',\n ERROR: 'ERROR',\n OMITTED: 'OMITTED',\n} as const\n\nexport const INVOICE_STATUS = {\n UNPAID: 'unpaid',\n PARTIAL: 'partial',\n PAID: 'paid',\n} as const\n\nexport const PAGE_DEFAULT = 1\nexport const PAGE_SIZE_DEFAULT = 5\n\n```"
}
] |
code_marketplace-financial-commission_05d601a2
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/index.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport type { ParamsContext, RecorderState } from '@vtex/api'\nimport { Service } from '@vtex/api'\n\nimport clients from './clients'\nimport type { Clients } from './clients'\nimport { queries, mutations } from './resolvers'\nimport { routes } from './routes'\n\nexport default new Service<Clients, RecorderState, ParamsContext>({\n clients,\n routes,\n graphql: {\n resolvers: {\n Query: {\n ...queries,\n },\n Mutation: {\n ...mutations,\n },\n },\n },\n})\n\n```"
}
] |
code_marketplace-financial-commission_9f235649
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/react/styles.css from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```css\n.btn_external button{\n width: 120px;\n}\n\n.btn_filter button{\n width: 95%;\n font-size: 15px;\n}\n\n.buttonGroup button{\n z-index: 0 !important;\n}\n\n@media (max-width: 800px) {\n .filter {\n flex-direction: column;\n }\n\n .filter_container{\n width: 100%;\n margin-top: 10px;\n }\n .btn_filter{\n width: 100%\n }\n}\n\n```"
}
] |
code_marketplace-financial-commission_70e6879f
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/react/commissionReportSettings.tsx from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { settings as Settings } from 'vtex.components-financial-commission'\n\nimport {\n GET_SELLERS,\n CREATE_SETTINGS,\n GET_SETTINGS,\n EDIT_TOKEN,\n CREATE_TOKEN,\n GET_TOKEN,\n} from './graphql'\n\nconst CommissionReportSettings = () => {\n return (\n <Settings\n getSellersQuery={GET_SELLERS}\n createSettingsMutation={CREATE_SETTINGS}\n getSettingsQuery={GET_SETTINGS}\n editToken={EDIT_TOKEN}\n createTokenMutation={CREATE_TOKEN}\n getTokenQuery={GET_TOKEN}\n />\n )\n}\n\nexport default CommissionReportSettings\n\n```"
}
] |
code_marketplace-financial-commission_42d1a60f
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/react/commissionReportSettingsDetail.tsx from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { settingsDetail as SettingsDetail } from 'vtex.components-financial-commission'\n\nimport {\n CREATE_TOKEN,\n EDIT_TOKEN,\n GET_TOKEN,\n CREATE_SETTINGS,\n GET_SETTINGS,\n} from './graphql'\n\nconst CommissionReportSettingsDetail = () => {\n return (\n <SettingsDetail\n createTokenMutation={CREATE_TOKEN}\n editToken={EDIT_TOKEN}\n getTokenQuery={GET_TOKEN}\n createSettingsMutation={CREATE_SETTINGS}\n getSettingsQuery={GET_SETTINGS}\n />\n )\n}\n\nexport default CommissionReportSettingsDetail\n\n```"
}
] |
code_marketplace-financial-commission_b68e2f2a
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/react/commissionReportDetail.tsx from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { useQuery } from 'react-apollo'\nimport { detail as Detail } from 'vtex.components-financial-commission'\n\nimport GET_SELLERS from './graphql/getSellers.gql'\nimport GET_SETTINGS from './graphql/getSettings.gql'\nimport SEARCH_ORDERS from './graphql/getSearchOrders.gql'\nimport CREATE_INVOICE from './graphql/createInvoice.gql'\nimport SELLER_INVOICES from './graphql/getInvoicesBySeller.gql'\n\nfunction CommissionDetail() {\n const { data: dataSellers, loading } = useQuery(GET_SELLERS, {\n ssr: false,\n pollInterval: 0,\n })\n\n if (loading) {\n return null\n }\n\n return (\n <Detail\n dataSellers={dataSellers}\n ordersQuery={SEARCH_ORDERS}\n invoiceMutation={CREATE_INVOICE}\n invoicesQuery={SELLER_INVOICES}\n settingsQuery={GET_SETTINGS}\n />\n )\n}\n\nexport default CommissionDetail\n\n```"
}
] |
code_marketplace-financial-commission_143fbec6
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/react/commissionReport.tsx from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { commissionReport as Report } from 'vtex.components-financial-commission'\n\nimport { GET_SELLERS, SEARCH_STATS, SEARCH_SELLERS } from './graphql'\n\nconst CommissionReport = () => {\n return (\n <Report\n getSellersQuery={GET_SELLERS}\n searchStatsQuery={SEARCH_STATS}\n searchSellersQuery={SEARCH_SELLERS}\n />\n )\n}\n\nexport default CommissionReport\n\n```"
}
] |
code_marketplace-financial-commission_70baec3b
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/react/package.json from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"name\": \"financial-commission\",\n \"version\": \"0.3.24\",\n \"scripts\": {\n \"test\": \"vtex-test-tools test\"\n },\n \"dependencies\": {\n \"apollo-client\": \"^2.6.8\",\n \"date-fns\": \"^2.28.0\",\n \"handlebars\": \"^4.7.7\",\n \"react\": \"^16.12.0\",\n \"react-apollo\": \"^3.1.3\",\n \"react-dom\": \"^16.12.0\",\n \"react-intl\": \"^5.20.6\"\n },\n \"devDependencies\": {\n \"@apollo/react-testing\": \"^3.1.3\",\n \"@types/jest\": \"^25.1.4\",\n \"@types/node\": \"^13.9.8\",\n \"@types/react\": \"^16.9.31\",\n \"@types/react-intl\": \"^2.3.17\",\n \"@vtex/test-tools\": \"^3.3.2\",\n \"@vtex/tsconfig\": \"^0.6.0\",\n \"apollo-cache-inmemory\": \"^1.6.5\",\n \"graphql\": \"^14.6.0\",\n \"typescript\": \"3.9.7\",\n \"vtex.format-currency\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.format-currency@0.4.1/public/@types/vtex.format-currency\",\n \"vtex.native-types\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.native-types@0.8.0/public/@types/vtex.native-types\",\n \"vtex.render-runtime\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.render-runtime@8.132.4/public/@types/vtex.render-runtime\",\n \"vtex.sellers-graphql\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.sellers-graphql@8.5.4/public/@types/vtex.sellers-graphql\",\n \"vtex.styleguide\": \"http://vtex.vtexassets.com/_v/public/typings/v1/vtex.styleguide@9.146.1/public/@types/vtex.styleguide\"\n }\n}\n\n```"
}
] |
code_marketplace-financial-commission_c9ed5050
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/react/invoiceMarketplaceDetail.tsx from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```tsx\nimport React from 'react'\nimport { invoiceDetail as InvoiceDetail } from 'vtex.components-financial-commission'\n\nimport { GET_INVOICE, GET_TEMPLATE, SEND_EMAIL } from './graphql'\n\nconst InvoiceMarketPlaceDetail = () => {\n return (\n <InvoiceDetail\n invoiceQuery={GET_INVOICE}\n getTemplate={GET_TEMPLATE}\n sendEmail={SEND_EMAIL}\n />\n )\n}\n\nexport default InvoiceMarketPlaceDetail\n\n```"
}
] |
code_marketplace-financial-commission_0505837c
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/graphql/types/global.graphql from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```graphql\ninput InvoiceDataInput {\n id: String\n name: String\n email: String\n startDate: String\n endDate: String\n}\n\ninput SettingsDataInput {\n sellerName: String\n startDate: String!\n endDate: String!\n billingCycle: String!\n integration: Int\n}\n\ntype SettingsSeller {\n sellerName: String\n startDate: String\n endDate: String\n billingCycle: String\n integration: String\n}\n\ntype SettingsResponse {\n startDate: String\n endDate: String\n billingCycle: String\n integration: Int\n}\n\nscalar JSONData\n\ntype Invoice {\n status: String\n invoiceCreatedDate: String\n seller: SellerInvoiceData\n orders: [Order]\n totalizers: Totalizers\n comment: String\n jsonData: JSONData\n}\n\ntype InvoiceList {\n id: String\n status: String\n invoiceCreatedDate: String\n totalizers: Totalizers\n}\n\ntype Totalizers {\n subTotal: Float\n fee: Float\n total: Float\n}\n\ntype Order {\n orderId: String\n sellerOrderId: String\n totalComission: Float\n totalOrderValue: Float\n totalOrderRate: Float\n}\n\ntype SellerInvoiceData {\n id: String\n name: String\n contact: SellerContact\n}\n\ntype SellerContact {\n phone: String\n email: String\n}\n\ntype ListInvoices {\n data: [InvoiceList]\n pagination: PaginationInvoice\n}\n\ntype PaginatedSellers {\n sellers: [Seller]\n pagination: PaginationSearch\n}\n\ntype Seller {\n id: String\n name: String\n account: String\n productCommissionPercentage: Int\n freightCommissionPercentage: Int\n isActive: Boolean\n}\n\ninput Dates {\n startDate: String\n endDate: String\n}\n\ninput Pagination {\n page: Int\n pageSize: Int\n}\n\ntype SearchResponse {\n dateStart: String\n dateEnd: String\n sellers: [SellersDashboardSearch]\n statistics: StatsGeneralSearch\n pagination: PaginationSearch\n}\n\ntype SellersDashboardSearch {\n id: String\n name: String\n account: String\n statistics: StatsSellerSearch\n}\n\ntype StatsSellerSearch {\n dateInvoiced: String\n ordersCount: Int\n totalComission: Float\n totalOrderValue: Float\n outstandingBalance: Float\n}\n\ntype PaginationSearch {\n currentPage: Int\n pageSize: Int\n totalPage: Int\n}\n\ninput SearchDashboardParams {\n dateStart: String!\n dateEnd: String!\n sellersId: String\n page: Int!\n pageSize: Int!\n sort: String\n}\n\ntype SearchStatsResponse {\n dateStart: String\n dateEnd: String\n statistics: StatsGeneralSearch\n}\n\ntype StatsGeneralSearch {\n ordersCount: Int\n totalComission: Float\n totalOrderValue: Float\n}\n\ninput SearchStatsDashboardParams {\n dateStart: String!\n dateEnd: String!\n}\n\ninput SearchOrdersParams {\n dateStart: String!\n dateEnd: String!\n sellerName: String!\n page: Int!\n perpage: Int!\n status: String\n}\n\ntype OrderSearch {\n orderId: String\n sellerOrderId: String\n marketplaceOrderId: String\n totalComission: Float\n totalOrderValue: Float\n status: String\n statusDescription: String\n creationDate: String\n rate: [ItemsRateOrdersSearch]\n}\n\ntype ItemsRateOrdersSearch {\n itemId: String\n nameItem: String\n rate: RateOrders\n}\n\ntype RateOrders {\n productCommissionPercentage: Float\n freightCommissionPercentage: Float\n}\n\ntype PagingOrders {\n total: Int\n pages: Int\n currentPage: Int\n perPage: Int\n}\n\ntype PaginationInvoice {\n total: Int\n page: Int\n pageSize: Int\n}\n\ntype SearchOrdersResponse {\n data: [OrderSearch]\n paging: PagingOrders\n}\n\ntype CreateTokenResponse {\n message: String\n accountId: String\n autheticationToken: String\n creationDate: String\n resultVBase: [ResultVBase]\n}\n\ntype ResultVBase {\n path: String\n hash: String\n}\n\ninput TokenInput {\n enabled: Boolean\n}\n\ntype EditTokenResponse {\n message: String\n accountId: String\n lastModificationDate: String\n resultVBase: [ResultVBase]\n}\n\ntype GetTokenResponse {\n id: String\n account: String\n name: String\n autheticationToken: String\n creationDate: String\n lastModificationDate: String\n enabled: Boolean\n}\n\ninput ListSellersParams {\n sellersId: String\n page: Int\n pageSize: Int\n}\n\ninput SellerInvoiceParams {\n sellerName: String!\n pagination: Pagination\n dates: Dates!\n}\n\ninput EmailDataInput {\n email: String\n jsonData: String\n}\n\n```"
}
] |
code_marketplace-financial-commission_f3d54f3a
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/masterdata/externalinvoices/schema.json from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"$schema\": \"http://json-schema.org/schema#\",\n \"title\": \"ExternalInvoice\",\n \"type\": \"object\",\n \"properties\": {\n \"status\": {\n \"type\": \"string\",\n \"enum\": [\"partial\", \"unpaid\", \"paid\"]\n },\n \"invoiceCreatedDate\": {\n \"type\": \"string\"\n },\n \"seller\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"contact\": {\n \"type\": \"object\",\n \"properties\": {\n \"phone\": {\n \"type\": [\"string\", \"null\"]\n },\n \"email\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"jsonData\": {\n \"type\": \"string\"\n },\n \"comment\": {\n \"type\": [\"string\", \"null\"]\n }\n },\n \"v-indexed\": [\"id\", \"status\", \"invoiceCreatedDate\", \"seller\", \"contact\"],\n \"required\": [\"status\", \"invoiceCreatedDate\", \"seller\", \"jsonData\"],\n \"v-cache\": false,\n \"v-immediate-indexing\": true\n}\n\n```"
}
] |
code_marketplace-financial-commission_2b30112a
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/masterdata/sellersdashboards/schema.json from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"$schema\": \"http://json-schema.org/schema#\",\n \"title\": \"SellersDashboard\",\n \"type\": \"object\",\n \"properties\": {\n \"dateCut\": {\n \"type\": \"string\"\n },\n \"sellers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"account\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"statistics\": {\n \"type\": \"object\",\n \"properties\": {\n \"ordersCount\": {\n \"type\": \"number\"\n },\n \"totalComission\": {\n \"type\": \"number\"\n },\n \"totalOrderValue\": {\n \"type\": \"number\"\n },\n \"totalDiscounts\": {\n \"type\": \"number\"\n },\n \"totalOrdersItems\": {\n \"type\": \"number\"\n },\n \"totalShipping\": {\n \"type\": \"number\"\n },\n \"totalTax\": {\n \"type\": \"number\"\n }\n },\n \"required\": [\n \"ordersCount\",\n \"totalComission\",\n \"totalOrderValue\",\n \"totalOrdersItems\"\n ]\n }\n },\n \"required\": [\"id\", \"account\", \"name\", \"statistics\"]\n }\n },\n \"idGenerate\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"dateCut\", \"sellers\", \"idGenerate\"],\n \"v-indexed\": [\"dateCut\", \"sellers\"]\n}\n\n```"
}
] |
code_marketplace-financial-commission_6c9418e1
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/masterdata/statisticsdashboards/schema.json from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"$schema\": \"http://json-schema.org/schema#\",\n \"title\": \"StatisticsDashboard\",\n \"type\": \"object\",\n \"properties\": {\n \"dateCut\": {\n \"type\": \"string\"\n },\n \"statistics\": {\n \"type\": \"object\",\n \"properties\": {\n \"ordersCount\": {\n \"type\": \"number\"\n },\n \"totalComission\": {\n \"type\": \"number\"\n },\n \"totalOrderValue\": {\n \"type\": \"number\"\n },\n \"totalDiscounts\": {\n \"type\": \"number\"\n },\n \"totalOrdersItems\": {\n \"type\": \"number\"\n },\n \"totalShipping\": {\n \"type\": \"number\"\n },\n \"totalTax\": {\n \"type\": \"number\"\n }\n },\n \"required\": [\"ordersCount\", \"totalComission\", \"totalOrderValue\"]\n },\n \"idStatistics\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"dateCut\", \"statistics\"],\n \"v-indexed\": [\"dateCut\"]\n}\n\n```"
}
] |
code_marketplace-financial-commission_ed54a9aa
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/masterdata/commissioninvoices/schema.json from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```json\n{\n \"$schema\": \"http://json-schema.org/schema#\",\n \"title\": \"CommissionInvoice\",\n \"type\": \"object\",\n \"properties\": {\n \"status\": {\n \"type\": \"string\",\n \"enum\": [\"partial\", \"unpaid\", \"paid\"]\n },\n \"invoiceCreatedDate\": {\n \"type\": \"string\"\n },\n \"seller\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"contact\": {\n \"type\": \"object\",\n \"properties\": {\n \"phone\": {\n \"type\": [\"string\", \"null\"]\n },\n \"email\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"orders\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"orderId\": {\n \"type\": \"string\"\n },\n \"sellerOrderId\": {\n \"type\": \"string\"\n },\n \"totalComission\": {\n \"type\": \"number\"\n },\n \"totalOrderValue\": {\n \"type\": \"number\"\n },\n \"totalOrderRate\": {\n \"type\": [\"number\", \"null\"]\n }\n }\n }\n },\n \"totalizers\": {\n \"type\": \"object\",\n \"properties\": {\n \"subTotal\": {\n \"type\": \"number\"\n },\n \"fee\": {\n \"type\": [\"number\", \"null\"]\n },\n \"total\": {\n \"type\": \"number\"\n }\n }\n },\n \"comment\": {\n \"type\": [\"string\", \"null\"]\n }\n },\n \"v-indexed\": [\"id\", \"status\", \"invoiceCreatedDate\", \"seller\"],\n \"required\": [\n \"status\",\n \"invoiceCreatedDate\",\n \"seller\",\n \"orders\",\n \"totalizers\"\n ],\n \"v-cache\": false,\n \"v-immediate-indexing\": true\n}\n\n```"
}
] |
code_marketplace-financial-commission_3b026d88
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/mocks/invoices.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nexport const MOCK_INVOICES = [\n {\n id: 'sellerA_3918239129',\n status: 'paid',\n invoiceCreatedDate: '25/02/2022',\n invoiceDueDate: '15/03/2022',\n seller: {\n name: 'Seller A',\n id: 'SellerId',\n contact: {\n phone: '+34874958678',\n email: 'sesarocampo@sellera.com',\n },\n },\n comment: null,\n orders: [\n {\n orderId: '10012931-12',\n total: 1200.0,\n commission: 400.0,\n totalOrderRate: 0.3,\n },\n {\n orderId: '11212924-14',\n total: 500.0,\n commission: 100.0,\n totalOrderRate: 0.2,\n },\n {\n orderId: '13312931-13',\n total: 1500.0,\n commission: 1000.0,\n totalOrderRate: 0.6,\n },\n ],\n totalizers: {\n subtotal: 1500,\n tax: {\n type: 'percentage',\n value: 10,\n },\n fee: 150,\n total: 1800,\n },\n },\n {\n id: 'sellerA_3913758129',\n status: 'unpaid',\n invoiceCreatedDate: '25/02/2022',\n invoiceDueDate: '15/03/2022',\n seller: {\n name: 'Seller A',\n id: 'SellerId',\n contact: {\n phone: '+34874958678',\n email: 'sesarocampo@sellera.com',\n },\n },\n comment: null,\n orders: [\n {\n orderId: '10012931-12',\n total: 1200.0,\n commission: 400.0,\n totalOrderRate: 0.3,\n },\n {\n orderId: '11212924-14',\n total: 500.0,\n commission: 100.0,\n totalOrderRate: 0.2,\n },\n {\n orderId: '13312931-13',\n total: 1500.0,\n commission: 1000.0,\n totalOrderRate: 0.6,\n },\n ],\n totalizers: {\n subtotal: 1500,\n tax: {\n type: 'percentage',\n value: 10,\n },\n fee: 150,\n total: 1800,\n },\n },\n {\n id: 'sellerA_1537839129',\n status: 'paid',\n invoiceCreatedDate: '25/02/2022',\n invoiceDueDate: '15/03/2022',\n seller: {\n name: 'Seller A',\n id: 'SellerId',\n contact: {\n phone: '+34874958678',\n email: 'sesarocampo@sellera.com',\n },\n },\n comment: null,\n orders: [\n {\n orderId: '10012931-12',\n total: 1200.0,\n commission: 400.0,\n totalOrderRate: 0.3,\n },\n {\n orderId: '11212924-14',\n total: 500.0,\n commission: 100.0,\n totalOrderRate: 0.2,\n },\n {\n orderId: '13312931-13',\n total: 1500.0,\n commission: 1000.0,\n totalOrderRate: 0.6,\n },\n ],\n totalizers: {\n subtotal: 1500,\n tax: {\n type: 'percentage',\n value: 10,\n },\n fee: 150,\n total: 1800,\n },\n },\n {\n id: 'sellerA_3918227568',\n status: 'unpaid',\n invoiceCreatedDate: '25/02/2022',\n invoiceDueDate: '15/03/2022',\n seller: {\n name: 'Seller A',\n id: 'SellerId',\n contact: {\n phone: '+34874958678',\n email: 'sesarocampo@sellera.com',\n },\n },\n comment: null,\n orders: [\n {\n orderId: '10012931-12',\n total: 1200.0,\n commission: 400.0,\n totalOrderRate: 0.3,\n },\n {\n orderId: '11212924-14',\n total: 500.0,\n commission: 100.0,\n totalOrderRate: 0.2,\n },\n {\n orderId: '13312931-13',\n total: 1500.0,\n commission: 1000.0,\n totalOrderRate: 0.6,\n },\n ],\n totalizers: {\n subtotal: 1500,\n tax: {\n type: 'percentage',\n value: 10,\n },\n fee: 150,\n total: 1800,\n },\n },\n]\n\n```"
}
] |
code_marketplace-financial-commission_25dcf506
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/clients/index.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport type { ClientsConfig } from '@vtex/api'\nimport type {\n SellersDashboard,\n StatisticsDashboard,\n CommissionInvoice,\n ExternalInvoice,\n} from 'vtex.marketplace-financial-commission'\nimport { IOClients, LRUCache } from '@vtex/api'\nimport { masterDataFor } from '@vtex/clients'\n\nimport Mail from './mail'\nimport { OrdersClient } from './orders'\nimport SellersIO from './sellers'\nimport Template from './template'\nimport AppTokenClient from './vtexLogin'\n\nexport class Clients extends IOClients {\n public get mail() {\n return this.getOrSet('mail', Mail)\n }\n\n public get sellersIO() {\n return this.getOrSet('sellersIO', SellersIO)\n }\n\n public get ordersClient() {\n return this.getOrSet('ordersClient', OrdersClient)\n }\n\n public get sellersDashboardClientMD() {\n return this.getOrSet(\n 'sellersdashboards',\n masterDataFor<SellersDashboard>('sellersdashboards')\n )\n }\n\n public get statisticsDashboardClientMD() {\n return this.getOrSet(\n 'statisticsdashboards',\n masterDataFor<StatisticsDashboard>('statisticsdashboards')\n )\n }\n\n public get template() {\n return this.getOrSet('template', Template)\n }\n\n public get commissionInvoices() {\n return this.getOrSet(\n 'commissioninvoices',\n masterDataFor<CommissionInvoice>('commissioninvoices')\n )\n }\n\n public get externalInvoices() {\n return this.getOrSet(\n 'externalinvoices',\n masterDataFor<ExternalInvoice>('externalinvoices')\n )\n }\n\n public get appTokenClient() {\n return this.getOrSet('appTokenClient', AppTokenClient)\n }\n}\n\nconst TIMEOUT_MS = 60000\nconst memoryCache = new LRUCache<string, any>({ max: 5000 })\n\nmetrics.trackCache('financial-commission', memoryCache)\n\nconst clients: ClientsConfig<Clients> = {\n implementation: Clients,\n options: {\n default: {\n retries: 2,\n timeout: TIMEOUT_MS,\n memoryCache,\n },\n },\n}\n\nexport default clients\n\n```"
}
] |
code_marketplace-financial-commission_303f1c36
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/typings/vtexlistOrder.d.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ninterface List {\n orderId: string\n creationDate: Date\n clientName: string\n items?: any\n totalValue: number\n paymentNames: string\n status: string\n statusDescription: string\n marketPlaceOrderId?: any\n sequence: string\n salesChannel: string\n affiliateId: string\n origin: string\n workflowInErrorState: boolean\n workflowInRetry: boolean\n lastMessageUnread: string\n ShippingEstimatedDate?: any\n ShippingEstimatedDateMax: Date\n ShippingEstimatedDateMin: Date\n orderIsComplete: boolean\n listId?: any\n listType?: any\n authorizedDate: Date\n callCenterOperatorName?: any\n totalItems: number\n currencyCode: string\n hostname: string\n invoiceOutput: string[]\n invoiceInput: string[]\n lastChange: Date\n isAllDelivered: boolean\n isAnyDelivered: boolean\n giftCardProviders?: any\n orderFormId: string\n paymentApprovedDate: Date\n readyForHandlingDate?: any\n deliveryDates: Date[]\n}\n\ninterface Paging {\n total: number\n pages: number\n currentPage: number\n perPage: number\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface Facets {}\n\ninterface TotalValue {\n Count: number\n Max: number\n Mean: number\n Min: number\n Missing: number\n StdDev: number\n Sum: number\n SumOfSquares: number\n Facets: Facets\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface Facets2 {}\n\ninterface TotalItems {\n Count: number\n Max: number\n Mean: number\n Min: number\n Missing: number\n StdDev: number\n Sum: number\n SumOfSquares: number\n Facets: Facets2\n}\n\ninterface Stats2 {\n totalValue: TotalValue\n totalItems: TotalItems\n}\n\ninterface Stats {\n stats: Stats2\n}\n\ninterface VtexListOrder {\n list: List[]\n facets: any[]\n paging: Paging\n stats: Stats\n reportRecordsLimit: number\n}\n\n```"
}
] |
code_marketplace-financial-commission_fc99f703
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/typings/orders.d.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ninterface SellersOrdersDetail {\n sellerId: string\n sellerName: string\n orders: Order[]\n totalComission: number\n totalOrderValue: number\n}\n\ninterface Order {\n orderId: string\n sellerOrderId?: string\n marketplaceOrderId?: string\n totalComission: number\n totalOrderValue: number\n status: string\n statusDescription: string\n creationDate: string\n rate: ItemsRate[]\n}\n\ninterface ItemsRate {\n itemId: string\n nameItem: string\n rate: Rate\n}\n\ninterface Rate {\n productCommissionPercentage: number\n freightCommissionPercentage: number\n}\n\ninterface OrdersResponse {\n data: Order[]\n paging: Paging\n}\n\n```"
}
] |
code_marketplace-financial-commission_8d4042e5
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/typings/dashboard.d.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ninterface Dashboards {\n dateCut?: string\n dateStart?: string\n dateEnd?: string\n sellers: SellersDashboard[]\n statistics?: StatsSeller\n}\n\ninterface SellersDashboard {\n id: string\n name: string\n account: string\n statistics?: StatsSeller\n}\n\ninterface UnificationSellersDashboard extends SellersDashboard {\n statistics: StatsSeller[]\n}\n\ninterface StatsSeller {\n dateInvoiced?: string\n ordersCount: number\n totalComission: number\n totalOrderValue: number\n outstandingBalance?: number\n totalOrdersItems?: number\n totalDiscounts?: number\n totalShipping?: number\n totalTax?: number\n}\n\ninterface OrderComission {\n orderId: string\n sellerOrderId?: string\n totalComission: number\n totalOrdersItems?: number\n totalDiscounts?: number\n totalShipping?: number\n totalTax?: number\n totalOrderValue: number\n totalOrderRate?: number | null\n}\n\ninterface ResultSearch {\n dateStart: string\n dateEnd: string\n sellers: SellersDashboard[] | SellersDashboard\n pagination: Pagination\n}\n\ninterface Pagination {\n currentPage: number\n pageSize: number\n totalPage?: number\n}\n\ninterface StatisticsGeneralDashboard {\n dateStart: string\n dateEnd: string\n statistics: StatsSeller\n}\n\n```"
}
] |
code_marketplace-financial-commission_253dc4aa
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/typings/externalInvoice.d.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nconst enum TypeStatusInvoice {\n PAID = 'paid',\n UNPAID = 'unpaid',\n PARTIAL = 'partial',\n}\n\nexport interface InvoiceExternal {\n status: TypeStatusInvoice\n invoiceCreatedDate: string\n seller: SellerData\n jsonData: string\n}\n\nexport interface SellerData {\n name: string\n id: string\n contact: ContactData\n}\n\nexport interface ContactData {\n phone?: string\n email: string\n}\n\nexport interface EmailInvoiceData {\n id?: string\n status: string\n invoiceCreatedDate: string\n seller: SellerData\n jsonData: JSON\n}\n\n```"
}
] |
code_marketplace-financial-commission_047e935b
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/typings/global.d.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport type { ServiceContext } from '@vtex/api'\nimport type { Clients } from '../clients'\n\ndeclare global {\n type Context = ServiceContext<Clients>\n\n type LoggerMessage = {\n workflowInstance: string\n message: string\n exception?: string\n request?: any\n }\n\n interface DatesInvoice {\n dateInvoiceInitial: string\n dateInvoiceEnd: string\n formattedDate: string\n }\n\n interface ItemSeller {\n id: string\n name: string\n account: string\n productCommissionPercentage: number\n freightCommissionPercentage: number\n isActive: boolean\n }\n\n interface PagingSellers {\n total?: number\n from?: number\n to?: number\n }\n\n interface Sellers {\n items: ItemSeller[]\n paging: PagingSellers\n }\n\n interface SellerListParams {\n pagination?: PagingSellers\n sellerId?: string\n }\n\n interface SellerInvoice extends ItemSeller, SellerSettings {\n email: string\n }\n\n interface Data {\n sellers?: Sellers\n seller?: Seller\n }\n\n interface Seller {\n id: string\n name: string\n account: string\n isActive: string\n }\n\n interface DataSellers {\n data: Data\n }\n\n interface ParamsListOrders {\n fStatus?: string\n fieldDate: string\n fieldDateStart: string\n fieldDateEnd: string\n sellerName: string\n orderBy: string\n page: number\n perpage?: number\n }\n\n interface SearchSellersServiceRequest {\n dateStart: string\n dateEnd: string\n sellersId?: string\n page: number\n pageSize: number\n reIndex?: boolean\n sort?: string\n }\n\n interface SearchStatsServiceRequest {\n dateStart: string\n dateEnd: string\n }\n\n interface SearchOrdersServiceRequest {\n dateStart: string\n dateEnd: string\n sellerName: string\n page: number\n perpage: number\n status?: string\n }\n\n interface Settings {\n billingCycle: string\n endDate: string\n startDate: string\n }\n\n interface SellerSettings extends Settings {\n email: string\n }\n\n const enum TypeIntegration {\n external = 0,\n internal = 1,\n }\n\n interface MarketplaceSettings extends Settings {\n integration: TypeIntegration\n }\n\n type FullFilledResult = {\n status: 'fullfilled'\n value: any\n }\n\n type RejectResult = {\n status: 'rejected'\n reason: string\n }\n\n type PromiseResult = RejectResult | FullFilledResult\n\n interface ResponseCreateToken {\n message: string\n accountId: string\n autheticationToken?: string\n creationDate?: string\n resultVBase: any\n }\n\n interface RequestUpdateToken {\n enabled: boolean\n }\n\n interface ResponseUpdateToken extends ResponseCreateToken {\n lastModificationDate: string\n }\n\n interface DateRange {\n start: string\n end: string\n }\n\n interface ResultSearchSellerList {\n sellers: ItemSeller[]\n pagination: Pagination\n }\n}\n\nexport {}\n\n```"
}
] |
code_marketplace-financial-commission_1328f1c3
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/typings/vbase.d.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ninterface TokenConfiguration {\n id: string\n account: string\n name: string\n autheticationToken: string\n creationDate: string\n lastModificationDate?: string\n enabled: bool\n}\n\n```"
}
] |
code_marketplace-financial-commission_a132ff46
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/typings/vtexorder.d.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\ninterface VtexOrder {\n orderId: string\n sequence: string\n marketplaceOrderId: string\n marketplaceServicesEndpoint: string\n sellerOrderId: string\n origin: string\n affiliateId: string\n salesChannel: string\n merchantName?: any\n status: string\n statusDescription: string\n value: number\n creationDate: string\n lastChange: string\n orderGroup: string\n totals: Total[]\n items: Item[]\n marketplaceItems: any[]\n clientProfileData: ClientProfileData\n giftRegistryData?: any\n marketingData?: any\n ratesAndBenefitsData: RatesAndBenefitsData\n shippingData: ShippingData\n paymentData: PaymentData\n packageAttachment: PackageAttachment\n sellers: Seller[]\n callCenterOperatorData?: any\n followUpEmail: string\n lastMessage?: any\n hostname: string\n invoiceData?: any\n changesAttachment?: any\n openTextField?: any\n roundingError: number\n orderFormId: string\n commercialConditionData?: any\n isCompleted: boolean\n customData?: any\n storePreferencesData: StorePreferencesData\n allowCancellation: boolean\n allowEdition: boolean\n isCheckedIn: boolean\n marketplace: Marketplace\n authorizedDate?: any\n invoicedDate?: any\n cancelReason?: any\n itemMetadata: ItemMetadata\n subscriptionData?: any\n taxData?: any\n checkedInPickupPointId?: any\n cancellationData?: any\n clientPreferencesData: ClientPreferencesData\n}\n\ninterface ClientPreferencesData {\n locale: string\n optinNewsLetter?: any\n}\n\ninterface ItemMetadata {\n Items: Item2[]\n}\n\ninterface Item2 {\n Id: string\n Seller: string\n Name: string\n SkuName: string\n ProductId: string\n RefId: string\n Ean?: string\n ImageUrl: string\n DetailUrl: string\n AssemblyOptions: AssemblyOption[]\n}\n\ninterface AssemblyOption {\n Id: string\n Name: string\n Required: boolean\n InputValues: InputValues\n Composition?: any\n}\n\ninterface InputValues {\n 'vtex.subscription.key.frequency': Vtexsubscriptionkeyfrequency\n 'vtex.subscription.key.purchaseday': Vtexsubscriptionkeyfrequency\n}\n\ninterface Vtexsubscriptionkeyfrequency {\n MaximumNumberOfCharacters: number\n Domain: string[]\n}\n\ninterface Marketplace {\n baseURL: string\n isCertified?: any\n name: string\n}\n\ninterface StorePreferencesData {\n countryCode: string\n currencyCode: string\n currencyFormatInfo: CurrencyFormatInfo\n currencyLocale: number\n currencySymbol: string\n timeZone: string\n}\n\ninterface CurrencyFormatInfo {\n CurrencyDecimalDigits: number\n CurrencyDecimalSeparator: string\n CurrencyGroupSeparator: string\n CurrencyGroupSize: number\n StartsWithCurrencySymbol: boolean\n}\n\ninterface Seller {\n id: string\n name: string\n logo: string\n fulfillmentEndpoint: string\n}\n\ninterface PackageAttachment {\n packages: Package[]\n}\n\ninterface Package {\n items: ItemPackages[]\n courier?: any\n invoiceNumber: string\n invoiceValue: number\n invoiceUrl: string\n issuanceDate: Date\n trackingNumber?: any\n invoiceKey: string\n trackingUrl?: any\n embeddedInvoice: string\n type: string\n courierStatus?: any\n cfop?: any\n restitutions: Restitutions\n volumes?: any\n EnableInferItems?: any\n}\n\ninterface Restitutions {\n Refund: Refund\n}\n\ninterface Refund {\n value: number\n giftCardData?: any\n items: ItemRefund[]\n}\n\ninterface ItemRefund {\n id: string\n quantity: number\n price: number\n description?: any\n}\n\ninterface ItemPackages {\n itemIndex: number\n quantity: number\n price: number\n description: string\n unitMultiplier: number\n}\n\ninterface PaymentData {\n giftCards: any[]\n transactions: Transaction[]\n}\n\ninterface Transaction {\n isActive: boolean\n transactionId: string\n merchantName: string\n payments: Payment[]\n}\n\ninterface Payment {\n id: string\n paymentSystem: string\n paymentSystemName: string\n value: number\n installments: number\n referenceValue: number\n cardHolder?: any\n cardNumber?: any\n firstDigits?: any\n lastDigits?: any\n cvv2?: any\n expireMonth?: any\n expireYear?: any\n url?: any\n giftCardId?: any\n giftCardName?: any\n giftCardCaption?: any\n redemptionCode?: any\n group: string\n tid?: any\n dueDate?: any\n connectorResponses: Content\n giftCardProvider?: any\n giftCardAsDiscount?: any\n koinUrl?: any\n accountId?: any\n parentAccountId?: any\n bankIssuedInvoiceIdentificationNumber?: any\n bankIssuedInvoiceIdentificationNumberFormatted?: any\n bankIssuedInvoiceBarCodeNumber?: any\n bankIssuedInvoiceBarCodeType?: any\n billingAddress?: any\n}\n\ninterface ShippingData {\n id: string\n address: Address\n logisticsInfo: LogisticsInfo[]\n trackingHints?: any\n selectedAddresses: Address[]\n}\n\ninterface LogisticsInfo {\n itemIndex: number\n selectedSla: string\n lockTTL: string\n price: number\n listPrice: number\n sellingPrice: number\n deliveryWindow?: any\n deliveryCompany: string\n shippingEstimate: string\n shippingEstimateDate?: any\n slas: Sla[]\n shipsTo: string[]\n deliveryIds: DeliveryId[]\n deliveryChannel: string\n pickupStoreInfo: PickupStoreInfo\n addressId: string\n polygonName?: any\n pickupPointId?: any\n transitTime: string\n}\n\ninterface DeliveryId {\n courierId: string\n courierName: string\n dockId: string\n quantity: number\n warehouseId: string\n accountCarrierName: string\n}\n\ninterface Sla {\n id: string\n name: string\n shippingEstimate: string\n deliveryWindow?: any\n price: number\n deliveryChannel: string\n pickupStoreInfo: PickupStoreInfo\n polygonName?: any\n lockTTL: string\n pickupPointId?: any\n transitTime: string\n}\n\ninterface PickupStoreInfo {\n additionalInfo?: any\n address?: any\n dockId?: any\n friendlyName?: any\n isPickupStore: boolean\n}\n\ninterface RatesAndBenefitsData {\n id: string\n rateAndBenefitsIdentifiers: RateAndBenefitsIdentifier[]\n}\n\ninterface RateAndBenefitsIdentifier {\n description?: string\n featured: boolean\n id: string\n name: string\n matchedParameters: MatchedParameters\n additionalInfo?: any\n}\n\ninterface MatchedParameters {\n 'combo@Marketing'?: string\n paymentMethodId?: string\n 'product@CatalogSystem'?: string\n}\n\ninterface ClientProfileData {\n id: string\n email: string\n firstName: string\n lastName: string\n documentType: string\n document?: any\n phone: string\n corporateName?: any\n tradeName?: any\n corporateDocument?: any\n stateInscription?: any\n corporatePhone?: any\n isCorporate: boolean\n userProfileId: string\n customerClass?: any\n}\n\ninterface Item {\n uniqueId: string\n id: string\n productId: string\n ean?: string\n lockId: string\n itemAttachment: ItemAttachment\n attachments: any[]\n quantity: number\n seller: string\n name: string\n refId: string\n price: number\n listPrice: number\n manualPrice?: any\n priceTags: PriceTag[]\n imageUrl: string\n detailUrl: string\n components: any[]\n bundleItems: any[]\n params: any[]\n offerings: any[]\n sellerSku: string\n priceValidUntil?: any\n commission: number\n tax: number\n preSaleDate?: string\n additionalInfo: AdditionalInfo\n measurementUnit: string\n unitMultiplier: number\n sellingPrice: number\n isGift: boolean\n shippingPrice?: any\n rewardValue: number\n freightCommission: number\n priceDefinition: PriceDefinition\n taxCode: string\n parentItemIndex?: any\n parentAssemblyBinding?: any\n callCenterOperator?: any\n serialNumbers?: any\n assemblies: any[]\n costPrice: number\n}\n\ninterface PriceDefinition {\n sellingPrices: SellingPrice[]\n calculatedSellingPrice: number\n total: number\n}\n\ninterface SellingPrice {\n value: number\n quantity: number\n}\n\ninterface AdditionalInfo {\n brandName: string\n brandId: string\n categoriesIds: string\n categories: Category[]\n productClusterId: string\n commercialConditionId: string\n dimension: Dimension\n offeringInfo?: any\n offeringType?: any\n offeringTypeId?: any\n}\n\ninterface Dimension {\n cubicweight: number\n height: number\n length: number\n weight: number\n width: number\n}\n\ninterface Category {\n id: number\n name: string\n}\n\ninterface PriceTag {\n name: string\n value: number\n isPercentual: boolean\n identifier: string\n rawValue: number\n rate?: any\n jurisCode?: any\n jurisType?: any\n jurisName?: any\n}\n\ninterface ItemAttachment {\n content: Content\n name?: any\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface Content {}\n\ninterface Total {\n id: string\n name: string\n value: number\n}\n\n```"
}
] |
code_marketplace-financial-commission_303ae2d3
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/middlewares/errorHandler.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\n/**\n * By awaiting the next middleware, we can use this scope to\n * centralize emitted errors down the promise chain.\n */\nexport async function errorHandler(ctx: Context, next: () => Promise<void>) {\n const {\n vtex: { logger },\n } = ctx\n\n try {\n await next()\n } catch (err) {\n const error = err as any\n const { message, status, payload } = error\n\n logger.error({\n message,\n data: error,\n })\n\n ctx.status = status || 500\n ctx.body = payload ? { message, payload } : message\n }\n}\n\n```"
}
] |
code_marketplace-financial-commission_15d42412
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/middlewares/validationParams.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nimport { validationMessage } from '../constants'\n\nexport async function validationParams(type: string, query: any) {\n switch (type) {\n case 'Sellers': {\n const { dateStart, dateEnd, page, pageSize } = query\n\n isRequerid(dateStart, 'dateStart')\n isRequerid(dateEnd, 'dateEnd')\n isRequerid(page, 'page')\n isRequerid(pageSize, 'pageSize')\n isValidDate(dateStart, 'dateStart')\n isValidDate(dateEnd, 'dateEnd')\n\n break\n }\n\n case 'Orders': {\n const { sellerName, dateStart, dateEnd, page, perpage } = query\n\n isRequerid(dateStart, 'dateStart')\n isRequerid(dateEnd, 'dateEnd')\n isRequerid(page, 'page')\n isRequerid(perpage, 'perpage')\n isRequerid(sellerName, 'sellerName')\n isValidDate(dateStart, 'dateStart')\n isValidDate(dateEnd, 'dateEnd')\n break\n }\n\n case 'Statistics': {\n const { dateStart, dateEnd } = query\n\n isRequerid(dateStart, 'dateStart')\n isRequerid(dateEnd, 'dateEnd')\n isValidDate(dateStart, 'dateStart')\n isValidDate(dateEnd, 'dateEnd')\n break\n }\n\n case 'Generate': {\n const { dateStart, dateEnd } = query\n\n if (\n (!dateStart && dateEnd) ||\n (dateStart && !dateEnd) ||\n (dateStart && dateEnd)\n ) {\n isRequerid(dateStart, 'dateStart')\n isRequerid(dateEnd, 'dateEnd')\n isValidDate(dateStart, 'dateStart')\n isValidDate(dateEnd, 'dateEnd')\n\n numberOfDays(new Date(dateStart), new Date(dateEnd))\n\n isToday(dateEnd)\n }\n\n break\n }\n\n case 'ListSellers': {\n const { page, pageSize } = query\n\n isRequerid(page, 'page')\n isRequerid(pageSize, 'pageSize')\n\n break\n }\n\n default:\n break\n }\n}\n\nfunction isValidDate(dateString: string, name: string) {\n // First check for the pattern\n const regexDate = new RegExp(/^\\d{4}-\\d{1,2}-\\d{1,2}$/)\n\n if (!regexDate.test(dateString)) {\n throw new CustomError(\n 400,\n validationMessage.ERROR_MESSAGE_DATE_FORMAT,\n {\n field: name,\n },\n { type: typeof dateString }\n )\n }\n\n // Parse the date parts to integers\n const parts = dateString.split('-')\n const day = parseInt(parts[2], 10)\n const month = parseInt(parts[1], 10)\n const year = parseInt(parts[0], 10)\n\n // Check the ranges of month and year\n if (year < 1000 || year > 3000 || month === 0 || month > 12) {\n throw new CustomError(\n 400,\n validationMessage.ERROR_MESSAGE_DATE_RANGE_MONTH_AND_YEAR,\n {\n field: name,\n },\n { type: typeof dateString }\n )\n }\n\n const monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n\n // Adjust for leap years\n if (year % 400 === 0 || (year % 100 !== 0 && year % 4 === 0)) {\n monthLength[1] = 29\n }\n\n // Check the range of the day\n const rangeday = day > 0 && day <= monthLength[month - 1]\n\n if (!rangeday) {\n throw new CustomError(\n 400,\n validationMessage.ERROR_MESSAGE_DATE_RANGE_DAY,\n {\n field: name,\n },\n { type: typeof dateString }\n )\n }\n}\n\nfunction isRequerid(value: string | number, name: string) {\n if (!value || value === '' || value === null) {\n throw new CustomError(\n 400,\n validationMessage.DEFAULT_ERRORMESSAGE_FIELD_IS_REQUIRED,\n {\n field: name,\n },\n { type: typeof value }\n )\n }\n}\n\nfunction numberOfDays(date1: Date, date2: Date) {\n const date1utc = Date.UTC(\n date1.getFullYear(),\n date1.getMonth(),\n date1.getDate()\n )\n\n const date2utc = Date.UTC(\n date2.getFullYear(),\n date2.getMonth(),\n date2.getDate()\n )\n\n const day = 1000 * 60 * 60 * 24\n const numberDays = (date2utc - date1utc) / day + 1\n\n if (numberDays > 30) {\n throw new CustomError(\n 400,\n validationMessage.ERROR_MESSAGE_DATE_BETWEEN_DAYS,\n {\n field: `dateStart and dateEnd `,\n },\n { type: typeof date1 }\n )\n }\n}\n\nfunction isToday(dateEnd: string) {\n const [date1] = new Date().toISOString().split('T')\n\n if (date1 === dateEnd) {\n throw new CustomError(\n 400,\n validationMessage.ERROR_MESSAGE_DATE_END_EQUAL_OR_GREATER,\n {\n field: `dateEnd `,\n },\n { type: typeof date1 }\n )\n }\n\n if (dateEnd >= date1) {\n throw new CustomError(\n 400,\n validationMessage.ERROR_MESSAGE_DATE_END_EQUAL_OR_GREATER,\n {\n field: `dateEnd `,\n },\n { type: typeof date1 }\n )\n }\n}\n\nclass CustomError extends Error {\n public field: any\n public type: any\n\n // eslint-disable-next-line max-params\n constructor(\n public status: number,\n message: string,\n { field }: { field: string },\n { type }: { type: string }\n ) {\n super(message)\n this.field = field\n this.type = type\n this.stack = ''\n }\n}\n\n```"
}
] |
code_marketplace-financial-commission_91852cd8
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/middlewares/policy.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nexport async function policy(ctx: Context, next: () => Promise<any>) {\n const {\n state: {\n body: { seller },\n },\n } = ctx\n\n const { name } = seller as Seller\n\n ctx.query.sellerName = name\n\n await next()\n}\n\n```"
}
] |
code_marketplace-financial-commission_e8c3c45b
|
[
{
"role": "system",
"content": "You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms."
},
{
"role": "user",
"content": "Show me the implementation of marketplace-financial-commission/node/middlewares/index.ts from the marketplace-financial-commission VTEX app."
},
{
"role": "assistant",
"content": "Here's the implementation:\n\n```typescript\nexport * from './errorHandler'\nexport * from './mail/mail'\nexport * from './validationParams'\nexport * from './dashboard/generate/generate'\nexport * from './dashboard/search/searchSellers'\nexport * from './dashboard/search/searchStatistics'\nexport * from './sellers/sellers'\nexport { response as sellersResponse } from './sellers/response'\nexport * from './sellers/eligibleSellers'\nexport * from './orders/orders'\nexport * from './invoice/resolveInvoice'\nexport * from './invoice/invoicesBySeller'\nexport * from './invoice/generateInvoices'\nexport * from './template/template'\nexport * from './policy'\nexport * from './invoiceExternal'\nexport * from './authentication/authenticationValidationVtex'\n\n```"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.