Skip to content

Conversation

@fiveisprime
Copy link
Member

Hi,

I reworked your module a little - I hope I'm not stepping on any toes here. :)

Here's what I did and why:

  • Reworked the APIto use callbacks
    I did this to make the module work like a standard node modules rather than like
    a client side javascript library. The previous implementation was a little
    awkward.
  • Simplified the validation.
    There was a LOT of validation that was incredibly specific where it really didn't
    need to be. I replaced a lot of this validation with asserts to simplify the
    code around these things.
  • Improved the request functionality.
    Requests were incorrectly leaving Content-Type blank which caused errors to be
    returned as HTML rather than JSON. I added the header so that errors are parsed
    and returned to the user directly rather than making assumptions about the
    errors.
  • Added tests!
    I added some tap tests to the library prior to reworking the module and found
    that certain bits of functionality weren't actually working. Within the reply,
    dialogs were not working as intended and would throw errors. I've omitted those
    pieces until I can figure out a solution. I also added a lint step to the test
    that follows the conventions you've defined in contributing.md.

Aside from the rework, the module should be published to npm at some point.

Updated the API to be more node friendly; restructured to simplify
validations; updated request handling to cover an edge case where data
could become corrupt; requests now correctly speficy JSON content-type;
and added tests.
Updated the package name to reflect what's deployed to npm.
Updated nock and standard to the latest versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant