Commit Graph

85 Commits

Author SHA1 Message Date
Sergio Díaz 4bf7a60e9c
Added beau-std as an auto-loaded plugin. (#18)
This means that beau-std will automatically be loaded if available in
the same space as Beau. beau-std is a set of commonly used plugins,
these map directly to nodejs features that are commonly needed within
Beau.
2018-05-04 13:08:55 -06:00
Sergio Díaz 59f85fac8c
Reindenting. (#17)
I normally prefer tabs for everything, it's nice to have the ability to
set to whatever your preferred width is. Since this project uses a lot
of yaml stuff I've had to indent those tests with spaces, for
consistency's sake I've decided to use spaces everywhere.
2018-05-04 11:47:28 -06:00
David Diaz 64de56d51c Added a .prettierrc config file. 2018-05-04 11:22:02 -06:00
David Diaz 3212403962 Changed the description on the package.json 2018-05-04 05:08:58 +00: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
Sergio Díaz 91d35459aa
Merge pull request #15 from Seich/next-dynamic-values
Allow dynamic values to replace values internally.
2018-04-30 14:42:51 -06:00
David Diaz 185333cb20 Copy objects instead of properties on modifiers. 2018-04-30 14:21:20 -06:00
David Diaz dd2842c097 Allow dynamic values to replace values internally.
If the only thing passed as a value is a dynamic value whatever it
returns will become the new value internally. This means that they are
no longer required to be strings. This also allows plugins to use native
objects and types internally to do more advance things.
2018-04-30 11:39:44 -06:00
Sergio Díaz 92142c148b
Merge pull request #12 from Seich/next-refactor-config-loading
Refactored the Request's constructor.
2018-04-26 18:38:37 -06:00
David Diaz 358da930e8 Refactored the Request's constructor.
I didn't like how verbose it was, this is somewhat better.
2018-04-26 18:35:33 -06:00
Sergio Díaz 17971a3cca
Merge pull request #11 from Seich/next-cookies
Added basic cookies support.
2018-04-26 17:53:55 -06:00
David Diaz d3b78bc27d Added basic cookies support.
You can now let Beau know you expect cookies to be passed around by
setting COOKIEJAR to true. I'd eventually like to add support for file
storage or something similar.
2018-04-26 17:50:09 -06:00
Sergio Díaz 979f93ddbb
Merge pull request #10 from Seich/next-forms
Added support for forms.
2018-04-26 15:00:22 -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 3df90600ac Updated dependencies. 2018-04-26 10:56:42 -06:00
Sergio Díaz 6c552cb7a2
Merge pull request #9 from Seich/next-plugin-improvements
Modifiers can now edit request settings.
2018-04-20 18:57:38 -06:00
David Diaz d15564a9e3 Modifiers can now edit request settings.
This gives a lot more flexibility when it comes to what a modifier can
do. They can now use any valid request option to change how the response
behaves.
2018-04-20 18:29:19 -06:00
Sergio Díaz d154f73232
Merge pull request #8 from Seich/next
Allow Escaping the $
2018-04-20 17:57:26 -06:00
David Diaz f13cbda84a Allow the escaping of variables.
This results in two important changes:

- Made changes so that we actually use the replacement regex groups.
This was supposed to happen from the start but I guess I didn't notice.
By fixing this the code for finding dependencies and the cache#parse is
now a bit more reliable.

- This also changes how we store variables in the cache (which I've been
meaning to do for a while.) removing the dollar sign that usually
preceeded all cached requests in Beau. It's all more sensible now.

There's more refactoring left to do.
2018-04-13 10:12:03 -06:00
David Diaz e9c07cbbf9 0.8.0 2018-04-08 13:56:11 -06:00
Sergio Díaz 490bc85174
Merge pull request #7 from Seich/next-plugins
Refactored Beau's Plugin System
2018-04-08 13:41:34 -06:00
David Diaz 1fb45da5de Refactored Beau's Plugin System
It now uses a plugin registry. Plugins are loaded when the configuration
file is first parsed. When a request is made it is passed over to the
available modifiers before and after it's execution and applies
whichever changes are made. It now passes a copy instead of a reference
to provide a nicer interface.

Dynamic values have been added as a plugin type. These plugins are
javascript functions that can be called from within the beau file and
whose results are used as a replacement.

These are added along with variables to the runtime execution flow. The
current order for their execution is:

Request composition -> Dynamic Values -> Pre-Request Modifiers ->
Post-Request Modifiers.
2018-04-08 13:33:43 -06:00
David Diaz 293c3883e9 0.7.3 2018-03-01 16:03:45 -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 070ffc3106 0.7.2 2018-03-01 11:44:15 -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 228d2de7f3 0.7.1 2018-03-01 11:02:51 -06:00
David Diaz 124d55d1ae Fixed issue where an empty payload was changed to an empty object. 2018-03-01 10:58:30 -06:00
David Diaz e140778393 0.7.0 2018-01-21 15:40:20 -06:00
Sergio Díaz 59acbd59b5
Merge pull request #6 from Seich/hosts
Added support for multiple hosts.
2018-01-21 15:37:56 -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 5f0f1821e4 0.6.1 2018-01-17 01:58:13 -06:00
David Diaz 8926f4d2da Updated package.json 2018-01-17 01:57:52 -06:00
David Diaz 2dbeb0d230 0.6.0 2018-01-11 17:30:22 -06:00
David Diaz 8ab1636e13 Updated README 2018-01-11 01:01:57 -06:00
Sergio Díaz d598e5e322
Merge pull request #5 from Seich/environment-variables
This adds a missing test for when a request is already in a cache.
2018-01-11 00:14:22 -06:00
David Diaz 29b93e6cba This adds a missing test for when a request is already in a cache. 2018-01-11 00:08:38 -06:00
Sergio Díaz 28ddf88a41
Merge pull request #4 from Seich/environment-variables
This adds environment variables.
2018-01-10 16:52:43 -06:00
David Diaz 90752c47b1 This adds environment variables.
Allows you to set variables that you can then use throughout your
configuration file.
2018-01-10 16:39:38 -06:00
Sergio Díaz 95744bf823
Merge pull request #3 from Seich/moving-to-src
Moved all source files into a src folder. It was getting crowded.
2018-01-10 15:20:33 -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
Sergio Díaz b3cbe5c544
Merge pull request #2 from Seich/init
Added an init command to the CLI.
2017-12-27 21:55:42 -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
Sergio Díaz dc7d6f977d
Merge pull request #1 from Seich/defaults
Added Defaults.
2017-12-27 16:47:14 -06:00
David Diaz 40abf85a78 Added a new top-level setting: defaults.
Defaults allow you to set default settings for all requests. You can
pass any configuration value and it'll be merged with any values the
request already has allowing you to write even less repetitive code.
2017-12-27 16:43:47 -06:00
David Diaz 78a12e99f2 We now allow slashes in aliases. 2017-12-26 23:50:05 -06:00
David Diaz 24a0fdf788 0.5.0 2017-12-23 01:59:55 -06:00
David Diaz 458f0f65ce Updated ReadMe 2017-12-23 01:57:13 -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