# @vtex/admin-instore-utils

> Export utils callbacks so admin can call and inStore can do a custom logic based on it.

Latest version **0.3.0** (published 2023-07-31) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install @vtex/admin-instore-utils
pnpm add @vtex/admin-instore-utils
yarn add @vtex/admin-instore-utils
bun add @vtex/admin-instore-utils
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2023-07-31 |
| First published | 2022-01-21 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 13.9 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | georgebrindeiro, filipewl, emersonvtex, rodrigo.albuquerque, viniciuslouzadavtex, carolinerpessoa, npedrosovtex, myllena.alves, tercete, mendescamara, mauro.takeda, lpolon, gianvittorio, eduardoformiga, ana.hernandes, viniciusssilva, vcnovaes, dpzvtex, vtexlab-user, wender, natamelo, mairatma, mayzabel, augusto.lazaro, tergol, rafarubim, gustavorosolem, arthurepc, jeymisson, victorhmp, lurian, ericreis, arturpimentel, anitavincent, brunojdo, lucasecdb, matheusps, emersonlaurentino, viniagostini, lucasaarcoverde, lariciamota, wdsrocha, icazevedo, fabits, mateuspontes, gmantiqueira, vitorlgomes, rodolfoams, policarpo, marcelovicentegc, maianabt, jeffersontuc, hiagolcm, william.silva |

## Links

- npm: https://www.npmjs.com/package/@vtex/admin-instore-utils
- npm.io page: https://npm.io/package/@vtex/admin-instore-utils

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.25.0
- [splunk-events](https://npm.io/package/splunk-events.md) ^1.7.0

## Recent versions

- 0.3.0 (latest) — 2023-07-31
- 0.2.1-beta.0 (beta) — 2022-01-28
- 0.2.10 — 2023-01-24
- 0.2.6 — 2022-02-03
- 0.2.2 — 2022-02-01
- 0.1.7 — 2022-01-24
- 0.1.6 — 2022-01-24
- 0.1.5 — 2022-01-24
- 0.0.12 — 2022-01-21
- 0.0.11 — 2022-01-21
- 0.0.10 — 2022-01-21
- 0.0.9 — 2022-01-21

## README

# Admin inStore Utils

Export utils callbacks so admin can call and inStore can do a custom logic based on it.

## How to include a new account on the Admin Allow List

### Step 1 - Go to the file containing the allow list

Go to the file that contains the allow list of accounts on this Github:
[react/validator/inStoreConstants.ts](react/validator/inStoreConstants.ts)

### Step 2 - Open a Pull Request with your change

Click on the edit this file:

![](docs/edit-this-file.png)

Add your new account in the end of the variable ALLOW_LIST in the format `'accountName',` just like in this example that I added `'imaginarium',`:

![](docs/open-pr.png)

Just like the image change the default option below `Commit changes` to be: ` Create a new branch for this commit and start a pull request.`.

And name your Pull Request's branch to be: `feature/add-accountName` just like I did above with the name `feature/add-imaginarium`.

Finally click on the "Propose changes" button and after on the "Create pull request" button.

### Step 3 - Merge your PR

Now you are on your PR (Pull Request) page.

Select the option `patch` on the VTEX IO Bot just like below:

![](docs/merge-pr.png)

And click the "Merge pull request" button

### Step 4 - Install on the account the new app version

After merging the PR it generated a version, let's say for example: `vtex.admin-instore-utils@0.0.5`

To install on the workpace master of your accountName go to (replace `accountName` for the real account you just added to the allow list and `0.0.5` with the real version generated from your PR):
`https://accountName.myvtex.com/admin/apps/vtex.admin-instore-utils@0.0.5/install/`

Click on the install button and confirm on the popup.

After this the version is installed and you can test accessing `https://accountName.myvtex.com/admin` with a sales associate email.

### Step 5 - For this rule to be on the backend also

Finally to block on the backend, you need to:

- Clone this repository if not already
- Run the command `yarn release && sh ./scripts/npm-publish.sh` on the root of this project so it can generate a version on `npm`
- Then you need to open an PR to https://github.com/vtex/admin-iframe updating the dependency to the new version generated by the previous command. To update the dependency clone this admin-iframe project, enter the `node` folder (`cd node`) and run: `yarn add @vtex/admin-instore-utils`

An example of a PR (needs to include CHANGELOG, change to node/package.json with the new version and change to node/yarn.lock after you ran the previously `yarn add` command): https://github.com/vtex/admin-iframe/pull/31/files

![](docs/pr-admin-iframe-example.png)

### If you want to use the IO CLI to first install on a workspace

You can use the VTEX IO CLI ([installation instructions here](https://developers.vtex.com/vtex-developer-docs/docs/vtex-io-documentation-vtex-io-cli-installation-and-command-reference)) to install the new version with the commands (replace `accountName` for the real account you just added to the allow list and `workspace` for the workspace name you normally use like your personal last name):

```bash
vtex login accountName
vtex use workspace
vtex workspace reset -p
vtex install vtex.admin-instore-utils
vtex install vtex.admin-iframe
```

Than test on `https://workspace--accountName.myvtex.com/admin` if the blocking is happening before moving on.

If it worked on a workspace, it will work on `https://accountName.myvtex.com/admin` as well.

Finally to promote this version to this final url execute:

```bash
vtex workspace promote
```

---
_Source: https://npm.io/package/@vtex/admin-instore-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
