[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of slider/manifest.json from the slider VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "slider",
  "vendor": "vtex",
  "version": "0.8.3",
  "title": "VTEX Slider",
  "description": "A React Slider component that works well in SPA and SSR",
  "mustUpdateAt": "2020-01-30",
  "scripts": {
    "postreleasy": "vtex publish --verbose"
  },
  "dependencies": {
    "vtex.device-detector": "0.x"
  },
  "builders": {
    "react": "3.x",
    "docs": "0.x"
  },
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of std/README.md from the std VTEX app.

[Assistant]
Here's the implementation:

```markdown
# vtex.land/std

The core apps of the `vex` platform.

These apps do not have external dependencies and they are reviewed and maintained by the VTEX IO core team. The intention is to have a standard set of high quality code that all VTEX IO projects can use fearlessly.

Contributions are welcome!

### Recognition

This is heavily inspired by the great work happening at the Deno community.
```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of disclosure-layout/package.json from the disclosure-layout VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "version": "0.0.0",
  "name": "disclosure-layout",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "lint": "eslint --ext js,jsx,ts,tsx .",
    "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json}\"",
    "test": "cd ./react && yarn test"
  },
  "intl-equalizer": {
    "referenceLocale": "en",
    "localeDirectory": "messages"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.json": [
      "prettier --write"
    ]
  },
  "devDependencies": {
    "@vtex/prettier-config": "^0.3.1",
    "eslint": "^7.4.0",
    "eslint-config-vtex": "^12.7.0",
    "eslint-config-vtex-react": "^6.7.0",
    "husky": "^4.2.5",
    "lint-staged": "^10.2.11",
    "prettier": "^2.0.5",
    "typescript": "^3.9.6"
  }
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of disclosure-layout/manifest.json from the disclosure-layout VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "vendor": "vtex",
  "name": "disclosure-layout",
  "version": "1.0.4",
  "title": "Disclosure Layout",
  "description": "",
  "builders": {
    "react": "3.x",
    "docs": "0.x",
    "store": "0.x"
  },
  "dependencies": {
    "vtex.css-handles": "0.x"
  },
  "registries": [
    "smartcheckout"
  ],
  "policies": [],
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of admin-graphql-ide/package.json from the admin-graphql-ide VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "admin-graphql-ide",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "lint": "eslint --ext js,jsx,ts,tsx .",
    "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json}\""
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.{json,graphql,gql}": [
      "prettier --write"
    ]
  },
  "devDependencies": {
    "@types/node": "^12.12.21",
    "@vtex/prettier-config": "^0.3.1",
    "eslint": "^7.4.0",
    "eslint-config-vtex": "^12.7.0",
    "eslint-config-vtex-react": "^6.7.0",
    "husky": "4.2.3",
    "lint-staged": "10.1.1",
    "prettier": "2.0.2",
    "typescript": "3.9.7"
  }
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of admin-graphql-ide/manifest.json from the admin-graphql-ide VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "admin-graphql-ide",
  "vendor": "vtex",
  "version": "3.8.0",
  "title": "Admin GraphQL IDE",
  "description": "GraphQL IDE for VTEX Admin (GraphiQL)",
  "scripts": {
    "prereleasy": "bash pre.sh"
  },
  "builders": {
    "admin": "0.x",
    "node": "4.x",
    "typedql": "0.x",
    "messages": "1.x",
    "react": "3.x",
    "docs": "0.x"
  },
  "dependencies": {
    "vtex.styleguide": "9.x",
    "vtex.graphql-server": "1.x"
  },
  "policies": [
    {
      "name": "read-workspace-apps"
    },
    {
      "name": "vtex.graphql-server:resolve-graphiql"
    },
    {
      "name": "sphinx-is-admin"
    },
    {
      "name": "outbound-access",
      "attrs": {
        "host": "vtexid.vtex.com.br",
        "path": "/api/vtexid/pub/authenticated/user"
      }
    }
  ],
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of landing-pages/manifest.json from the landing-pages VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "vendor": "vtex",
  "name": "landing-pages",
  "version": "2.0.0",
  "title": "VTEX Landing Pages",
  "description": "VTEX IO Landing Pages",
  "builders": {
    "docs": "0.x"
  },
  "dependencies": {
    "vtex.tetrix": "1.x",
    "vtex.docs-ui": "0.x",
    "vtex.code-cup": "1.x",
    "vtex.io-landing": "1.x"
  },
  "mustUpdateAt": "2018-09-05",
  "categories": [],
  "registries": [
    "smartcheckout"
  ],
  "settingsSchema": {},
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of affirm-components/package.json from the affirm-components VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "affirm-components",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "lint": "eslint --ext js,jsx,ts,tsx .",
    "format": "prettier --write \"**/*.{ts,js,json}\"",
    "cy-r": "cd ./cy-runner && node cy-runner"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.{json,graphql,gql}": [
      "prettier --write"
    ],
    "*.json": [
      "prettier --write"
    ]
  },
  "devDependencies": {
    "@types/node": "^13.7.0",
    "@vtex/prettier-config": "0.1.3",
    "eslint": "6.8.0",
    "eslint-config-vtex": "12.2.1",
    "eslint-config-vtex-react": "^6.0.5",
    "husky": "4.2.0",
    "lint-staged": "10.0.2",
    "prettier": "1.19.1",
    "typescript": "3.7.5"
  }
}
```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of affirm-components/manifest.json from the affirm-components VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "affirm-components",
  "vendor": "vtex",
  "version": "0.0.9",
  "title": "Affirm Components",
  "description": "Frontend components related to Affirm payment method",
  "categories": [],
  "registries": [
    "smartcheckout"
  ],
  "builders": {
    "react": "3.x",
    "store": "0.x",
    "docs": "0.x"
  },
  "mustUpdateAt": "2018-09-05",
  "scripts": {
    "postreleasy": "vtex publish --verbose"
  },
  "dependencies": {
    "vtex.store": "2.x",
    "vtex.product-teaser-interfaces": "1.x",
    "vtex.product-context": "0.x",
    "vtex.product-summary-context": "0.x",
    "vtex.affirm-payment": "2.x",
    "vtex.css-handles": "0.x"
  },
  "policies": [
    {
      "name": "outbound-access",
      "attrs": {
        "host": "{{account}}.vtexcommercestable.com.br",
        "path": "/*"
      }
    }
  ],
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of responsive-values/package.json from the responsive-values VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "version": "0.0.0",
  "devDependencies": {
    "@vtex/intl-equalizer": "^2.5.0",
    "@vtex/prettier-config": "^0.3.6",
    "eslint": "^7.15.0",
    "eslint-config-vtex": "^12.9.1",
    "eslint-config-vtex-react": "^6.9.1",
    "husky": "^4.3.5",
    "lint-staged": "^10.5.3",
    "prettier": "^2.2.1",
    "typescript": "^3.9.7"
  },
  "scripts": {
    "lint": "eslint --ext js,jsx,ts,tsx .",
    "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json}\"",
    "test": "yarn --cwd react test"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.{json,graphql,gql}": [
      "prettier --write"
    ]
  },
  "intl-equalizer": {
    "referenceLocale": "en",
    "localeDirectory": "messages"
  }
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of responsive-values/manifest.json from the responsive-values VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "vendor": "vtex",
  "name": "responsive-values",
  "version": "0.4.2",
  "title": "Responsive Values",
  "description": "Accept different values for different devices",
  "builders": {
    "react": "3.x",
    "docs": "0.x"
  },
  "dependencies": {
    "vtex.device-detector": "0.x"
  },
  "policies": [],
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of salesforce-oauth-middleware/dangerfile.js from the salesforce-oauth-middleware VTEX app.

[Assistant]
Here's the implementation:

```javascript
// dangerfile.js
const { verify } = require('@vtex/danger')

const config = {
  // Set to true to enforce keepachangelog rules.
  keepachangelog: {
    changeVersion: false,
  },
  rules: {
    description: ['fail', { minLength: 20 }],
    assignee: 'fail',
    reviewers: 'fail',
    pr_size: ['warn', { additionLimit: 800, deletionLimit: -1 }],
    lock_file: 'warn',
    no_ignored_test: ['fail', { pattern: /test|spec/i }],
    no_debugger: ['fail', { pattern: /\.[tj]sx?$/i }],
    enforce_graphql_provider: 'off',
  },
}

verify(config)

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of salesforce-oauth-middleware/README.md from the salesforce-oauth-middleware VTEX app.

[Assistant]
Here's the implementation:

```markdown
## Objective

The purpose of this document is to detail the implementation of the middleware responsible for communicating with the Salesforce OAuth provider to store the unique access token per user to enable the front end on the ecommerce my account page to retrieve it later.

## Limitations

Currently, the VTEX ID authentication cookie has a 24 hours lifetime, and the frontend should manage the token refresh. During that process, the VTEX ID will not call the Salesforce OAuth provider to refresh their token.

So, in specific cases, it will be possible that we have a valid VTEX ID token and an expired Salesforce token. When it happens, until we develop the process to refresh it in the current app and the frontend, we will need to redirect the user to the login page to re-authenticate.

## Middleware Workflow

Currently, the VTEX ID speaks directly with the Salesforce OAuth. With the current implementation, the VTEX ID will talk with the middleware, who will be responsible for communicating with Salesforce.

During the user authentication flow, at the moment, the VTEX ID requests to exchange the user's data with Salesforce we will get the user's email and token and store it in a database to be retrieved thru an API exposed by the app.

### Frontend Workflow

The frontend must handle the process of calling the middleware API and then store the access token in the local storage. The response also contains the expiration date, so it is possible to manage when it is about to expire and handle the user behavior.

## API Reference

### Proxy Endpoint

Endpoint used as a proxy to the Salesforce OAuth. The path from Salesforce should be exactly the same as in the Salesforce documentation. The only difference is that we need to add the /_v/oauth-proxy in the beginning of each route.

##### Método GET, POST:
```
https://{{accountName}}.myvtex.com/_v/oauth-proxy/authorizations/{{salesforce-path}}
```

Headers and body should be the same as described in OAuth Provider documentation from Salesforce.

### Retrieve Access Token

Endpoint used to retrieve a user Salesforce access token.

##### Método GET:
```
https://{{accountName}}.myvtex.com/_v/oauth-proxy/autheticated/access-token/
```

##### Header:
```
Accept: application/json
Content-Type: application/json
Cookie: VtexIdclientAutCookie={{VtexIdclientAutCookie}};
```

##### Response:
```Status: 200 OK```

```
{
    ...{{UserInfo}},
    "access_token": "00D3X000002LqRE!AR4AQM.PZS_Talk6BcAODgZ3H83LS2CwBo773pAYYHM0017KZSoGfswpEV0q2FifIUEIkU1NRNFyD.RxQW63poEry3EXFsfI",
    "end_date": "2022-09-27T16:57:03.866Z"
}
```

If the response has the 401 status code, you should refresh the token following what is described in the limitations section.

### Refresh a Token

Endpoint used to refresh a user Salesforce access token.

##### Método GET:
```
https://{{accountName}}.myvtex.com/_v/oauth-proxy/autheticated/refresh-token/
```

##### Header:
```
Accept: application/json
Content-Type: application/json
Cookie: VtexIdclientAutCookie={{VtexIdclientAutCookie}};
```

##### Response:
```Status: 200 OK```

```
{
    ...{{UserInfo}},
    "access_token": "00D3X000002LqRE!AR4AQM.PZS_Talk6BcAODgZ3H83LS2CwBo773pAYYHM0017KZSoGfswpEV0q2FifIUEIkU1NRNFyD.RxQW63poEry3EXFsfI",
    "end_date": "2022-09-27T16:57:03.866Z"
}
```

If the response has the 401 status code, you should refresh the token following what is described in the limitations section.

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of salesforce-oauth-middleware/package.json from the salesforce-oauth-middleware VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "service-example",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "lint": "eslint --ext js,jsx,ts,tsx .",
    "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json}\""
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.{json,graphql,gql}": [
      "prettier --write"
    ]
  },
  "devDependencies": {
    "@types/node": "^12.12.21",
    "@vtex/prettier-config": "^0.3.6",
    "@vtex/danger": "^0.2.7",
    "eslint": "^7.16.0",
    "eslint-config-vtex": "^12.9.3",
    "husky": "^4.3.6",
    "lint-staged": "^10.5.3",
    "prettier": "^2.2.1",
    "typescript": "^3.7.5"
  }
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of salesforce-oauth-middleware/manifest.json from the salesforce-oauth-middleware VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "salesforce-oauth-middleware",
  "vendor": "vtex",
  "version": "1.0.2",
  "title": "Salesforce OAuth Middleware",
  "description": "Middleware to authenticate using Salesforce OAuth and store user access token to be retrieved later",
  "mustUpdateAt": "2018-01-04",
  "categories": [],
  "dependencies": {},
  "builders": {
    "node": "6.x"
  },
  "credentialType": "absolute",
  "policies": [
    {
      "name": "outbound-access",
      "attrs": {
        "host": "portal.vtexcommercestable.com.br",
        "path": "*"
      }
    },
    {
      "name": "outbound-access",
      "attrs": {
        "host": "vtexid.vtex.com.br",
        "path": "*"
      }
    },
    {
      "name": "outbound-access",
      "attrs": {
        "host": "*",
        "path": "*"
      }
    },
    {
      "name": "outbound-access",
      "attrs": {
        "host": "*.force.com",
        "path": "*"
      }
    },
    {
      "name": "vbase-read-write"
    },
    {
      "name": "colossus-fire-event"
    },
    {
      "name": "colossus-write-logs"
    }
  ],
  "settingsSchema": {
    "title": "Salesforce Oauth Middleware Settings",
    "type": "object",
    "properties": {
      "production": {
        "title": "Production Settings",
        "type": "object",
        "properties": {
          "endpoint": {
            "title": "Production Endpoint",
            "description": "(e.g.: https://login.salesforce.com)",
            "type": "string"
          },
          "credentials": {
            "title": "Production Credentials",
            "type": "object",
            "properties": {
              "clientId": {
                "title": "client_id",
                "type": "string"
              },
              "clientSecret": {
                "title": "client_secret",
                "type": "string"
              }
            }
          }
        }
      },
      "staging": {
        "title": "Staging Settings",
        "type": "object",
        "properties": {
          "endpoint": {
            "title": "Staging Endpoint",
            "description": "(e.g.: https://login.salesforce.com)",
            "type": "string"
          },
          "credentials": {
            "title": "Staging Credentials",
            "type": "object",
            "properties": {
              "clientId": {
                "title": "client_id",
                "type": "string"
              },
              "clientSecret": {
                "title": "client_secret",
                "type": "string"
              }
            }
          }
        }
      },
      "configs": {
        "title": "General Middleware Configuration",
        "type": "object",
        "properties": {
          "forceProduction": {
            "title": "Always use production settings",
            "type": "boolean"
          }
        }
      }
    }
  },
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of order-shipping/package.json from the order-shipping VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "order-shipping",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "lint": "eslint --ext js,jsx,ts,tsx .",
    "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json}\""
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.{json,graphql,gql}": [
      "prettier --write"
    ],
    "*.json": [
      "prettier --write"
    ]
  },
  "devDependencies": {
    "@vtex/prettier-config": "^0.1.4",
    "eslint": "^6.8.0",
    "eslint-config-vtex": "^12.3.2",
    "eslint-config-vtex-react": "^6.3.2",
    "husky": "^4.2.0",
    "lint-staged": "^10.0.2",
    "prettier": "^1.19.1",
    "typescript": "^3.7.5"
  }
}
```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of order-shipping/manifest.json from the order-shipping VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "vendor": "vtex",
  "name": "order-shipping",
  "version": "0.8.0",
  "title": "Order Shipping",
  "description": "Order Shipping component",
  "defaultLocale": "pt-BR",
  "builders": {
    "react": "3.x",
    "docs": "0.x"
  },
  "mustUpdateAt": "2019-04-02",
  "scripts": {
    "postreleasy": "vtex publish --verbose"
  },
  "dependencies": {
    "vtex.order-manager": "0.x",
    "vtex.checkout-resources": "0.x",
    "vtex.checkout-graphql": "0.x"
  },
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of vtex-scripts/README.md from the vtex-scripts VTEX app.

[Assistant]
Here's the implementation:

```markdown
# VTEX Scripts

This package contains the scripts and build configuration for the VTEX modules.

## Usage

1.  Add the `@vtex/vtex-scripts` to your devDependencies

```sh
$ yarn add @vtex/vtex-scripts enzyme enzyme-adapter-react-16 jsdom --dev
```

2. Add the following scripts to your `package.json`

```json
{
  "scripts": {
    "build": "vtex-scripts build",
    "test": "vtex-scripts test"
  }
}
```

3. Add the following to a `setupTests.js` in the root of your _source_ directory

```js
import Enzyme from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
import { JSDOM } from 'jsdom'

const jsdom = new JSDOM('<!doctype html>')

global.window = jsdom.window
global.document = window.document

Enzyme.configure({ adapter: new Adapter() })
```

## Configurations

You can also customize some default configurations that comes with `vtex-scripts`

The following properties can be supplied in a `vtexScriptsOverride` property inside your `package.json`

| Name                 |   Type   | Description                                                        |
| -------------------- | :------: | ------------------------------------------------------------------ |
| `srcPath`            | `String` | The relative path of your sources directory (e.g. `./src`)         |
| `distPath`           | `String` | The relative path of your compiled files directory (e.g. `./dist`) |
| `setupTestsFilename` | `String` | The filename of the tests setup file (e.g. `setupTests.js`)        |

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of vtex-scripts/package.json from the vtex-scripts VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "@vtex/vtex-scripts",
  "version": "0.4.13",
  "description": "VTEX miscelaneous build scripts",
  "bin": {
    "vtex-scripts": "./bin/vtex-scripts.js"
  },
  "files": [
    "bin",
    "config",
    "scripts",
    "utils",
    ".babelrc"
  ],
  "repository": {
    "type": "git",
    "url": "git+https://github.com/vtex-apps/vtex-scripts.git"
  },
  "author": "VTEX",
  "license": "ISC",
  "dependencies": {
    "babel": "~6.23.0",
    "babel-jest": "~22.4.3",
    "babel-loader": "~7.1.4",
    "babel-plugin-dynamic-import-node": "^1.2.0",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "chalk": "~2.4.0",
    "css-loader": "^0.28.11",
    "enzyme": "~3.3.0",
    "enzyme-adapter-react-16": "~1.1.1",
    "enzyme-to-json": "~3.3.3",
    "fs-extra": "~5.0.0",
    "graphql": "~0.13.2",
    "graphql-tag": "~2.8.0",
    "jest": "~22.4.3",
    "jest-transform-graphql": "~2.1.0",
    "node-sass": "^4.9.0",
    "react": "^16.3.2",
    "react-dev-utils": "~5.0.1",
    "react-dom": "^16.3.2",
    "sass-loader": "^7.0.1",
    "style-loader": "^0.21.0",
    "svg-inline-loader": "^0.8.0",
    "url-loader": "^1.0.1",
    "webpack": "~4.5.0"
  },
  "bugs": {
    "url": "https://github.com/vtex-apps/vtex-scripts/issues"
  },
  "homepage": "https://github.com/vtex-apps/vtex-scripts#readme"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of custom-stock-export/README.md from the custom-stock-export VTEX app.

[Assistant]
Here's the implementation:

```markdown
##  ⚠ Maintenance ⚠
*Starting September 1st 2022, this application will no longer be maintained by VTEX. Code is released for free under the GNU/PL Agreement for you to use and modify at your convenience. The VTEX repository shall remain unchanged with the original version.*

---

This app was not ended

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of adserver-resolver/policies.json from the adserver-resolver VTEX app.

[Assistant]
Here's the implementation:

```json
[
  {
    "name": "resolve-graphql",
    "description": "Allows access to resolve a graphql request",
    "statements": [
      {
        "actions": ["post", "get"],
        "effect": "allow",
        "resources": [
          "vrn:vtex.adserver-resolver:{{region}}:{{account}}:{{workspace}}:/_v/graphql"
        ]
      }
    ]
  }
]

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of adserver-resolver/README.md from the adserver-resolver VTEX app.

[Assistant]
Here's the implementation:

```markdown
# Ad Server Resolver

This app is an implementation of VTEX's Ad Server, that wraps the VTEX Ad Server related API calls.

This protocol is defined by VTEX's [Ad Server GraphQL schema](https://github.com/vtex-apps/adserver-graphql).

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of adserver-resolver/tsconfig.eslint.json from the adserver-resolver VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "extends": "./node/tsconfig.json",
  "include": ["**/*.ts", "**/*.tsx", "**/*.js"],
  "exclude": []
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of adserver-resolver/package.json from the adserver-resolver VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "adserver-resolver",
  "version": "0.0.1",
  "description": "The resolver for VTEX's Ad Server GraphQL schema.",
  "main": "node/index.ts",
  "repository": "git@github.com:vtex-apps/adserver-resolver.git",
  "author": "Henrique Caúla <henrique.caula@vtex.com.br>",
  "license": "UNLICENSED",
  "scripts": {
    "lint": "eslint --ext js,jsx,ts,tsx .",
    "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json}\"",
    "prepare": "husky install"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "prettier --write",
      "yarn lint --fix"
    ],
    "*.{json,graphql,gql}": [
      "prettier --write"
    ]
  },
  "devDependencies": {
    "@types/jest": "^29.5.3",
    "@types/node": "^20.5.0",
    "@vtex/prettier-config": "^1.0.0",
    "eslint": "^8.47.0",
    "eslint-config-vtex": "^15.0.2",
    "eslint-plugin-prettier": "^5.0.0",
    "husky": "^8.0.3",
    "lint-staged": "^14.0.0",
    "prettier": "^3.0.2",
    "typescript": "^5.1.6"
  }
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of adserver-resolver/manifest.json from the adserver-resolver VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "vendor": "vtex",
  "name": "adserver-resolver",
  "version": "2.10.4",
  "title": "Ad Server Resolver",
  "description": "Configurations for sponsored products on your store",
  "builders": {
    "node": "6.x"
  },
  "dependencies": {
    "vtex.adserver-graphql": "0.x"
  },
  "policies": [
    {
      "name": "vbase-read-write"
    },
    {
      "name": "outbound-access",
      "attrs": {
        "host": "ad-server.vtex.systems",
        "path": "/api/*"
      }
    },
    {
      "attrs": {
        "host": "portal.vtexcommercestable.com.br",
        "path": "/api/checkout/regions/*"
      },
      "name": "outbound-access"
    },
    {
      "attrs": {
        "host": "newtail-media.newtail.com.br",
        "path": "*"
      },
      "name": "outbound-access"
    }
  ],
  "settingsSchema": {
    "title": "AdServer Resolver",
    "type": "object",
    "properties": {
      "enableAdsOnCollections": {
        "title": "Enable sponsored products on collections",
        "description": "If checked, sponsored products will be displayed on product collections.",
        "type": "boolean",
        "default": true
      },
      "enableNewtail": {
        "title": "Enable Newtail",
        "description": "If checked, Newtail will be used to display sponsored products.",
        "type": "boolean",
        "default": false
      },
      "newtailPublisherId": {
        "title": "Newtail Publisher ID",
        "description": "The publisher ID provided by Newtail.",
        "type": "string",
        "default": ""
      }
    }
  },
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of flow-finance-payment/package.json from the flow-finance-payment VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "affirm-payment",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "lint": "eslint --ext js,jsx,ts,tsx .",
    "format": "prettier --write \"**/*.{ts,js,json}\""
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.json": [
      "prettier --write"
    ]
  },
  "devDependencies": {
    "@types/node": "^13.7.0",
    "@vtex/prettier-config": "^0.1.4",
    "eslint": "6.8.0",
    "eslint-config-vtex": "12.2.1",
    "eslint-config-vtex-react": "^6.0.5",
    "husky": "4.2.0",
    "lint-staged": "10.0.2",
    "prettier": "1.19.1",
    "typescript": "3.7.5"
  }
}
```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of flow-finance-payment/manifest.json from the flow-finance-payment VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "flow-finance-payment",
  "vendor": "vtex",
  "version": "0.0.4",
  "title": "Flow Finance Payment",
  "description": "An implentation of Flow Finance payment method",
  "categories": [],
  "registries": ["smartcheckout"],
  "builders": {
    "react": "2.x",
    "pages": "0.x",
    "docs": "0.x"
  },
  "mustUpdateAt": "2018-09-05",
  "scripts": {
    "postreleasy": "vtex publish --verbose"
  },
  "dependencies": {
    "vtex.styleguide": "8.x"
  },
  "policies": [
    {
      "name": "outbound-access",
      "attrs": {
        "host": "{{account}}.vtexcommercestable.com.br",
        "path": "/*"
      }
    },
    {
      "name": "outbound-access",
      "attrs": {
        "host": "{{account}}.vtexpayments.com.br",
        "path": "/*"
      }
    }
  ],
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of KI-398695/KI-398695.js from the KI-398695 VTEX app.

[Assistant]
Here's the implementation:

```javascript
$(document).ready(function () {
  addModalObserver();
});
function addModalObserver() {
  let open = false;
  const observerPupModal = new MutationObserver((mutations, obsPM) => {
    const pupModal = document.querySelector(".pkpmodal");

    if (document.contains(pupModal)) {
      if (!open){
          addSeachObserver();
          open = !open
          //obsPM.disconnect();
          return;
      }
    }
    else{
        open = false
    }

  });

  observerPupModal.observe(document, {
    childList: true,
    subtree: true,
  });
}
function addSeachObserver() {
  const observerSearch = new MutationObserver((mutations, obsS) => {
    const pkpmodalSearch = document.querySelector("#pkpmodal-search");
    if (document.contains(pkpmodalSearch)) {
      const input = pkpmodalSearch.querySelector("input");
      input.addEventListener("change", (event) => {
        setTimeout(() => {
          getOrderForm();
        }, 500);
      });

      obsS.disconnect();
    }
  });

  observerSearch.observe(document, {
    childList: true,
    subtree: true,
  });
}

function getOrderForm() {
vtexjs.checkout.getOrderForm().then((orderForm) => {
  getPupDistance(orderForm);
});
}

function getPupDistance(orderForm) {
const logisticsInfoSlas = orderForm.shippingData.logisticsInfo
  .map((logisticInfo) => {
    return logisticInfo.slas;
  })
  .flat();

const slasPUP = logisticsInfoSlas.filter((sla) => {
  return sla.deliveryChannel === "pickup-in-point";
});
const slas = [];
slasPUP.forEach((sla) => {
  if (!slas.some((s) => s.id === sla.id)) {
    slas.push({
      id: sla.id,
      value: sla,
    });
  }
});
slas.forEach((sla) => {
  const { pickupDistance } = sla.value;
  addSectionObserver(sla.id, sla.value.pickupDistance);
});
}

function updatePupElements(id, pickupDistance) {
  //validar que exista el elemento
  const parseId = id.replace(" ", "-").replace("(", "").replace(")", "");
  const pkpmodalPointsList = document.querySelector(".pkpmodal-points-list");
  if(typeof(pkpmodalPointsList) && pkpmodalPointsList != null){
    const element = pkpmodalPointsList.querySelector("#" + parseId);
    const distanceElement = element.querySelector(
        ".pkpmodal-pickup-point-distance"
    );
    const actualDistance = distanceElement.textContent;
    const unit = actualDistance.split(" ")[1];
    const parsePickupDistance = parseFloat(pickupDistance)
        .toFixed(1)
        .replace(".", ",");
    const newDistance = parsePickupDistance + " " + unit;
    distanceElement.textContent = newDistance;
  }
}

function addSectionObserver(id, pickupDistance) {
  let open = false;
  const observerSection = new MutationObserver((mutations, obsPM) => {
  const pickupPointDistance = document.querySelector(".pkpmodal-pickup-point-distance");

  if (document.contains(pickupPointDistance)) {
      if (!open){
          updatePupElements(id, pickupDistance);
          open = !open
          //obsPM.disconnect();
          return;
      }
  }
  else{
      open = false
  }

  });

  observerSection.observe(document, {
  childList: true,
  subtree: true,
  });
}
```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of KI-398695/README.md from the KI-398695 VTEX app.

[Assistant]
Here's the implementation:

```markdown
# [KI-398695] Distance from pickup stores are not updated on map when entering new address

This script solves the KI https://vtexhelp.zendesk.com/agent/tickets/398695.

You need to add the script to the checkout at the `checkout6-custom.js`.

## Contributors ✨

Thanks goes to these wonderful people:

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tr>
    <td align="center"><a href="https://github.com/germanBonacchi"><img src="https://avatars.githubusercontent.com/u/55905671?v=4" width="100px;" alt=""/><br /><sub><b>Germán Bonacchi</b></sub></a><br /><a href="https://github.com/vtex-apps/KI-398695/commits?author=germanBonacchi" title="Code">💻</a></td>
    <td align="center"><a href="https://github.com/watchmakercomeback"><img src="https://avatars.githubusercontent.com/u/102434124?v=4" width="100px;" alt=""/><br /><sub><b>Carlos Andrés Castaño Carrasquilla</b></sub></a><br /><a href="https://github.com/vtex-apps/KI-398695/commits?author=watchmakercomeback" title="Code">💻</a></td>
</tr>
</table>

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of actionpay/manifest.json from the actionpay VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "actionpay",
  "vendor": "vtex",
  "version": "0.1.3",
  "title": "Actionpay",
  "description": "Actionpay VTEX App",
  "billingOptions": {
    "termsURL": "",
    "support": {
      "url": "https://support.vtex.com/hc/requests"
    },
    "free": true
  },
  "builders": {
    "react": "3.x",
    "store": "0.x",
    "pixel": "0.x",
    "docs": "0.x"
  },
  "dependencies": {
    "vtex.pixel-interfaces": "1.x"
  },
  "settingsSchema": {
    "title": "Actionpay Settings",
    "type": "object",
    "properties": {
      "actionpayPartnerId": {
        "title": "Partner ID",
        "description": "Enter your Actionpay Partner ID",
        "type": "string"
      },
      "actionpayPostclick": {
        "title": "Post-click",
        "description": "Enter your Actionpay Post-click",
        "type": "number"
      },
      "actionpayCampaignId": {
        "title": "Campaign ID",
        "description": "Enter your Actionpay Campaign ID",
        "type": "string"
      }
    }
  },
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of add-to-cart-validation/README.md from the add-to-cart-validation VTEX app.

[Assistant]
Here's the implementation:

```markdown
##  ⚠ Maintenance ⚠
*After June 27 of 2022, this application will no longer be maintained by the FPA APUB team or the RPT LATAM team. Maintenance will be the responsibility of the ecosystem, everyone will be able to make a branch with the changes or improvements they want to make, make a pull request and we will approve it.*

---

# Add-to-cart Validation

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of add-to-cart-validation/package.json from the add-to-cart-validation VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "countdown",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "lint": "eslint --ext js,jsx,ts,tsx .",
    "format": "prettier --write \"**/*.{ts,js,json}\""
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.{json,graphql,gql}": [
      "prettier --write"
    ]
  },
  "devDependencies": {
    "@vtex/prettier-config": "^0.1.4",
    "eslint": "^7.12.1",
    "eslint-config-vtex": "^12.3.2",
    "eslint-config-vtex-react": "^6.2.1",
    "husky": "^4.2.3",
    "lint-staged": "^10.1.1",
    "prettier": "^2.0.2",
    "typescript": "^3.8.3"
  }
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of add-to-cart-validation/manifest.json from the add-to-cart-validation VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "vendor": "vtexarg",
  "name": "add-to-cart-validation",
  "version": "0.0.1",
  "title": "Add to cart validation component",
  "description": "Add to cart validation component",
  "defaultLocale": "pt-BR",
  "builders": {
    "messages": "1.x",
    "store": "0.x",
    "react": "3.x"
  },
  "dependencies": {
    "vtex.styleguide": "9.x",
    "vtex.css-handles": "0.x",
    "vtex.order-manager": "0.x",
    "vtex.product-context": "0.x",
    "vtex.order-items": "0.x",
    "vtex.store-resources": "0.x"
  },
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of product-highlights/package.json from the product-highlights VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "product-highlights",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "lint": "eslint --ext js,jsx,ts,tsx .",
    "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json}\"",
    "test": "cd ./react && yarn test"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.{json,graphql,gql}": [
      "prettier --write"
    ],
    "*.json": [
      "prettier --write"
    ]
  },
  "devDependencies": {
    "@vtex/prettier-config": "^0.3.1",
    "eslint": "^7.4.0",
    "eslint-config-vtex": "^12.7.0",
    "eslint-config-vtex-react": "^6.7.0",
    "husky": "^4.2.5",
    "lint-staged": "^10.2.11",
    "prettier": "^2.0.5",
    "typescript": "^3.9.6"
  },
  "version": "0.0.0"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of product-highlights/manifest.json from the product-highlights VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "vendor": "vtex",
  "name": "product-highlights",
  "version": "2.3.2",
  "title": "Product Highlights",
  "description": "",
  "builders": {
    "react": "3.x",
    "docs": "0.x",
    "store": "0.x",
    "messages": "1.x"
  },
  "dependencies": {
    "vtex.product-context": "0.x",
    "vtex.native-types": "0.x",
    "vtex.css-handles": "0.x"
  },
  "registries": [
    "smartcheckout"
  ],
  "policies": [],
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of cy-runner/cy-runner.js from the cy-runner VTEX app.

[Assistant]
Here's the implementation:

```javascript
const cfg = require('./node/config')
const system = require('./node/system')
const logger = require('./node/logger')
const cypress = require('./node/cypress')
const workspace = require('./node/workspace')
const { deprecated } = require('./node/deprecated')
const { report } = require('./node/report')
const { runTests } = require('./node/test')
const { issue } = require('./node/jira')

// Controls test state
const control = {
  start: system.tick(),
  timing: {},
  specsFailed: [],
  specsSkipped: [],
  specsDisabled: [],
  specsPassed: [],
  runUrl: null,
}

async function main() {
  // Init logger
  logger.init()

  // Welcome message
  logger.msgSection('Cypress Runner')

  // Read cy-runner.yml configuration
  const config = await cfg.getConfig('cy-runner.yml')

  // Init workspace set up
  control.timing.initWorkspace = await workspace.init(config)

  // Install apps
  control.timing.installApps = await workspace.installApps(config)

  // Uninstall apps
  control.timing.uninstallApps = await workspace.uninstallApps(config)

  // Link app
  const link = await workspace.linkApp(config)

  control.timing.linkApp = link.time

  if (link.success) {
    if (config.base.cypress.devMode) {
      logger.msgWarn('Please, wait the flow when you finish')
      logger.msgPad('This will ensure the release and teardown will run')
      await cypress.open()
    } else {
      const call = await runTests(config)

      control.timing.strategy = call.time
      control.specsFailed = call.specsFailed
      control.specsSkipped = call.specsSkipped
      control.specsDisabled = call.specsDisabled
      control.specsPassed = call.specsPassed
      control.runUrl = call.runUrl

      // Jira automation
      if (config.base.jira.enabled && control.specsFailed?.length) {
        await issue(config, control.specsFailed, control.runUrl)
      }
    }
  }

  // Teardown
  if (link.subprocess) link.subprocess.kill('SIGHUP')
  control.timing.teardown = await workspace.teardown(config, link.success)

  // Report deprecated flags
  await deprecated(config)

  // Final Report
  control.timing.total = system.tack(control.start)
  await report(control, config)
}

main().then((r) => r)

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of cy-runner/README.md from the cy-runner VTEX app.

[Assistant]
Here's the implementation:

```markdown
# Cypress Runner

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=vtex-apps_cy-runner&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=vtex-apps_cy-runner)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=vtex-apps_cy-runner&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=vtex-apps_cy-runner)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=vtex-apps_cy-runner&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=vtex-apps_cy-runner)

Tool to orchestrate Cypress tests at VTEX

## Features
* Automate authentication on VTEX Toolbelt (using [VTEX Toolbelt Action](https://github.com/vtex/action-toolbelt))
* Manage workspace: installing, uninstalling, creation, and deletion
* Link the application to be tested
* Orchestrate tests to run in parallel ([Cypress Dashboard](https://www.cypress.io/dashboard) or [Sorry-Cypress](https://sorry-cypress.dev/))
* Report execution time and status of each spec
* Report Cypress Dashboard link
* Create Jira tickets in case of failure
* Save artifacts to make easier debug failures
* Wipe data (needs spec to do it)
* Full teardown

## Run it on a GitHub Action
```yaml
name: '[QE] Quality Engineering'

on:
  push:

jobs:
  cypress:
    name: Cypress
    runs-on: ubuntu-latest
    timeout-minutes: 30
    concurrency:
      group: ${{ github.workflow }}
    steps:
      - name: Checkout App
        uses: actions/checkout@v3
      - name: Checkout Cy-Runner
        uses: actions/checkout@v3
        with:
          repository: vtex-apps/cy-runner
          ref: main
          path: cy-runner
      - name: Set up Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 16
          cache: yarn
        continue-on-error: true
      - name: Install Cy-Runner packages
        run: |
          yarn install --frozen-lockfile --prod
          yarn cypress info
        working-directory: cy-runner
      - name: Run tests
        run: node cy-runner
        working-directory: cy-runner
        env:
          VTEX_QE: ${{ secrets.cypressJSON }}
          NODE_NO_WARNINGS: 1
      - name: Save test results
        uses: actions/upload-artifact@v3
        if: always()
        with:
          name: cy-runner-logs
          path: |
            cy-runner/logs
            !cy-runner/logs/**/*.mp4
          retention-days: 3
```

## Run it locally
1. Clone the app repository to be tested
2. Add a `cy-runner.yml` configuration file using the configuration template
3. Create a env or local file with the secrets using the secrets template (`.VTEX_QE.json` in our example)
3. Add a `cy-r` inside your `package.json` file to make easier call cy-runner or call it directly by `node cy-runner`
```txt
scripts {
    ...,
    "cy-r": "cd cy-runner && node cy-runner",
    ...
}
```
4. If you are developing `cy-r`, maybe can be useful check it before start the tests. To do so, add another line in your `package.json`
```txt
scripts {
    ...,
    "cy-r": "cd cy-runner && node cy-runner",
    "cy-d": "cd cy-runner && git pull && node cy-runner",
    ...
}
```

## Setup
One important part of the setup is the installation, uninstallation, and link apps. To generate a name for your new workspace on every run, keep the name of it as `random`. If you want to use a created workspace because you don't need to install, uninstall or link any app, you can fill the name with your workspace:

```yaml
[...]
workspace:
  name: random
  prefix: b2b
  linkApp:
    # In this case, the app to be installed will be read by the manifest.json file
    enabled: true
  installApps:
    - vtex.mySuperCoolApp
    - vtex.myAnotherSuperCoolApp
  removeApps:
    - vtex.defaultTheme
[...]
```
## Tests
After a successful setup, `cypress-runner` will take care of your tests, it will start one by one or in parallel (max 3 jobs in parallel at this point), and make sure that dependent tests only run if the dependencies pass first. If you are planing to run tests in parallel locally, then you can use more than three jobs (if your machine has power to do so), but in this case you'll need to set `base.cypress.sorry` as `true` and make sure that you have a [Sorry Cypress](https://sorry-cypress.dev/) up and running locally. On each strategy you can add as many specs as you need.

### To run all tests without any dependency with local parallelization

To configure the parallelization with five jobs you can take advantage of the following example. Note the `hardTries`, it is useful when you wan't to try more the one time with a fresh browser start between the tries. If you have `specA`, `specB`, and `specC` and the `specB` fails during the strategy, only the `specB` will be tested on the next retry.

```yaml
[...]
cypress:
  maxJobs: 3
  quiet: true
  projectId: myProjectId
  video: true
  videoCompression: false
  browser: chrome
  chromeWebSecurity: false

strategy:
  # You can call whatever you want
  myTests:
    enabled: true
    sendDashboard: false
    hardTries: 1
    stopOnFail: false
    parallel: true
    specs:
      - cypress/integration/specA.spec.js
      - cypress/integration/specB.spec.js
      - cypress/integration/specC.spec.js
      - cypress/integration/specD.spec.js
      - cypress/integration/specE.spec.js
      # You can use wildcard here:
      # It'll be the same if you have only those three specs on the same folder
      # - cypress/integration/spec?.spec.js
```

### Fail fast

The option `strategy.buyItems.stopOnFail` as `true` instruct Cy Runner to stop the test soon as it fails.

```yaml
[...]
cypress:
  maxJobs: 3
  quiet: true
  projectId: myProjectId
  video: true
  videoCompression: false
  browser: chrome
  chromeWebSecurity: false

strategy:
  buyItems:
    enabled: true
    sendDashboard: true
    hardTries: 1
    stopOnFail: true
    parallel: true
    specs:
      - cypress/integration/buyCoffee.spec.js
      - cypress/integration/buyCoffeeMaker.spec.js
  checkInventory:
    enabled: true
    sendDashboard: true
    hardTries: 1
    stopOnFail: false
    parallel: true
    specs:
      - cypress/integration/checkInventory.spec.js
    dependency:
      - cypress/integration/buyCoffee.spec.js
      - cypress/integration/buyCoffeeMaker.spec.js
  checkOrders:
    enabled: true
    sendDashboard: true
    hardTries: 3
    stopOnFail: false
    parallel: true
    specs:
      - cypress/integration/checkOrders.spec.js
    dependency:
      - cypress/integration/checkInventory.spec.js

```

## Results

All artifacts from the test are saved on the `cy-runner/logs` folder. If you are using GitHub Actions, you can download the logs as artifacts.

1. Detailed report of each run for each test as yaml
2. The app versions used on the test in txt
3. The app dependency versions used on the test in json
4. The state files to with products IDs and invoices
5. The VTEX Toolbelt debug in json
6. The verbose linked application log in txt
7. The screenshots of the failures (if enabled)
8. The videos with the records (if enabled)
9. The Cy Runner log as the example bellow

Also, you have the `cy-runner.log` file, that will show you how the tests were conducted, the main failures and the time to do each task. Next we'll show one example of it:
```txt
#### Cypress Runner

     [✓] Loading cy-runner configuration
      -  ./avalara/cy-runner.yml
     [✓] Checking toolbelt version
     [✓] Defining workspace
      -  avalara3967668
     [✓] Loading secrets
      -  from file ./cy-runner/.VTEX_QE.json
     [!] Auto configuring Cypress flags
      -  Set base.skipAutoConfigOnCI to true to avoid auto config

#### Sections to run

     [✓] base.secrets
     [✓] base.jira
     [✓] workspace.linkApp
     [✓] workspace.wipe
      -  wipe.spec.js
     [✓] workspace.teardown
     [✓] strategy.config
      -  1.0-syncCustomUIConf.spec.js
     [✓] strategy.apiTests
      -  1.1-addressVerification.spec.js
      -  1.2-postalCode.spec.js
      -  1.3-sku.spec.js
      -  1.4-taxFallback.spec.js
         ☍ 1.0-syncCustomUIConf.spec.js
     [✓] strategy.basicTests
      -  2.1-singleproduct.spec.js
      -  2.2-multiproduct.spec.js
      -  2.5-externalSeller.spec.js
      -  2.6-promotional_product.spec.js
         ☍ 1.0-syncCustomUIConf.spec.js
     [✓] strategy.verifyTax
      -  2.3-discountProduct.spec.js
      -  2.4-discountShipping.spec.js
         ☍ 1.0-syncCustomUIConf.spec.js
     [✓] strategy.transaction
      -  2.7-transaction.spec.js
         ☍ 2.1-singleproduct.spec.js
         ☍ 2.2-multiproduct.spec.js
         ☍ 2.3-discountProduct.spec.js
         ☍ 2.4-discountShipping.spec.js
         ☍ 2.5-externalSeller.spec.js
         ☍ 2.6-promotional_product.spec.js
     [✓] strategy.refund
      -  2.8-fullRefund-transaction.spec.js
      -  2.9-partialRefund-transaction.spec.js
         ☍ 2.1-singleproduct.spec.js
         ☍ 2.2-multiproduct.spec.js

#### Cypress set up

     [✓] Getting admin cookie
     [✓] Getting user cookie
      -  vtexappkey-productusqa-OFGEHT
     [✓] Creating Cypress environment
      -  ./cy-runner/cypress.env.json
      -  ./cy-runner/cypress.json
     [✓] Creating state file
      -  .orders.json
     [✓] Linking local Cypress code on Cy-Runner
      -  ./cy-runner/cypress-shared/support/common -> ./cypress/support/common
      -  ./cypress -> ./cy-runner/cypress
     [✓] Exporting envs variables
      -  ELECTRON_EXTRA_LAUNCH_ARGS = --disable-gpu --disable-software-rasterizer
      -  LIBVA_DRIVER_NAME = --disable-software-rasterizer
      -  DISPLAY = :99
      -  NODE_NO_WARNINGS = 1

#### Workspace set up

     [✓] Changing workspace
      -  avalara3967668
     [✓] Updating ./avalara/.vtexignore
     [✓] Reading ./avalara/manifest.json
     [✓] Linking vtex.avalara@3.4.0
      -  waiting 120 seconds until link gets ready
      -  waiting 110 seconds until link gets ready
      -  waiting 100 seconds until link gets ready
     [✓] App linked successfully

#### [try 1/2] Strategy Config

     [✓] Specs to run on this try
      -  1.0-syncCustomUIConf.spec.js
     [✓] Strategy Config ran successfully
      -  Passed: 1.0-syncCustomUIConf.spec.js

#### [try 1/3] Strategy Api Tests

     [✓] Dashboard URL
      -  https://dashboard.cypress.io/projects/9myhsu/runs/364
     [✓] Specs to run on this try
      -  1.1-addressVerification.spec.js
      -  1.2-postalCode.spec.js
      -  1.3-sku.spec.js
      -  1.4-taxFallback.spec.js
     [✓] Strategy Api Tests ran successfully
      -  Passed: 1.0-syncCustomUIConf.spec.js
      -  Passed: 1.1-addressVerification.spec.js
      -  Passed: 1.2-postalCode.spec.js
      -  Passed: 1.3-sku.spec.js
      -  Passed: 1.4-taxFallback.spec.js

     [✓] Dashboard URL
      -  https://dashboard.cypress.io/projects/9myhsu/runs/364
     [✓] Specs to run on this try
      -  2.1-singleproduct.spec.js
      -  2.2-multiproduct.spec.js
      -  2.5-externalSeller.spec.js
      -  2.6-promotional_product.spec.js
      -  Passed: 1.0-syncCustomUIConf.spec.js
      -  Passed: 1.1-addressVerification.spec.js
      -  Passed: 1.2-postalCode.spec.js
      -  Passed: 1.3-sku.spec.js
      -  Passed: 1.4-taxFallback.spec.js
      -  Passed: 2.1-singleproduct.spec.js
      -  Passed: 2.2-multiproduct.spec.js
      -  Passed: 2.5-externalSeller.spec.js
      -  Passed: 2.6-promotional_product.spec.js

#### [try 1/2] Strategy Verify Tax

     [✓] Dashboard URL
      -  https://dashboard.cypress.io/projects/9myhsu/runs/364
     [✓] Specs to run on this try
      -  2.3-discountProduct.spec.js
      -  2.4-discountShipping.spec.js
     [✓] Strategy Verify Tax ran successfully
      -  Passed: 1.0-syncCustomUIConf.spec.js
      -  Passed: 1.1-addressVerification.spec.js
      -  Passed: 1.2-postalCode.spec.js
      -  Passed: 1.3-sku.spec.js
      -  Passed: 1.4-taxFallback.spec.js
      -  Passed: 2.1-singleproduct.spec.js
      -  Passed: 2.2-multiproduct.spec.js
      -  Passed: 2.3-discountProduct.spec.js
      -  Passed: 2.4-discountShipping.spec.js
      -  Passed: 2.5-externalSeller.spec.js
      -  Passed: 2.6-promotional_product.spec.js

#### [try 1/2] Strategy Transaction

     [✓] Dashboard URL
      -  https://dashboard.cypress.io/projects/9myhsu/runs/364
     [✓] Specs to run on this try
      -  2.7-transaction.spec.js
     [✓] Strategy Transaction ran successfully
      -  Passed: 1.0-syncCustomUIConf.spec.js
      -  Passed: 1.1-addressVerification.spec.js
      -  Passed: 1.2-postalCode.spec.js
      -  Passed: 1.3-sku.spec.js
      -  Passed: 1.4-taxFallback.spec.js
      -  Passed: 2.1-singleproduct.spec.js
      -  Passed: 2.2-multiproduct.spec.js
      -  Passed: 2.3-discountProduct.spec.js
      -  Passed: 2.4-discountShipping.spec.js
      -  Passed: 2.5-externalSeller.spec.js
      -  Passed: 2.6-promotional_product.spec.js
      -  Passed: 2.7-transaction.spec.js

#### [try 1/3] Strategy Refund

     [✓] Dashboard URL
      -  https://dashboard.cypress.io/projects/9myhsu/runs/364
     [✓] Specs to run on this try
      -  2.8-fullRefund-transaction.spec.js
      -  2.9-partialRefund-transaction.spec.js
     [✓] Strategy Refund ran successfully
      -  Passed: 1.0-syncCustomUIConf.spec.js
      -  Passed: 1.1-addressVerification.spec.js
      -  Passed: 1.2-postalCode.spec.js
      -  Passed: 1.3-sku.spec.js
      -  Passed: 1.4-taxFallback.spec.js
      -  Passed: 2.1-singleproduct.spec.js
      -  Passed: 2.2-multiproduct.spec.js
      -  Passed: 2.3-discountProduct.spec.js
      -  Passed: 2.4-discountShipping.spec.js
      -  Passed: 2.5-externalSeller.spec.js
      -  Passed: 2.6-promotional_product.spec.js
      -  Passed: 2.7-transaction.spec.js
      -  Passed: 2.8-fullRefund-transaction.spec.js
      -  Passed: 2.9-partialRefund-transaction.spec.js

#### Workspace teardown

     [✓] Dumping environment
      -  ./cy-runner/logs/_apps_installed.txt
      -  ./cy-runner/logs/_apps_dependency.json
      -  /home/runner/.vtex/logs/debug.json -> ./cy-runner/logs/_debug.json
      -  Node versions -> ./cy-runner/logs/_node_versions.json
      -  Env variables -> ./cy-runner/logs/_env.txt
     [!] Moving state files
      -  .orders.json -> ./cy-runner/logs/.orders.json
     [✓] State files moved successfully
     [✓] Wiping data
      -  Disabling parallelism
      -  Running wipe
     [✓] Data wiped successfully
     [✓] Cleaning sensitive data
      -  cypress.env.json
      -  cypress.json
     [✓] Workspace avalara3967668 deleted

#### Deprecation report

     [!] Deprecated configuration on your cy-runner.yml
      -  base.twilio
     [✓] You should remove it as soon as possible

#### Execution report

     [✓] Execution time
      -  initWorkspace................. 3.866 seconds
      -  installApps................... 0 seconds
      -  uninstallApps................. 0 seconds
      -  linkApp....................... 30.037 seconds
      -  strategy...................... 331.058 seconds
      -  teardown...................... 13.237 seconds
      -  total......................... 380.672 seconds

     [✓] Successful specs
      -  1.0-syncCustomUIConf.spec.js
      -  1.1-addressVerification.spec.js
      -  1.2-postalCode.spec.js
      -  1.3-sku.spec.js
      -  1.4-taxFallback.spec.js
      -  2.1-singleproduct.spec.js
      -  2.2-multiproduct.spec.js
      -  2.3-discountProduct.spec.js
      -  2.4-discountShipping.spec.js
      -  2.5-externalSeller.spec.js
      -  2.6-promotional_product.spec.js
      -  2.7-transaction.spec.js
      -  2.8-fullRefund-transaction.spec.js
      -  2.9-partialRefund-transaction.spec.js

#### [Cypress Dashboard](https://dashboard.cypress.io/projects/9myhsu/runs/364)

     [✓] https://dashboard.cypress.io/projects/9myhsu/runs/364

#### Success

     [✓] The test ran successfully, well done!

```

## Teardown

As `cypress runner` was designed to be a multi proposal tool, it's hard to cover all possible cases that need cleaning data, so you can do this task by creating one or more specs to take care of it.

```yaml
[...]
workspace:
  [...]
  wipe:
    enabled: true
    stopOnFail: false
    specs:
      - cypress/integration/cleanMasterData.spec.js
      - cypress/integration/cleanSomethingElse.spec.js
  teardown:
    enabled: true
  [...]
[...]
```

# Templates

## Configuration template

Configuration is required on the root of the repository to be tested with the name `cy-runner.yml`. We are working on a feature to check by this file on main project when working with shared projects (same set of tests to different apps, like **b2b-organizations** and **b2b-organizations-graphql**).

```yaml
# cy-runner.yml
---
base:
  secrets:
    # In dev secrets can can be a local JSON with the pattern:
    # .VTEX_QE.json
    enabled: true
    name: VTEX_QE
  vtex:
    # Account to be used to login
    account: yourAccount
    domain: myvtex.com
    vtexIdUrl: https://vtexid.vtex.com.br/api/vtexid/pub/authenticate/default
  jira:
    # If you want to report issues on Jira
    enabled: false
    account: config-dev
    board: jira-key
    issueType: task
  slack:
    # If you want to report issues on Slack
    # Not functional yet
    enabled: false
    channel: some-channel
  cypress:
    # Opens Cypress instead of running it
    devMode: false
    # Show the GUI window in run mode
    runHeaded: false
    # Get tokens to use inside tests
    getCookies: true
    # Max number of specs parallelization
    maxJobs: 3
    # Show less information on logs
    quiet: true
    # Project run with Cypress Dashboard
    projectId: xxzzyy
    video: false
    videoCompression: 32
    videoUploadOnPasses: false
    screenshotOnRunFailure: true
    trashAssetsBeforeRuns: false
    viewportWidth: 1440
    viewportHeight: 900
    defaultCommandTimeout: 25000
    requestTimeout: 25000
    watchForFileChanges: false
    pageLoadTimeout: 45000
    # Can be chrome, firefox or electron
    browser: chrome
    chromeWebSecurity: false
  # If you need to create empty state
  # to use in your tests, for checking transactions
  # or for doing data wipe on the end
  stateFiles: []

workspace:
  # Set to random to get [prefix][random] (ie b2b1234567)
  # You should use an existent workspace if you disabled
  # base.vtex.deployCly
  name: random
  prefix: b2b
  # The nex configuration avoid apps that need account
  # level resources from running in parallel
  reserveAccount:
    enabled: false
    setup:
      - orderForm
      - vtex.orders-broadcast@0.x
      - vtex.sno@0.x
  # Link the PR app for integration tests
  linkApp:
    enabled: true
  # Apps to be installed
  installApps: []
  # Apps to be removed
  removeApps: []
  # Spec to wipe the data on the end
  wipe:
    enabled: true
    stopOnFail: false
    specs:
      - cypress-shared/integration/workspace/wipe.spec.js
  # Clean workspace and state files on the end
  teardown:
    enabled: true

strategy:
  # Short name is better
  byFromStore:
    enabled: true
    # Send it to Cypress Dashboard or Sorry-Cypress
    sendDashboard: false
    # How many times to try it
    hardTries: 1
    # Stop the test if it fails
    stopOnFail: false
    # Run in parallel, requires Cypress Dashboard or Sorry-Cypress
    parallel: true
    # Specs to run (order not guaranteed)
    specs:
      - cypress/integration/A01*
      - cypress/integration/A02*
  checkInvoice:
    enabled: true
    sendDashboard: true
    hardTries: 1
    stopOnFail: false
    parallel: false
    specs:
      - cypress/integration/A02*
    # Needs to pass to run this strategy
    # Must be declared on earlier strategy
    dependency:
      - cypress/integration/A02*
```

## Secrets template

Secrets to store credentials. You can create a file named `.{base.secrets.name}.json` (remember to never commit this file on your Git repository) or export it as env variable like that `export base.secrets.name=$(cat yourSecretsFile.json)`.

```json
  {
    "vtex": {
      "apiKey": "",
      "apiToken": "",
      "authCookieName": "",
      "robotMail": "",
      "robotPassword": ""
    },
    "jira": {
      "authorization": ""
    },
    "cypress": {
      "dashboardKey": ""
    }
  }
```
At development mode you can use a file called `.[base.secrets.name].json`
1. Remember to ignore this file on your Git
2. You can add whatever secrets you want on it

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of cy-runner/package.json from the cy-runner VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "cy-runner",
  "version": "2.0.0",
  "description": "Tool to orchestrate tests on B2B applications",
  "main": "cy-runner.js",
  "scripts": {
    "lint": "eslint --ext js,jsx,ts,tsx .",
    "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json}\"",
    "test": "echo \"Error: no test specified\" && exit 1",
    "cy-runner": "node cy-runner.js"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.{json,graphql,gql}": [
      "prettier --write"
    ]
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/vtex-apps/cy-runner.git"
  },
  "keywords": [
    "cypress",
    "e2e",
    "automated testing"
  ],
  "author": "charles.santos@vtex.com.br",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/vtex-apps/cy-runner/issues"
  },
  "homepage": "https://github.com/vtex-apps/cy-runner#readme",
  "dependencies": {
    "axios": "^1.3.4",
    "cypress": "^9.6.0",
    "cypress-file-upload": "^5.0.8",
    "js-yaml": "^4.1.0",
    "lodash": "^4.17.21"
  },
  "devDependencies": {
    "@vtex/prettier-config": "^1.0.0",
    "eslint": "^7.4.0",
    "eslint-config-vtex": "^12.7.0",
    "eslint-plugin-cypress": "^2.12.1",
    "husky": "^4.2.5",
    "lint-staged": "^13.1.2",
    "prettier": "^2.4.0",
    "vtex": "3.0.0-beta-ci.5",
    "xlsx": "^0.18.5"
  }
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of cy-runner/manifest.json from the cy-runner VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "cy-runner",
  "vendor": "vtex",
  "version": "2.6.0",
  "builders": {},
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of suiteshare/manifest.json from the suiteshare VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "suite-share",
  "vendor": "vtex",
  "version": "1.0.3",
  "title": "Suiteshare",
  "description": "Suiteshare Integration",
  "builders": {
    "pixel": "0.x",
    "docs": "0.x"
  },
  "dependencies": {},
  "settingsSchema": {
    "title": "Suiteshare",
    "type": "object",
    "properties": {
      "siteId": {
        "title": "Account Id",
        "description": "Suite Share Account Id",
        "type": "string"
      }
    }
  },
  "billingOptions": {
    "type": "free",
    "support": {
      "url": "https://support.vtex.com/hc/requests"
    },
    "availableCountries": [
      "*"
    ]
  },
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of external-promotion-provider-middleware/.versionrc.json from the external-promotion-provider-middleware VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "types": [
    { "type": "feat", "section": "Features" },
    { "type": "fix", "section": "Bug Fixes" },
    { "type": "chore", "section": "Chores" },
    { "type": "docs", "hidden": true },
    { "type": "style", "section": "Styles" },
    { "type": "refactor", "section": "Refacts" },
    { "type": "perf", "hidden": true },
    { "type": "test", "section": "Tests" },
    { "type": "ci", "section": "Continuous Integration" }
  ]
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of external-promotion-provider-middleware/package.json from the external-promotion-provider-middleware VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "promotion-provider-middleware",
  "private": true,
  "license": "UNLICENSED",
  "version": "0.24.0",
  "scripts": {
    "lint": "eslint --ext js,jsx,ts,tsx .",
    "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json}\"",
    "minor": "HUSKY_SKIP_HOOKS=1 standard-version --release-as minor",
    "major": "HUSKY_SKIP_HOOKS=1 standard-version --release-as major",
    "patch": "HUSKY_SKIP_HOOKS=1 standard-version --release-as patch",
    "beta": "HUSKY_SKIP_HOOKS=1 standard-version --release-as minor --prerelease beta",
    "test:node": "cd node && yarn test && cd .."
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged",
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
      "prepare-commit-msg": "exec < /dev/tty && git cz --hook || true"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.{json,graphql,gql}": [
      "prettier --write"
    ]
  },
  "devDependencies": {
    "@commitlint/cli": "^12.1.4",
    "@commitlint/config-conventional": "^12.1.4",
    "@types/node": "^12.12.21",
    "@vtex/prettier-config": "^0.3.6",
    "commitizen": "^4.2.4",
    "cz-conventional-changelog": "3.3.0",
    "eslint": "^7.16.0",
    "eslint-config-vtex": "^12.9.3",
    "husky": "^4.3.6",
    "lint-staged": "^10.5.3",
    "prettier": "^2.2.1",
    "standard-version": "^9.3.0",
    "typescript": "^3.7.5"
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  }
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of external-promotion-provider-middleware/manifest.json from the external-promotion-provider-middleware VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "promotion-provider-middleware",
  "vendor": "vtex",
  "version": "0.24.6",
  "title": "Promotion Provider Middleware",
  "description": "Promotion provider middleware for external integrations",
  "mustUpdateAt": "2018-01-04",
  "categories": [],
  "dependencies": {},
  "builders": {
    "node": "6.x",
    "docs": "0.x"
  },
  "scripts": {},
  "credentialType": "absolute",
  "policies": [
    {
      "name": "outbound-access",
      "attrs": {
        "host": "*",
        "path": "*"
      }
    },
    {
      "name": "AcessaTodosCarrinhos"
    },
    {
      "name": "SaveOrderFormConfiguration"
    },
    {
      "name": "colossus-fire-event"
    },
    {
      "name": "colossus-write-logs"
    }
  ],
  "billingOptions": {
    "termsURL": "https://compliance.vtex.com/gdpr/policies/vtex-privacy-policy",
    "support": {
      "url": "https://support.vtex.com/hc/requests"
    },
    "free": true,
    "type": "free",
    "availableCountries": [
      "*"
    ]
  },
  "settingsSchema": {
    "title": "Promotion Provider Middleware",
    "type": "object",
    "properties": {
      "externalEndpoint": {
        "title": "External Endpoint",
        "type": "string"
      }
    }
  },
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of external-promotion-provider-middleware/commitlint.config.js from the external-promotion-provider-middleware VTEX app.

[Assistant]
Here's the implementation:

```javascript
module.exports = { extends: ['@commitlint/config-conventional'] }

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of payment-connector-aws-cdk-template/cdk.json from the payment-connector-aws-cdk-template VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "app": "npx ts-node --prefer-ts-exts bin/vtex-connector.ts",
  "watch": {
    "include": [
      "**"
    ],
    "exclude": [
      "README.md",
      "cdk*.json",
      "**/*.d.ts",
      "**/*.js",
      "tsconfig.json",
      "package*.json",
      "yarn.lock",
      "node_modules",
      "test"
    ]
  },
  "context": {
    "@aws-cdk/aws-lambda:recognizeLayerVersion": true,
    "@aws-cdk/core:checkSecretUsage": true,
    "@aws-cdk/core:target-partitions": [
      "aws",
      "aws-cn"
    ],
    "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
    "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
    "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
    "@aws-cdk/aws-iam:minimizePolicies": true,
    "@aws-cdk/core:validateSnapshotRemovalPolicy": true,
    "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
    "@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
    "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
    "@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
    "@aws-cdk/core:enablePartitionLiterals": true,
    "@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
    "@aws-cdk/aws-iam:standardizedServicePrincipals": true,
    "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
    "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
    "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
    "@aws-cdk/aws-route53-patters:useCertificate": true,
    "@aws-cdk/customresources:installLatestAwsSdkDefault": false,
    "@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
    "@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
    "@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
    "@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
    "@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
    "@aws-cdk/aws-redshift:columnId": true,
    "@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true
  }
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of payment-connector-aws-cdk-template/README.md from the payment-connector-aws-cdk-template VTEX app.

[Assistant]
Here's the implementation:

```markdown
# Hackathon VTEX Payments - Python Version

## PARTE 1.1 - AWS Access - Console AWS (Via Eventos da AWS)*
1. Receber event hash da AWS
2. Acessar https://dashboard.eventengine.run/login e entrar com o event hash
3. Clicar em Open Console. Bem vindo ao console AWS, aqui você tem acesso a todas as ferramentas e serviços AWS.

'* Essa é uma das forma de obter uma conta AWS com acesso ao console. Mas para seguir os passos seguintes, você poderia usar outras contas AWS.

## PARTE 1.2 - AWS Access - Criar novo usuário AWS para cada membro do time (incluindo para a pessoa que recebeu a conta de evento AWS)
1. Com o Console AWS aberto, na caixa de Search, procure por IAM e entre na página deste serviço
2. Clicar em Users no menu da esquerda.
3. Add user
4. Depois de entrar um username, selecione "Provide user access to the AWS Management Console" e depois "I want to create an IAM user".
5. Defina as regras de password que preferir e clique em next.
6. Depois, selecione `Attach Policies Directly`
7. Selecione `AdministratorAccess` e clique next
8. Revise e finalize a criação do usuário.
9. Depois de finalizado, clique em "Return to users list" e volte à página de listagem de usuarios, clique no usuário recém criado e clique na aba `security credentials``
10. Clique em `create access key` e selecione `Command Line Interface (CLI)`
11. Anote `Access key` e o `Secret access key` em um lugar seguro pois será usado para que este usuário tenha acesso via AWS CLI e o próprio CDK

## PARTE 1.3 - AWS Access - Configurando AWS CLI
1. Instale o npm (14.15.0 or later) e python (Python 3.7 or later incluindo pip e virtualenv)
2. Instale o [aws cli](https://docs.aws.amazon.com/pt_br/cli/latest/userguide/getting-started-install.html)
3. Execute `aws configure` via terminal e entre com os valores de `Access key` e o `Secret access key` que você obteve no passo anterior
4. Rode um comando simples como `aws s3 ls` sem que erros sejam mostrados para testar o CLI

## PARTE 2.1 - Rodando CDK - Instalação
1. Instale o docker desktop e/ou garanta que o Docker Daemon esteja rodando (uma alternativa para o docker desktop em sistemas macOS é o [colima](https://github.com/abiosoft/colima/)). Caso não consiga ter o docker daemon rodando, é possível utilizar Lambda Layers: solicite ajuda da AWS.
2. Rode o comando `npm install -g aws-cdk`

## PARTE 2.2 - Rodando CDK - Executando o modelo
1. Na pasta raiz deste projeto clonado, rode o comando `npm install` para buildar o código
2. Faça um `cdk bootstrap`. Todo o toolkit aws necessário será providenciado na cloud AWS
3. Faça um `cdk deploy`
5. Acesse o console e verifique os serviços que subiram via cloudformation
6. Use `cdk watch` para acionar o deploy automaticamente ao salvar mudanças nos seus arquivos.

## DICAS VALIOSAS
### VIDEO DE TREINAMENTO DE CDK AWS - Assista o vídeo antes de começar o desenvolvimento:
### CDK – Para se familiarizar com o CDK, execute o máximo que der o workshop em https://cdkworkshop.com/
### CLOUD9 – Usar a IDE da AWS pode facilitar sua vida (nao precisaria instalar aws cli e nem aws cdk e nem rodar nada local na sua máquina e todo o deploy de infraestrutura é muito mais rápido)
### CODE WHISPERER – Quer adicionar AI na sua IDE que vai facilitar muito escrever uma stack no CDK? Utilize o code whisperer! Mais informações: https://medium.com/@neonforge/amazon-codewhisperer-how-to-install-ai-code-assistant-for-visual-studio-code-and-use-it-for-free-2580057d48a0
### CONTAS AWS – A partir da conta principal recebida pelo líder do time, criem contas para os demais participantes COM acesso ao console!
### SNIPPETS - Dentro dos Lambdas no CDK, existem snippets de escrita/leitura em DynamoDB e escrita/leitura no SQS para facilitar sua vida
### ARQUITETURA – Lembre-se que a arquitetura proposta é só uma sugestão simplificada. Modificações pensando em segurança, alta disponibilidade e escalabilidade podem dar pontos extras
![image](https://github.com/vtex-apps/payment-connector-aws-cdk-template/assets/32963277/b7c603c9-6f4c-4d43-b700-49b6c1b9aef1)

* Work hard. Have fun. Make history.

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of payment-connector-aws-cdk-template/package.json from the payment-connector-aws-cdk-template VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "vtex-connector",
  "version": "0.1.0",
  "bin": {
    "vtex-connector": "bin/vtex-connector.js"
  },
  "scripts": {
    "build": "tsc",
    "watch": "tsc -w",
    "test": "jest",
    "cdk": "cdk"
  },
  "devDependencies": {
    "@types/jest": "^29.4.0",
    "@types/node": "18.14.6",
    "aws-cdk": "2.77.0",
    "jest": "^29.5.0",
    "ts-jest": "^29.0.5",
    "ts-node": "^10.9.1",
    "typescript": "~4.9.5"
  },
  "dependencies": {
    "@aws-cdk/aws-cloudfront": "1.69.0",
    "@aws-cdk/aws-iam": "1.69.0",
    "@aws-cdk/aws-s3-deployment": "1.69.0",
    "aws-cdk-lib": "2.77.0",
    "constructs": "^10.0.0",
    "source-map-support": "^0.5.21"
  }
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of checkout-fullstory/manifest.json from the checkout-fullstory VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "vendor": "vtex",
  "name": "checkout-fullstory",
  "version": "0.1.1",
  "title": "Checkout IO Fullstory",
  "description": "Checkout IO FullStory",
  "builders": {
    "docs": "0.x",
    "pixel": "0.x"
  },
  "dependencies": {},
  "policies": [],
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema",
  "mustUpdateAt": "2020-10-30"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of product-gifts/package.json from the product-gifts VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "product-gifts",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "lint": "cd ./react && yarn lint",
    "format": "prettier --write \"**/*.{ts,js,json}\"",
    "test": "cd ./react && yarn test",
    "verify": "yarn lint && yarn test"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged",
      "pre-push": "yarn verify"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.json": [
      "prettier --write"
    ]
  },
  "devDependencies": {
    "@vtex/prettier-config": "^0.1.3",
    "eslint": "^6.8.0",
    "eslint-config-vtex": "^12.0.3",
    "eslint-config-vtex-react": "^6.0.3",
    "husky": "^4.2.0",
    "lint-staged": "^10.0.2",
    "prettier": "^1.19.1",
    "typescript": "^3.7.5"
  },
  "version": "0.0.0",
  "intl-equalizer": {
    "referenceLocale": "en",
    "localeDirectory": "messages"
  }
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of product-gifts/manifest.json from the product-gifts VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "vendor": "vtex",
  "name": "product-gifts",
  "version": "0.4.0",
  "title": "Product Gifts",
  "description": "VTEX Product Gifts",
  "builders": {
    "react": "3.x",
    "store": "0.x",
    "docs": "0.x",
    "messages": "1.x"
  },
  "dependencies": {
    "vtex.product-context": "0.x",
    "vtex.search-graphql": "0.x",
    "vtex.native-types": "0.x",
    "vtex.store-image": "0.x",
    "vtex.css-handles": "0.x",
    "vtex.responsive-values": "0.x",
    "vtex.flex-layout": "0.x",
    "vtex.rich-text": "0.x"
  },
  "registries": [
    "smartcheckout"
  ],
  "policies": [],
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of store-theme/manifest.json from the store-theme VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "vendor": "vtex",
  "name": "store-theme",
  "version": "5.2.0",
  "builders": {
    "styles": "2.x",
    "store": "0.x",
    "sitemap": "0.x",
    "docs": "0.x"
  },
  "mustUpdateAt": "2018-09-05",
  "scripts": {
    "postreleasy": "vtex publish --verbose"
  },
  "dependencies": {
    "vtex.store": "2.x",
    "vtex.store-header": "2.x",
    "vtex.product-summary": "2.x",
    "vtex.store-footer": "2.x",
    "vtex.store-components": "3.x",
    "vtex.styleguide": "9.x",
    "vtex.slider": "0.x",
    "vtex.carousel": "2.x",
    "vtex.shelf": "1.x",
    "vtex.menu": "2.x",
    "vtex.minicart": "2.x",
    "vtex.product-details": "1.x",
    "vtex.product-kit": "1.x",
    "vtex.search-result": "3.x",
    "vtex.login": "2.x",
    "vtex.my-account": "1.x",
    "vtex.flex-layout": "0.x",
    "vtex.rich-text": "0.x",
    "vtex.store-drawer": "0.x",
    "vtex.locale-switcher": "0.x",
    "vtex.product-quantity": "1.x",
    "vtex.product-identifier": "0.x",
    "vtex.breadcrumb": "1.x",
    "vtex.sticky-layout": "0.x",
    "vtex.product-customizer": "2.x",
    "vtex.stack-layout": "0.x",
    "vtex.product-specification-badges": "0.x",
    "vtex.product-review-interfaces": "1.x",
    "vtex.telemarketing": "2.x",
    "vtex.order-placed": "2.x",
    "vtex.checkout-summary": "0.x",
    "vtex.product-list": "0.x",
    "vtex.add-to-cart-button": "0.x",
    "vtex.product-bookmark-interfaces": "1.x",
    "vtex.responsive-layout": "0.x",
    "vtex.slider-layout": "0.x",
    "vtex.store-image": "0.x",
    "vtex.store-icons": "0.x",
    "vtex.modal-layout": "0.x",
    "vtex.store-link": "0.x",
    "vtex.store-video": "1.x",
    "vtex.product-gifts": "0.x",
    "vtex.product-price": "1.x",
    "vtex.disclosure-layout": "1.x",
    "vtex.store-form": "0.x",
    "vtex.product-highlights": "2.x",
    "vtex.product-specifications": "1.x",
    "vtex.tab-layout": "0.x",
    "vtex.condition-layout": "2.x",
    "vtex.css-handles": "1.x"
  },
  "peerDependencies": {
    "vtex.reviews-and-ratings": "3.x"
  },
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of cybersource-fingerprint/manifest.json from the cybersource-fingerprint VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "cybersource-fingerprint",
  "vendor": "vtex",
  "version": "1.0.2",
  "title": "CyberSource Fingerprint",
  "description": "",
  "billingOptions": {
    "termsURL": "",
    "support": {
      "url": "https://support.vtex.com/hc/requests"
    },
    "free": true
  },
  "builders": {
    "react": "3.x",
    "store": "0.x",
    "pixel": "0.x",
    "docs": "0.x"
  },
  "dependencies": {
    "vtex.pixel-interfaces": "1.x"
  },
  "settingsSchema": {
    "title": "CyberSource Fingerprint",
    "type": "object",
    "properties": {
      "orgId": {
        "title": "Org ID",
        "description": "To get this value, contact Braspag",
        "type": "string"
      },
      "merchantId": {
        "title": "Merchant ID",
        "description": "To get this value, contact Braspag",
        "type": "string"
      }
    }
  },
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of checkout-identification/package.json from the checkout-identification VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "checkout-identification",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "lint": "eslint --ext js,jsx,ts,tsx .",
    "format": "prettier --write \"**/*.{ts,js,json}\""
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.json": [
      "prettier --write"
    ]
  },
  "devDependencies": {
    "@types/node": "^13.7.7",
    "@vtex/prettier-config": "^0.1.3",
    "eslint": "^6.8.0",
    "eslint-config-vtex": "^12.2.1",
    "eslint-config-vtex-react": "^6.2.1",
    "husky": "^4.2.3",
    "lint-staged": "^10.0.8",
    "prettier": "^1.19.1",
    "react": "^16.13.0",
    "typescript": "^3.8.3"
  },
  "version": "0.0.0"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of checkout-identification/manifest.json from the checkout-identification VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "vendor": "vtex",
  "name": "checkout-identification",
  "version": "0.2.1",
  "title": "Checkout Identification module",
  "description": "",
  "registries": [
    "smartcheckout"
  ],
  "builders": {
    "docs": "0.x",
    "messages": "1.x",
    "react": "3.x",
    "store": "0.x"
  },
  "dependencies": {
    "vtex.checkout-graphql": "0.x",
    "vtex.checkout-resources": "0.x",
    "vtex.order-profile": "0.x",
    "vtex.styleguide": "9.x",
    "vtex.store-components": "3.x"
  },
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of KI-627261/README.md from the KI-627261 VTEX app.

[Assistant]
Here's the implementation:

```markdown
# [KI-627261] Partial scheduled delivery window selection for the same SLA affecting the purchase flow

This script solves the KI https://vtexhelp.zendesk.com/agent/tickets/627261.

You need to add the script to the checkout at the `checkout6-custom.js`.

## Contributors ✨

Thanks goes to these wonderful people:

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tr>
    <td align="center"><a href="https://github.com/germanBonacchi"><img src="https://avatars.githubusercontent.com/u/55905671?v=4" width="100px;" alt=""/><br /><sub><b>Germán Bonacchi</b></sub></a><br /><a href="https://github.com/vtex-apps/KI-627261/commits?author=germanBonacchi" title="Code">💻</a></td>
    <td align="center"><a href="https://github.com/vtexDavidev"><img src="https://avatars.githubusercontent.com/u/89089657?v=4" width="100px;" alt=""/><br /><sub><b>David Leal Peláez</b></sub></a><br /><a href="https://github.com/vtex-apps/KI-627261/commits?author=vtexDavidev" title="Code">💻</a></td>
    </tr>
</table>
```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of KI-627261/KI-627261.js from the KI-627261 VTEX app.

[Assistant]
Here's the implementation:

```javascript
const changeCalendars = () => {
    const calendars = $(".vtex-omnishipping-1-x-dateLink").toArray();

  const sleep = async seconds => new Promise(resolve => {
   setTimeout(resolve, seconds)
  })

   const callSelectedDay = async (index, calendar) =>{
    $(calendar).click();
    await sleep(100)
    $(calendar).parents(".react-datepicker-wrapper").siblings(".react-datepicker-popper").find(".react-datepicker_day:not(.react-datepicker_day--disabled)").first().click()
  }

  const validation = async () => {
    if (calendars.length) {
        $(calendars).each(callSelectedDay)
    }
  };

  $(calendars.shift()).on("click", async()=>{
    await sleep(100);
    $(".react-datepicker__day").on("click", validation);
  });
  };

  $(document).ready(function () {
    let previusSelectedAddress =
      vtexjs.checkout.orderForm.shippingData.selectedAddresses[0];
    $(window).on("orderFormUpdated.vtex", async function (_evt, orderForm) {
      const selectedAddresses = orderForm.shippingData.selectedAddresses[0];
      if (!previusSelectedAddress && selectedAddresses) {
        console.log("coloco direccion por primera vez");
        changeCalendars()
        previusSelectedAddress = selectedAddresses;
      } else if (
        selectedAddresses.addressId !== previusSelectedAddress.addressId ||
        selectedAddresses.addressType !== previusSelectedAddress.addressType ||
        selectedAddresses.city !== previusSelectedAddress.city ||
        selectedAddresses.complement !== previusSelectedAddress.complement ||
        selectedAddresses.country !== previusSelectedAddress.country ||
        JSON.stringify(selectedAddresses.geoCoordinates) !==
          JSON.stringify(previusSelectedAddress.geoCoordinates) ||
        selectedAddresses.isDisposable !== previusSelectedAddress.isDisposable ||
        selectedAddresses.neighborhood !== previusSelectedAddress.neighborhood ||
        selectedAddresses.number !== previusSelectedAddress.number ||
        selectedAddresses.postalCode !== previusSelectedAddress.postalCode ||
        selectedAddresses.receiverName !== previusSelectedAddress.receiverName ||
        selectedAddresses.reference !== previusSelectedAddress.reference ||
        selectedAddresses.state !== previusSelectedAddress.state ||
        selectedAddresses.street !== previusSelectedAddress.street
      ) {
        console.log("cambio la direcciones");
        previusSelectedAddress = selectedAddresses;
        changeCalendars()
      } else {
        console.log("no cambio la direcciones");
      }
    });
  });
```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of doc-prop-component/manifest.json from the doc-prop-component VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "vendor": "vtex",
  "name": "doc-prop-component",
  "version": "0.0.4",
  "title": "Doc Prop Component",
  "description": "Countdown component",
  "defaultLocale": "pt-BR",
  "builders": {
    "graphql": "1.x",
    "messages": "1.x",
    "store": "0.x",
    "react": "3.x",
    "node": "6.x",
    "docs": "0.x"
  },
  "mustUpdateAt": "2019-04-02",
  "scripts": {
    "postreleasy": "vtex publish --verbose"
  },
  "dependencies": {
    "vtex.styleguide": "9.x",
    "vtex.css-handles": "0.x"
  },
  "policies": [
    {
      "name": "outbound-access",
      "attrs": {
        "host": "api.giphy.com",
        "path": "*"
      }
    }
  ],
  "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}

```


[System] You are an expert VTEX IO developer. You specialize in building VTEX Store Framework apps, React components, GraphQL APIs, and Node.js services for e-commerce platforms.

[User] Show me the implementation of shipping-calculator/package.json from the shipping-calculator VTEX app.

[Assistant]
Here's the implementation:

```json
{
  "name": "shipping-calculator",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "lint": "eslint --ext js,jsx,ts,tsx .",
    "format": "prettier --write \"**/*.{ts,js,json}\""
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,tsx,jsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.{json,graphql,gql}": [
      "prettier --write"
    ],
    "*.json": [
      "prettier --write"
    ]
  },
  "devDependencies": {
    "@vtex/prettier-config": "^0.1.3",
    "eslint": "^6.8.0",
    "eslint-config-vtex": "^12.0.3",
    "eslint-config-vtex-react": "^6.0.3",
    "husky": "^4.2.0",
    "lint-staged": "^10.0.2",
    "prettier": "^1.19.1",
    "react": "^16.12.0",
    "typescript": "^3.7.5"
  }
}
```