Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returns body.results or body as a response. Added debug support. #112

Merged
merged 6 commits into from
Apr 25, 2016
Merged

Returns body.results or body as a response. Added debug support. #112

merged 6 commits into from
Apr 25, 2016

Conversation

aydrian
Copy link
Contributor

@aydrian aydrian commented Mar 18, 2016

  • Set options.json = true for all requests.
  • Using JSON parsed body from request.
  • Returning body.results || body as response
  • Added a options.debug flag which will include the request response object as a debug property on response. (aids in testing)

Closes #81

@aydrian aydrian added this to the 2.0.0 Release milestone Mar 18, 2016
@beardyman beardyman self-assigned this Mar 18, 2016
* `data.res` - full response from request client
* `data.body` - payload from response
* `data` - results from API call
* `data.debug` - full response from request client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add "when options.debug is true"

@beardyman
Copy link
Contributor

I think this is pretty good, I ran through some tests and the interface looks a lot better.

@aydrian aydrian merged commit 876b6bf into SparkPost:wip-2.0.0 Apr 25, 2016
@aydrian aydrian deleted the issue-81 branch April 25, 2016 17:50
aydrian added a commit that referenced this pull request Oct 27, 2016
* Added json flag to base request and tests to check for JSON response

* Fixed a couple misspellings

* Returns body.results or body as a response. Added debug support. (#112)

* Now returning body.results or body as a response. Added debug support.

* Updated documents and examples

* Updating newly merged code

* Updated debug flag doc in README.md

* clean up from 1.x merge

* Implement promise support (#154)

* added promise support to base object

* updated sendingDomains for promise support

* updated inboundDomains for promise support

* updated messageEvents for promise support

* updated recipientLists for promise support

* updated relayWebhooks for promise support

* updated subaccounts for promise support

* updated suppressionList for promise support

* updated templates for promise support

* updated transmissions for promise support

* updated webhooks for promise support

* Replaced bluebird with native promise support for PR #154

* removed dependency for bluebird

* replaced bluebird on spec tests

* Switched JSHint for ESLint with SparkPost config (#159)

* Switched JSHint for ESLint with SparkPost config

* modified lint npm script to remove node_modules path

* Removed support for nodejs versions .10 & .12 (#157)

* Removed testing of nodejs versions .10 & .12, added lastest stable, 5, & 6

* latest is 6 so added 4

* reverting the npm version

* Switch to using npm scripts instead of grunt (#160)

* Remove coveralls task from grunt

* removed testing and coverage from grunt

* Removed unneed npm deps

* Updated docs to remove grunt references

* Added npm version scripts & removed Grunt

* Removed SendGrid Compatibility (#162)

* Set options.json=true for GET requests (#163)

* Setting options.json=true for GET requests

* Fixed tests

* Refactored transmissions library (#158)

* Refactored transmissions library & updated tests for promises

* merge flub, extra comma in package.json

* Updated transmission docs and examples

* Documentation updates

* Updated webhooks lib and tests

* Updated webhooks doc and examples

* updated tests for payloads and cloneDeep

* validates required parameters and jsdocs to webhooks wrapper

* update docs for webhooks

* updated docs, tests, and examples

* eslint fixes
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.

None yet

2 participants