Skip to content

Commit

Permalink
Merge pull request #126 from pusher/promises
Browse files Browse the repository at this point in the history
Promises
  • Loading branch information
Callum Oakley authored Oct 20, 2020
2 parents 5b098ab + 615d5a2 commit 2030ed8
Show file tree
Hide file tree
Showing 44 changed files with 3,643 additions and 2,808 deletions.
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
env: {
node: true,
commonjs: true,
},
extends: "eslint:recommended",
parserOptions: {
ecmaVersion: 12,
},
rules: {
"no-var": "error",
"prefer-const": "error",
},
}
26 changes: 26 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Configuration for probot-stale - https://github.com/probot/stale

# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 365

# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 7

# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels: []

# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- pinned
- security

# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: true

# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. If you'd
like this issue to stay open please leave a comment indicating how this issue
is affecting you. Thankyou.
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
semi: false,
}
25 changes: 19 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
language: node_js
node_js:
- "12"
- "10"
- "8"
install:
- npm install
jobs:
include:
- node_js: 14
script:
- npm run lint
- npm test
- node_js: 12
script:
- npm run lint
- npm test
- node_js: 10
script:
- npm run lint
- npm test
- node_js: 8
script:
# eslint doesn't support node 8, but it's sufficient to check that the
# tests pass.
- npm test
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
## Unreleased

[BREAKING CHANGE] Methods that previously took callbacks now return promises.

- `trigger`, `triggerBatch`, `get`, and `post` return a promise which resolves
to a [`Response`](https://github.com/node-fetch/node-fetch#class-response) (as provided by [node-fetch](https://github.com/node-fetch/node-fetch)),
or rejects to a `RequestError`. Of particular note:
- `Response` has a `status` where is used to have a `statusCode`.
- `RequestError` has a `status` where is used to have a `statusCode` to
mirror the above.
- `Response` has
[`json`](https://github.com/node-fetch/node-fetch#bodyjson),
[`text`](https://github.com/node-fetch/node-fetch#bodytext), etc to
access the body where before it exposed `body` as a string.

[BREAKING CHANGE] The `Pusher` constructor no longer accepts `proxy` or `keepAlive`, but instead accepts [`agent`](https://nodejs.org/api/https.html#https_class_https_agent).

- To configure a proxy, use [`https://www.npmjs.com/package/https-proxy-agent`](https://www.npmjs.com/package/https-proxy-agent) or similar:

```js
const pusher = new Pusher.forURL(process.env.PUSHER_URL, {
agent: new HttpsProxyAgent("http://localhost:8321"),
})
```

- To configure keep alive:

```js
const pusher = new Pusher.forURL(process.env.PUSHER_URL, {
agent: new https.Agent({ keepAlive: true }),
})
```

[REMOVED] Specific Parse Cloud build. I don't believe it is required any more, but please open an issue if there are any problems using this release on Parse Cloud!

## 3.0.1 (2020-03-27)

[UPGRADED] development dependencies
Expand Down
Loading

0 comments on commit 2030ed8

Please sign in to comment.