Commit Graph

35 Commits

Author SHA1 Message Date
David Díaz 9decb4978b
Updating dependencies that require manual input. (#158)
* Updated is-plain-object.

* Updated jest.

* Moving from circleci to github actions.

* Switching jsome to color-json to reduce dependencies (somehow).

* Updating snaps.
2020-11-20 17:39:56 -06:00
David Díaz 56894bd459
Update deps (#157)
* Updated is-plain-object.

* Updated jest.

* Moving from circleci to github actions.
2020-11-20 17:18:24 -06:00
David Diaz 3b5e848530 Added better ajv errors.
It prints json for now while I figure a nicer way of displaying errors
in yaml.
2020-11-19 22:06:22 -06:00
David Diaz a39f3b5977 Config files are now validated against the json schema. 2020-11-19 21:44:17 -06:00
David Diaz 5029a09b41 Added a base class to cli commands. 2020-11-19 21:17:36 -06:00
David Diaz df41d4fa0b Removed the validate command.
We'll be replacing it with jsonschema soon.
2020-11-18 18:37:00 -06:00
Sergio Díaz 52e88a3703
This allows extra documents in a yaml config file to be embeded as hosts.(#40)
This allows extra documents in a yaml config file to be embeded as hosts.
2018-07-31 23:23:32 -06:00
Sergio Díaz 14704c09d1
Added a version mismatch warning. (#37)
* I need to stop rewriting builtin methods with reduce.

* Removed redundant fields from the config class.

* Added a warning when module version and beau.yml version differ.
2018-06-14 23:12:16 -06:00
Sergio Díaz 450d53e9f9
I need to stop rewriting builtin methods with reduce. (#36) 2018-06-14 19:27:03 -06:00
Sergio Díaz cc7245b501
Cleaning up tests. (#34) 2018-06-02 23:47:03 -06:00
Sergio Díaz c8ff4945d6
Updated tests. (#30)
With the introduction of data-driven tests in Jest 23 CLI tests could be made significantly smaller and easier to keep updated.
2018-05-29 15:23:58 -06:00
Sergio Díaz 26b33fbf00
Added tests to all CLI commands. (#28)
* Moved the spinner initialization to the base class.

* Got rid of the base class, it complicated testing.

Now it lives on as a utils file. Should make it easier to test the CLI.

* Added a spec file for the ListCommand.

* Added tests for all CLI commands.

* Update some old tests.

Added missing cases and tests.

Most of these are kind useless but I hope I won't have to touch them
again.
2018-05-22 21:42:52 -06:00
Sergio Díaz dbc7addb39
Added flags for quiet and as-json output. (#26)
--as-json outputs the response as json, this allows you to use tools
like jq on the output which is nice.

--quiet makes it so no output is printed. I added this in case you are
looping Beau and don't want to see the output of every single request.
Example: `seq 10 | xargs -I{} beau request hi --quiet`.
2018-05-22 12:08:32 -06:00
Sergio Díaz aba33e7fc3
Fix: Env variables (#23)
I am making a couple of small changes to how external environment
variables are used. From now own everything comming from the outside,
namely the .env file and the params flag are assigned to the '_'
variable within the internal environment. This is mostly to namespace
things and make it clear where they are coming from.
2018-05-17 09:58:44 -06:00
Sergio Díaz 0677497074
Making improvements to the plugins system. (#22)
This is mostly some clean up. Now plugins are checked for existence
before being required. The regex for dynamic values was improved a
little in an attemp to make it more reliable. Plugins are only required
once now.

The CLI's CWD is set to that of the config file. This makes relative
paths mentioned in the file more reliable.
2018-05-16 18:24:52 -06:00
Sergio Díaz 248f4a9223
Added params as a flag to request. (#20)
This allows the use to inject arbitrary values to Beau's environment.
2018-05-06 18:26:19 -06:00
Sergio Díaz 56d536a509
Re-indented some files I was missing. (#19)
I think that's it.
2018-05-04 22:00:54 -06:00
Sergio Díaz 90761acaa4
Added a schema validator. (#13)
* Added a schema validator.

This allows you to check if the given beau config is valid. Will be used
to improve the CLI and remove schema validation-type errors from the
actual code.

* Added a validate command to the CLI.

This command is a way to test the config file. Eventually it'll probably
be removed and the schema validation will run on every other command. I
have to determine how useful this is and how performance might be
affected.
2018-05-01 22:20:14 -06:00
Sergio Díaz 4fba235bad
Migrating Beau's CLI from commander to OCLIF. (#14)
* Migrating Beau's CLI from commander to OCLIF.

* Cleaning up flags.
2018-04-30 20:27:51 -06:00
David Diaz 9d10db3243 Added support for forms.
You can now pass a form key to the request and it'll set the header and
payload automatically.
2018-04-26 14:52:06 -06:00
David Diaz 7e25f9fd29 Added update-notifier.
I like being notified of updates so I figured everyone else does. /s
2018-03-01 16:02:54 -06:00
David Diaz 2f33442072 Added support for dotenv.
If a .env file is present it's values will be added to beau's
environment variables.
2018-03-01 11:42:41 -06:00
David Diaz fe401c1391 Added support for multiple hosts.
This introduces a top level key: `hosts`. It's an array where you can
configure multiple hosts with their own requests, they share defaults
and environment with the global scope.

This allows you to  have multiple paths being the same with different
endpoints and settings.
2018-01-19 18:10:00 -06:00
David Diaz 44205d488c Moved all source files into a src folder. It was getting crowded. 2018-01-10 15:13:47 -06:00
David Diaz 933fb1b077 Added an init command to the CLI.
Init will create a config file with the endpoint filled to whatever is
set. It also has helpful comments to guide you through creating a config
file.
2017-12-27 21:28:54 -06:00
David Diaz 930a957bf3 Cleaning up the code.
Mostly trying to get test coverage up by refactoring and cleaning
methods.
2017-12-23 00:34:36 -06:00
David Diaz 35983addf7 Refactored the cli.
Started making use of commander's commands and actions. This changes how
beau is invoked but I feel like it's a lot easier to work with now.
2017-12-07 21:55:36 -06:00
David Diaz 32b9f0f523 Cleaning the CLI tool. Small refactorings all around.
If a string is passed to a request configuration its now considered
that request's alias.
2017-12-03 23:56:09 -06:00
David Diaz e8f3d0eda2 Added support for a documentation field in the beau.yaml file.
This field will be use to prettify the output of certain tools and to
document apis.
2017-10-21 14:39:00 -06:00
David Diaz baa4a4eafc Added format-less versions of list and request to the command line. This
makes it easier to add direct support for beau on external applications.
2017-10-21 00:54:38 -06:00
Sergio Díaz e70fb135b6 Updated readme. Made it so the CLI shows the correct version. 2017-04-05 23:03:53 -06:00
Sergio Díaz fde0fc6543 Moved all of the uppercase stuff into the code and out of the config.
This makes it easier to write the config file and makes everything easier to reason about on the code.
2017-03-07 18:01:11 -06:00
Sergio Díaz 5a1f42827f Add help if no command was issued. 2017-03-07 16:48:56 -06:00
Sergio Díaz b033031a43 Doing some basic refactoring to make the code nicer.
Removed all methods we weren't user anymore.
2017-02-13 18:05:47 -06:00
Sergio Díaz 40f17dccaf Initial Commit. 2017-02-10 21:11:13 -06:00