Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit c3e3c12

Browse files
committed
MD formatting.
1 parent 7c16080 commit c3e3c12

File tree

2 files changed

+13
-27
lines changed

2 files changed

+13
-27
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# CONTRIBUTING
22

3-
Contributions are always welcome, no matter how large or small. Before contributing,
4-
please read the [code of conduct](CODE_OF_CONDUCT.md).
3+
Contributions are always welcome, no matter how large or small. Before contributing, please read the [code of conduct](CODE_OF_CONDUCT.md).
54

65
## Setup
76

@@ -18,8 +17,7 @@ You can also use yarn.
1817

1918
## Testing
2019

21-
This repo uses [ava](https://github.com/avajs/ava) for testing.
22-
Any files in the `src` directory that have a `.test.js` file extension are automatically detected and run as tests.
20+
This repo uses [ava](https://github.com/avajs/ava) for testing. Any files in the `src` directory that have a `.test.js` file extension are automatically detected and run as tests.
2321

2422
We also test for a few other variables:
2523

@@ -30,11 +28,9 @@ We also test for a few other variables:
3028

3129
## Architecture
3230

33-
We target Node.js LTS and stable environments, and aim for basic modern browser support when possible.
34-
In order to facilitate simple contributions, we avoided any kind of build steps.
31+
We target Node.js LTS and stable environments, and aim for basic modern browser support when possible. In order to facilitate simple contributions, we avoided any kind of build steps.
3532

36-
If you need to add new API routes, please add them to the [open-api](https://github.com/netlify/open-api) repo.
37-
This client will automatically inherent the new routes from that module.
33+
If you need to add new API routes, please add them to the [open-api](https://github.com/netlify/open-api) repo. This client will automatically inherent the new routes from that module.
3834

3935
Projects that depend heavily on this client that should be taken into consideration when making changes:
4036

README.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,31 +35,25 @@ Create a new instance of the Netlify API client with the provided `accessToken`.
3535

3636
### `client.accessToken`
3737

38-
A setter/getter that returns the `accessToken` that the client is configured to use.
39-
You can set this after the class is instantiated, and all subsequent calls will use the newly set `accessToken`.
38+
A setter/getter that returns the `accessToken` that the client is configured to use. You can set this after the class is instantiated, and all subsequent calls will use the newly set `accessToken`.
4039

4140
### `client.basePath`
4241

4342
A getter that returns the formatted base URL of the endpoint the client is configured to use.
4443

4544
### Open API Client methods
4645

47-
The client is dynamically generated from the [open-api](https://github.com/netlify/open-api) definition file.
48-
Each method is is named after the `operationId` name of each endpoint action.
49-
**To see list of available operations see the [open-api website](https://open-api.netlify.com/)**.
46+
The client is dynamically generated from the [open-api](https://github.com/netlify/open-api) definition file. Each method is is named after the `operationId` name of each endpoint action. **To see list of available operations see the [open-api website](https://open-api.netlify.com/)**.
5047

5148
Every open-api method has the following signature:
5249

5350
#### `promise(response) = client.operationId([params], [opts])`
5451

55-
Perform a call to the given endpoint corresponding with the `operationId`.
56-
Returns promise that will resolve with the body of the response, or reject with an error with details about the request attached.
57-
Rejects if the `status` > 400.
58-
Successful response objects have `status` and `statusText` properties on their prototype.
52+
Perform a call to the given endpoint corresponding with the `operationId`. Returns promise that will resolve with the body of the response, or reject with an error with details about the request attached. Rejects if the `status` > 400. Successful response objects have `status` and `statusText` properties on their prototype.
5953

60-
`params` is an object that includes any of the required or optional endpoint parameters.
61-
`params.body` should be an object which gets serialized to JSON automatically.
62-
If the endpoint accepts `binary`, `params.body` can be a Node.js readable stream.
54+
- `params` is an object that includes any of the required or optional endpoint parameters.
55+
- `params.body` should be an object which gets serialized to JSON automatically.
56+
- If the endpoint accepts `binary`, `params.body` can be a Node.js readable stream.
6357

6458
```js
6559
// example params
@@ -72,8 +66,7 @@ If the endpoint accepts `binary`, `params.body` can be a Node.js readable stream
7266
}
7367
```
7468

75-
Optional `opts` can include any property you want passed to `node-fetch`.
76-
The `headers` property is merged with some `defaultHeaders`.
69+
Optional `opts` can include any property you want passed to `node-fetch`. The `headers` property is merged with some `defaultHeaders`.
7770

7871
```js
7972
// example opts
@@ -102,18 +95,15 @@ async function getSomeData () {
10295
}
10396
```
10497

105-
If the request response includes `json` in the `contentType` header, fetch will deserialize the JSON body.
106-
Otherwise the `text` of the response is returned.
98+
If the request response includes `json` in the `contentType` header, fetch will deserialize the JSON body. Otherwise the `text` of the response is returned.
10799

108100
### API Flow Methods
109101

110102
Some methods have been added in addition to the open API methods that make certain actions simpler to perform.
111103

112104
#### `promise(accessToken) = client.getAccessToken(ticket, [opts])`
113105

114-
Pass in a [`ticket`](https://open-api.netlify.com/#model-ticket) and get back an `accessToken`.
115-
Call this with the response from a `client.createTicket({ client_id })` call.
116-
Automatically sets the `accessToken` to `this.accessToken` and returns `accessToken` for the consumer to save for later.
106+
Pass in a [`ticket`](https://open-api.netlify.com/#model-ticket) and get back an `accessToken`. Call this with the response from a `client.createTicket({ client_id })` call. Automatically sets the `accessToken` to `this.accessToken` and returns `accessToken` for the consumer to save for later.
117107

118108
Optional `opts` include:
119109

0 commit comments

Comments
 (0)