This PR abstracts the node-fetch implementation into a little helper on utils.js, saving hundreds of lines of code. It manages the spinner, request headers and some standard error responses in a single function, returning a promise (and so removing the await) consumed by almost every command.
Additional commit adds cluster/nodes sanitization on id input with Inquirer.js validator function.
This PR abstracts the
node-fetch
implementation into a little helper onutils.js
, saving hundreds of lines of code. It manages the spinner, request headers and some standard error responses in a single function, returning a promise (and so removing theawait
) consumed by almost every command.Additional commit adds cluster/nodes sanitization on
id
input withInquirer.js
validator function.Process checklist
Related issue(s)
Closes #197 Closes #199 Requires https://github.com/bloqpriv/cloud-accounts/pull/214
Metrics
Actual effort: 4d