From 47da862d52830ff5b57dcbd3b3fa02ae36e63bb6 Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Fri, 5 Oct 2018 23:16:56 +0530 Subject: [PATCH 1/7] Update CHANGELOG.md Improved the language and scanned the file using Grammar.ly --- CHANGELOG.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8ed71b..f0a493a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,32 +12,32 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [2.3.0] - 2016-10-12 ### Added - Pull #6, Solves #5 -- Invoke the API callback with a mocked response upon Error +- Invoke the API callback with a mocked response on Error - Thanks [Dan Foley](https://github.com/cantremember)! ## [2.2.2] - 2016-09-27 ### Fixed -- Fix GitHub URLs in package.json #4: https://github.com/sendgrid/sendgrid-nodejs/pull/4 +- Fix GitHub URLs in `package.json` #4: https://github.com/sendgrid/sendgrid-nodejs/pull/4 - Thanks [Guilherme Souza](https://github.com/sitegui)! ## [2.2.1] - 2016-06-15 ### Fixed -- Sending email with accents: https://github.com/sendgrid/sendgrid-nodejs/issues/239 +- Send email with accents: https://github.com/sendgrid/sendgrid-nodejs/issues/239 - Thanks [eaparango](https://github.com/eaparango)! ## [2.2.0] - 2016-06-10 ### Added -- Automatically add Content-Type: application/json when there is a request body +- Automatically add **Header** in HTTP request whenever there is a request body `Content-Type: application/json` ## [2.1.0] - 2016-06-08 ### Added - Cleaner request object initialization -- Ability to use http for testing +- Ability to use HTTP for testing ## [2.0.0] - 2016-06-06 ### Changed -- Made the Request and Response variables non-redundant. e.g. request.requestBody becomes request.body +- Request and Response variables are non-redundant. Example: `request.requestBody` changed to `request.body` ## [1.0.1] - 2016-04-08 ### Added -- We are live! \ No newline at end of file +- We are live! From 29672e954a02898353fb26ab331a00a5fee42ef3 Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Fri, 5 Oct 2018 23:18:23 +0530 Subject: [PATCH 2/7] Update CODE_OF_CONDUCT.md Improved the language and scanned the file using Grammar.ly --- CODE_OF_CONDUCT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index cf64d8c..c731667 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -9,7 +9,7 @@ Members of the community are open to collaboration, whether it's on pull request Members of the community are considerate of their peers, which include other contributors and users of SendGrid. We're thoughtful when addressing the efforts of others, keeping in mind that often the labor was completed with the intent of the good of the community. We're attentive in our communications, whether in person or online, and we're tactful when approaching differing views. ### Be Respectful -Members of the community are respectful. We're respectful of others, their positions, their skills, their commitments and their efforts. We're respectful of the volunteer efforts that permeate the SendGrid community. We're respectful of the processes outlined in the community, and we work within them. When we disagree, we are courteous in raising our issues. Overall, we're good to each other. We contribute to this community not because we have to, but because we want to. If we remember that, these guidelines will come naturally. +Members of the community are respectful. We're respectful of others, their positions, their skills, their commitments, and their efforts. We're respectful of the volunteer efforts that permeate the SendGrid community. We're respectful of the processes outlined in the community, and we work within them. When we disagree, we are courteous in raising our issues. Overall, we're good with each other. We contribute to this community not because we have to, but because we want to. If we remember that, these guidelines will come naturally. ## Additional Guidance From 0756230234cd07aa563a0245c23cff849ca72354 Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Fri, 5 Oct 2018 23:19:24 +0530 Subject: [PATCH 3/7] Update CONTRIBUTING.md Improved the language and scanned the file using Grammar.ly --- CONTRIBUTING.md | 57 ++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0a7ffa9..a028e77 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -Hello! Thank you for choosing to help contribute to one of the SendGrid open source libraries. There are many ways you can contribute and help is always welcome. We simply ask that you follow the following contribution policies. +Hello! Thank you for choosing to help contribute to one of the **SendGrid** open source libraries. There are many ways you can contribute and help is always welcome. We simply ask that you follow the following contribution policies. - [CLAs and CCLAs](#clas-and-cclas) - [Roadmap & Milestones](#roadmap-and-milestones) @@ -11,14 +11,14 @@ Hello! Thank you for choosing to help contribute to one of the SendGrid open sou - [Creating a Pull Request](#creating-a-pull-request) -We use [Milestones](https://github.com/sendgrid/nodejs-http-client/milestones) to help define current roadmaps, please feel free to grab an issue from the current milestone. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, community review, comments, suggestions and additional PRs are welcomed and encouraged. +We use [Milestones](https://github.com/sendgrid/nodejs-http-client/milestones) to help define current roadmaps, please feel free to grab an issue from the current milestone. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, the community reviews, comments and suggests for better changes. Additional PRs are welcomed and encouraged. ## CLAs and CCLAs -Before you get started, SendGrid requires that a SendGrid Contributor License Agreement (CLA) be filled out by every contributor to a SendGrid open source project. +Before you get started, SendGrid requires that a **SendGrid Contributor License Agreement (CLA)** be filled out by every contributor to a SendGrid open source project. -Our goal with the CLA is to clarify the rights of our contributors and reduce other risks arising from inappropriate contributions. The CLA also clarifies the rights SendGrid holds in each contribution and helps to avoid misunderstandings over what rights each contributor is required to grant to SendGrid when making a contribution. In this way the CLA encourages broad participation by our open source community and helps us build strong open source projects, free from any individual contributor withholding or revoking rights to any contribution. +Our goal with the CLA is to clarify the rights of our contributors and reduce other risks arising from inappropriate contributions. The CLA also clarifies the rights that SendGrid holds in each contribution. The CLA also helps to disambiguate the rights that each contributor can be granted by SendGrid whilst making a contribution. In this way the CLA encourages broad participation by our open source community and helps us build strong open source projects, free from any individual contributor withholding or revoking rights to any contribution. SendGrid does not merge a pull request made against a SendGrid open source project until that pull request is associated with a signed CLA. Copies of the CLA are available [here](https://gist.github.com/SendGridDX/98b42c0a5d500058357b80278fde3be8#file-sendgrid_cla). @@ -39,24 +39,24 @@ The GitHub issue tracker is the preferred channel for library feature requests, ## Submit a Bug Report -Note: DO NOT include your credentials in ANY code examples, descriptions, or media you make public. +>**Note**: DO NOT include your credentials in ANY code examples, descriptions, or media that you make public. -A software bug is a demonstrable issue in the code base. In order for us to diagnose the issue and respond as quickly as possible, please add as much detail as possible into your bug report. +A software bug is a demonstrable issue in the code base. Please add as much detail as possible in your bug report so that we can diagnose the issue and respond as quickly as possible. Before you decide to create a new issue, please try the following: -1. Check the Github issues tab if the identified issue has already been reported, if so, please add a +1 to the existing post. -2. Update to the latest version of this code and check if issue has already been fixed -3. Copy and fill in the Bug Report Template we have provided below +1. Check the Github issues tab if the identified issue has already been reported, in that case, please add a +1 to the existing post. +2. Update to the latest version of this code and check if issue has already been fixed. +3. Copy and fill in the Bug Report Template we have provided below. ### Please use our Bug Report Template -In order to make the process easier, we've included a [sample bug report template](https://github.com/sendgrid/nodejs-http-client/.github/ISSUE_TEMPLATE) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting. +In order to make the process easier, we've included a *[sample bug report template](https://github.com/sendgrid/nodejs-http-client/.github/ISSUE_TEMPLATE)* (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting. ## Improvements to the Codebase -We welcome direct contributions to the nodejs-http-client code base. Thank you! +We welcome direct contributions to the **nodejs-http-client** code base. Thank you! ### Development Environment ### @@ -64,8 +64,8 @@ We welcome direct contributions to the nodejs-http-client code base. Thank you! ##### Prerequisites ##### -- Node.js version 0.10, 0.12 or 4 -- Please see [package.json](https://github.com/sendgrid/nodejs-http-client/blob/master/package.json) +- Node.JS version 0.10, 0.12 or 4 +- Please see [`package.json`](https://github.com/sendgrid/nodejs-http-client/blob/master/package.json) ##### Initial setup: ##### @@ -99,26 +99,27 @@ node ./examples/example.js **/examples** -Working examples that demonstrate usage. +Working examples that demonstrate the usage. **client.js** There is an object to hold both the request and response to the API server. -The main function that does the heavy lifting (and external entry point) is `API`. +The main function that does the heavy lifting (and external entry point) is **API**. ## Testing -All PRs require passing tests before the PR will be reviewed. +All PRs require passing tests before the PR is reviewed. All test files are in [`test/test.js`](https://github.com/sendgrid/nodejs-http-client/blob/master/test/test.js). For the purposes of contributing to this repo, please update the [`test.js`](https://github.com/sendgrid/nodejs-http-client/blob/master/test/test.js) file with unit tests as you modify the code. Run the test: - -`mocha` +```bash +mocha +``` ## Style Guidelines & Naming Conventions @@ -129,7 +130,7 @@ Generally, we follow the style guidelines as suggested by the official language. Please run your code through: -- [ESLint](http://eslint.org/) with the standard style guide. +- [ESLint](http://eslint.org/) with a standard style guide. - [esdoc](https://github.com/sendgrid/nodejs-http-client/blob/master/USAGE.md) to check the documentation coverage of your added code. @@ -141,8 +142,10 @@ Please run your code through: ```bash # Clone your fork of the repo into the current directory git clone https://github.com/sendgrid/nodejs-http-client + # Navigate to the newly cloned directory cd nodejs-http-client + # Assign the original repo to a remote called "upstream" git remote add upstream https://github.com/sendgrid/nodejs-http-client ``` @@ -162,14 +165,11 @@ Please run your code through: ``` 4. Commit your changes in logical chunks. Please adhere to these [git commit - message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) - or your code is unlikely to be merged into the main project. Use Git's - [interactive rebase](https://help.github.com/articles/interactive-rebase) - feature to tidy up your commits before making them public. + message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or your code is unlikely to be merged into the main project. Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public. -4a. Create tests. + 4 *a*. Create tests. -4b. Create or update the example code that demonstrates the functionality of this change to the code. + 4 *b*. Create or update the example code that demonstrates the functionality of the changes to the code. 5. Locally merge (or rebase) the upstream development branch into your topic branch: @@ -177,13 +177,12 @@ Please run your code through: git pull [--rebase] upstream master ``` -6. Push your topic branch up to your fork: +7. Push your topic branch up to your fork: ```bash git push origin ``` -7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) - with a clear title and description against the `master` branch. All tests must be passing before we will review the PR. +8. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title and description against the **master branch**. All the tests must be passed before we review the PR. -If you have any additional questions, please feel free to [email](mailto:dx@sendgrid.com) us or create an issue in this repo. +If you have any questions, please feel free to [email](mailto:dx@sendgrid.com) us or create an issue in this repository. From 63a2c0fd9267f95605fcfc6449b015b167d4ae4b Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Fri, 5 Oct 2018 23:21:52 +0530 Subject: [PATCH 4/7] Update README.md Improved the language and scanned the file using Grammar.ly --- README.md | 53 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 780874e..1daa981 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,13 @@ [![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/nodejs-http-client.svg)](https://github.com/sendgrid/nodejs-http-client/graphs/contributors) [![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md) -**Quickly and easily access any RESTful or RESTful-like API.** +**Quickly and easily access any RESTful or RESTful-*like* API.** -If you are looking for the SendGrid API client library, please see [this repo](https://github.com/sendgrid/sendgrid-nodejs). +If you are looking for the SendGrid API client library, please see this [repo](https://github.com/sendgrid/sendgrid-nodejs). # Announcements -All updates to this library are documented in our [CHANGELOG](https://github.com/sendgrid/nodejs-http-client/blob/master/CHANGELOG.md). +All the updates to this library are documented in our [CHANGELOG](https://github.com/sendgrid/nodejs-http-client/blob/master/CHANGELOG.md). # Table of Contents - [Installation](#installation) @@ -29,13 +29,14 @@ All updates to this library are documented in our [CHANGELOG](https://github.com ## Prerequisites -- Node.js version 0.10, 0.12 or 4 +- Node.JS version 0.10, 0.12 or 4 -You need to have a API key to use the app. To configure the API key in the environment variables follow these steps. - - create .env file in the root directory of the project. - - Copy the contents of .env_sample file in to the .env file - - Once you have obtained the API key, find the environment variable SENDGRID_API_KEY and assign your API key as it's value. - As an example it should look like this +You need to have a **API key** to use the app. To configure the API key in the environment variables follow these steps: + - create `.env` file in the root directory of the project. + - Copy the contents of `.env_sample` file in to the `.env` file + - Once you have obtained the API key, find the environment variable - `SENDGRID_API_KEY` and assign this value to your API key. + + It should look like this: ``` SENDGRID_API_KEY=''; ``` @@ -50,7 +51,7 @@ npm install sendgrid-rest # Quick Start -`GET /your/api/{param}/call` +**`GET`**`/your/api/{param}/call` ```javascript var Client = require('sendgrid-rest').Client @@ -67,7 +68,7 @@ client.API(request, function (response) { }) ``` -`POST /your/api/{param}/call` with headers, query parameters and a request body. +**`POST`**`/your/api/{param}/call` with headers, query parameters and a request body. ```javascript var Client = require('sendgrid-rest').Client @@ -100,13 +101,16 @@ Following is an example using SendGrid. You can get your free account [here](htt First, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys). -You can copy the .env_example file located in the "examples" folder to ```.env``` in your project's root. - -```cp examples/.env_sample .env``` +You can copy the `.env_example` file located in the "examples" folder to `.env` in your project's root. -Once you have edited the file and added your API Key, you can add the variable to your environment: -```source .env``` +```bash +cp examples/.env_sample .env +``` +Once you have edited the file and added your API Key, you can add the variables to your environment: +```bash +source .env +``` Here is the [full working code](https://github.com/sendgrid/nodejs-http-client/blob/master/examples/example.js). @@ -115,24 +119,27 @@ To run the example: ```bash node examples/example ``` -======= +--- [Library Usage Documentation](https://github.com/sendgrid/nodejs-http-client/blob/master/USAGE.md) # Tests -Tests can be run through a [Docker](https://www.docker.com) container which is defined in the [docker-compose.yml](docker-compose.yml) file. +Tests can be run through a [Docker](https://www.docker.com) container which is defined in the [`docker-compose.yml`](docker-compose.yml) file. -To run the tests, simply run `docker-compose up`. +To run the tests, simply run +```bash +docker-compose up +``` # Roadmap -If you are interested in the future direction of this project, please take a look at our [milestones](https://github.com/sendgrid/nodejs-http-client/milestones). We would love to hear your feedback. +If you are interested in the future directions of this project, please take a look at our [milestones](https://github.com/sendgrid/nodejs-http-client/milestones). We would love to hear your feedback. # How to Contribute -We encourage contribution to our libraries, please see our [CONTRIBUTING](https://github.com/sendgrid/nodejs-http-client/blob/master/CONTRIBUTING.md) guide for details. +We encourage contributions to our libraries, please see our [CONTRIBUTING](https://github.com/sendgrid/nodejs-http-client/blob/master/CONTRIBUTING.md) guide for details. * [Feature Request](https://github.com/sendgrid/nodejs-http-client/blob/master/CONTRIBUTING.md#feature-request) * [Bug Reports](https://github.com/sendgrid/nodejs-http-client/blob/master/CONTRIBUTING.md#submit-a-bug-report) @@ -141,9 +148,9 @@ We encourage contribution to our libraries, please see our [CONTRIBUTING](https: # About -nodejs-http-client is guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com). +**nodejs-http-client** is guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com). -nodejs-http-client is maintained and funded by SendGrid, Inc. The names and logos for nodejs-http-client are trademarks of SendGrid, Inc. +**nodejs-http-client** is maintained and funded by SendGrid, Inc. The names and logos for **nodejs-http-client** are trademarks of SendGrid, Inc. # License From 56b6c2a1e4dbb4542a13ad00fecec146340b3f06 Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Fri, 5 Oct 2018 23:22:47 +0530 Subject: [PATCH 5/7] Update TROUBLESHOOTING.md Improved the language and scanned the file using Grammar.ly --- TROUBLESHOOTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 1b11bef..871bff7 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -8,7 +8,7 @@ If you can't find a solution below, please open an [issue](https://github.com/se ## Viewing the Request Body -When debugging or testing, it may be useful to examine the raw request body to compare against the [documented format](https://sendgrid.com/docs/API_Reference/api_v3.html). +While debugging or testing, it may be useful to examine the raw request body to compare with the [documented format](https://sendgrid.com/docs/API_Reference/api_v3.html). You can do this with something like: ```javascript From cf8ab11b6421b5070445e396ed34eb68552abcd6 Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Fri, 5 Oct 2018 23:23:34 +0530 Subject: [PATCH 6/7] Update USAGE.md Improved the language and scanned the file using Grammar.ly --- USAGE.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/USAGE.md b/USAGE.md index 51aaa9d..ada06e5 100644 --- a/USAGE.md +++ b/USAGE.md @@ -20,10 +20,12 @@ node examples/example If you would like to auto-generate documentation of the packages, you can do so locally by running: - `./node_modules/.bin/esdoc` + ```bash + ./node_modules/.bin/esdoc + ``` - Using the .esdoc.json file, esdoc will create documentation in the docs directory. + Using the `.esdoc.json` file, **esdoc** will create documentation in the docs directory. ## Checking docs coverage - You will find a coverage.json file in the **docs** directory. This will contain information about the documentation coverage for each of the different files in this repo. \ No newline at end of file + You will find a `coverage.json` file in the **docs** directory. This contains information about the documentation coverage for each of the different files in this repository. From 1bb81d9b878334284004a33108138f2ea0fac6ba Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Fri, 5 Oct 2018 23:24:31 +0530 Subject: [PATCH 7/7] Update USE_CASES.md Minor changes in language and scanned the file using Grammar.ly --- USE_CASES.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/USE_CASES.md b/USE_CASES.md index bd96cb2..60b0d0d 100644 --- a/USE_CASES.md +++ b/USE_CASES.md @@ -1,6 +1,6 @@ -Following Document provides several use cases of how to make RESTful method calls for an http-client. Please [open an issue](https://github.com/sendgrid/nodejs-http-client/issues) or make a pull request for any use cases you would like us to document here. Thank you! +Following document provides several use cases of how to make RESTful method calls for an http-client. Please [open an issue](https://github.com/sendgrid/nodejs-http-client/issues) or make a pull request for any use cases you would like us to document here. Thank you! -# RESTful API Calls- +# RESTful API Calls - GET - POST @@ -8,11 +8,11 @@ Following Document provides several use cases of how to make RESTful method call - PUT - DEL -In the following examples, it assumed you have got your own unique Sendgrid API key. +In the following examples, it is assumed that you have your own unique **Sendgrid API key**. -The Following Requests are made using Python. +The Following Requests are made using **`Python`**. -Please Import these libraries at the start of the program and install them using pip command if not already done before. +Please Import these libraries in the beginning of the program and install them using `pip` command if not already done before. ```python import sendgrid