refactor(core): Improve community node repo code (#3767)

* 📘 Tighten `NodeRequest`

* :blue: Add `AuthAgent` type

*  Add constants

* 📘 Namespace npm types

* 🧪 Set up `createAuthAgent`

* 🧪 Refactor helpers tests

* 🧪 Refactor endpoints tests

*  Refactor CNR helpers

*  Return promises in `packageModel`

*  Refactor endpoints

* ✏️ Restore naming

*  Expose dependency `jest-mock`

* 📦 Update `package-lock.json`

* 📦 Update `package-lock.json`

* 👕 Fix lint

* 🚚 Rename namespace

* 🔥 Remove outdated comment

* 🐛 Fix `Promise` comparison

*  Undo `ResponseHelper` change

* ✏️ Document `ResponseError`

* 🎨 Fix formatting
This commit is contained in:
Iván Ovejero
2022-08-02 10:40:57 +02:00
committed by GitHub
parent ad8d662976
commit 7e578b7f4d
13 changed files with 1042 additions and 867 deletions

View File

@@ -12,6 +12,7 @@ export const RESPONSE_ERROR_MESSAGES = {
PACKAGE_NAME_NOT_PROVIDED: 'Package name is required',
PACKAGE_NAME_NOT_VALID: `Package name is not valid - it must start with "${NODE_PACKAGE_PREFIX}"`,
PACKAGE_NOT_INSTALLED: 'This package is not installed - you must install it first',
PACKAGE_FAILED_TO_INSTALL: 'Package could not be installed - check logs for details',
PACKAGE_NOT_FOUND: 'Package not found in npm',
PACKAGE_VERSION_NOT_FOUND: 'The specified package version was not found',
PACKAGE_DOES_NOT_CONTAIN_NODES: 'The specified package does not contain any nodes',
@@ -29,3 +30,5 @@ export const NPM_COMMAND_TOKENS = {
};
export const NPM_PACKAGE_STATUS_GOOD = 'OK';
export const UNKNOWN_FAILURE_REASON = 'Unknown failure reason';