pusher 5.2.0 → 5.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,5 @@
1
+ name: Release
2
+
1
3
  on:
2
4
  push:
3
5
  branches: [master]
@@ -7,7 +9,7 @@ jobs:
7
9
  runs-on: ubuntu-latest
8
10
  steps:
9
11
  - name: Checkout code
10
- uses: actions/checkout@v2
12
+ uses: actions/checkout@v4
11
13
  with:
12
14
  fetch-depth: 0
13
15
  - name: Prepare tag
@@ -26,7 +28,7 @@ jobs:
26
28
  id: release_output
27
29
  if: ${{ steps.prepare_tag.outcome == 'success' }}
28
30
  run: |
29
- echo "::set-output name=tag::${{ env.TAG }}"
31
+ echo "tag=${{ env.TAG }}" >> $GITHUB_OUTPUT
30
32
  outputs:
31
33
  tag: ${{ steps.release_output.outputs.tag }}
32
34
 
@@ -34,8 +36,10 @@ jobs:
34
36
  runs-on: ubuntu-latest
35
37
  needs: check-release-tag
36
38
  if: ${{ needs.check-release-tag.outputs.tag }}
39
+ permissions:
40
+ contents: write
37
41
  steps:
38
- - uses: actions/checkout@v2
42
+ - uses: actions/checkout@v4
39
43
  - name: Prepare tag
40
44
  run: |
41
45
  export TAG=v$(jq -r '.version' package.json)
@@ -49,34 +53,26 @@ jobs:
49
53
  csplit -s CHANGELOG.md "/##/" {1}
50
54
  cat xx01 > CHANGELOG.tmp
51
55
  - name: Create Release
52
- uses: actions/create-release@v1
53
- env:
54
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56
+ uses: softprops/action-gh-release@v2
55
57
  with:
56
58
  tag_name: ${{ env.TAG }}
57
- release_name: ${{ env.TAG }}
59
+ name: ${{ env.TAG }}
58
60
  body_path: CHANGELOG.tmp
59
61
  draft: false
60
62
  prerelease: false
63
+ env:
64
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61
65
 
62
66
  publish-to-npm:
63
67
  runs-on: ubuntu-latest
64
68
  needs: create-github-release
65
69
  steps:
66
- - uses: actions/checkout@v2
67
- - uses: flood-io/is-published-on-npm@8478347e2650eb228d303975415458183d0a37e4
68
- id: is-published
69
- - run: echo "This version is already published on NPM"
70
- if: ${{ steps.is-published.outputs.published == 'true' }}
71
- - uses: actions/setup-node@v2
72
- if: ${{ steps.is-published.outputs.published == 'false' }}
70
+ - uses: actions/checkout@v4
71
+ - uses: actions/setup-node@v4
73
72
  with:
74
- node-version: "14"
75
- registry-url: https://registry.npmjs.org/
73
+ node-version: "20"
74
+ registry-url: "https://registry.npmjs.org"
76
75
  - run: npm install
77
- if: ${{ steps.is-published.outputs.published == 'false' }}
78
76
  - run: npm publish --access public
79
- if: ${{ steps.is-published.outputs.published == 'false' }}
80
77
  env:
81
78
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
82
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -11,13 +11,16 @@ jobs:
11
11
  name: Prepare release
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
- - uses: actions/checkout@v2
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ token: ${{ secrets.PUSHER_CI_GITHUB_PRIVATE_TOKEN }}
17
+ fetch-depth: 0
15
18
  - name: Get current version
16
19
  shell: bash
17
20
  run: |
18
21
  CURRENT_VERSION=$(jq -r '.version' package.json)
19
22
  echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
20
- - uses: actions/checkout@v2
23
+ - uses: actions/checkout@v4
21
24
  with:
22
25
  repository: pusher/actions
23
26
  token: ${{ secrets.PUSHER_CI_GITHUB_PRIVATE_TOKEN }}
@@ -26,11 +29,12 @@ jobs:
26
29
  id: bump
27
30
  with:
28
31
  current_version: ${{ env.CURRENT_VERSION }}
29
- - uses: actions/setup-node@v2
32
+ token: ${{ secrets.PUSHER_CI_GITHUB_PRIVATE_TOKEN }}
33
+ - uses: actions/setup-node@v4
30
34
  with:
31
- node-version: "14"
35
+ node-version: "20"
32
36
  - run: npm install
33
- - name: Push
37
+ - name: Commit and push version bump
34
38
  shell: bash
35
39
  run: |
36
40
  echo "$(jq '.version = "${{ steps.bump.outputs.new_version }}"' package.json)" > package.json
@@ -7,7 +7,7 @@ on:
7
7
 
8
8
  jobs:
9
9
  test:
10
- runs-on: ubuntu-20.04
10
+ runs-on: ubuntu-latest
11
11
  strategy:
12
12
  fail-fast: false
13
13
  matrix:
@@ -17,7 +17,7 @@ jobs:
17
17
 
18
18
  steps:
19
19
  - name: Checkout
20
- uses: actions/checkout@v2
20
+ uses: actions/checkout@v4
21
21
 
22
22
  - name: Setup Node.js
23
23
  uses: actions/setup-node@v2
package/CHANGELOG.md CHANGED
@@ -1,8 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.3.3
4
+
5
+ - [FIXED] Bump node-fetch to ^2.7.0, express to ^4.22.1, eslint to ^7.32.0, mocha to ^9.2.2
6
+ - [FIXED] Pin transitive dependencies via overrides: cipher-base, cookie, elliptic, form-data, lodash, pbkdf2, qs, sha.js, tar
7
+
8
+ ## 5.3.2
9
+
10
+ - [Added] missing error types for Typescript support
11
+
12
+ ## 5.3.1
13
+
14
+ - [CHANGED] Fix Github Actions.
15
+
3
16
  ## 5.2.0
4
17
 
5
- - [CHANGED] Remove old notification references. It's no longer being used
18
+ - [CHANGED] Remove old notification references. It's no longer being used
6
19
 
7
20
  ## 5.1.3
8
21
 
package/README.md CHANGED
@@ -5,6 +5,8 @@
5
5
 
6
6
  In order to use this library, you need to have an account on <https://pusher.com/channels>. After registering, you will need the application credentials for your app.
7
7
 
8
+ For reporting issues, bugs, and feature requests, please feel free to open a pull request or open an issue. If you do not receive a timely response, feel free to check our [support portal](https://docs.bird.com/pusher).
9
+
8
10
  ## Supported platforms
9
11
 
10
12
  This SDK supports **Node.js** version 10+.
package/index.d.ts CHANGED
@@ -190,5 +190,31 @@ declare namespace Pusher {
190
190
  getTime(): Date
191
191
  }
192
192
 
193
+ export class RequestError extends Error {
194
+ constructor(
195
+ message: string,
196
+ url: string,
197
+ error: Error,
198
+ status?: number,
199
+ body?: string
200
+ )
201
+ url: string
202
+ error: Error
203
+ status?: number
204
+ body?: string
205
+ }
206
+
207
+ export class WebHookError extends Error {
208
+ constructor(
209
+ message: string,
210
+ contentType: string,
211
+ body: string,
212
+ signature: string
213
+ )
214
+ contentType: string
215
+ body: string
216
+ signature: string
217
+ }
218
+
193
219
  export { Response }
194
220
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pusher",
3
3
  "description": "Node.js client to interact with the Pusher Channels REST API",
4
- "version": "5.2.0",
4
+ "version": "5.3.3",
5
5
  "author": "Pusher <support@pusher.com>",
6
6
  "contributors": [
7
7
  {
@@ -24,24 +24,35 @@
24
24
  "dependencies": {
25
25
  "abort-controller": "^3.0.0",
26
26
  "is-base64": "^1.1.0",
27
- "node-fetch": "^2.6.1",
27
+ "node-fetch": "^2.7.0",
28
28
  "tweetnacl": "^1.0.0",
29
29
  "tweetnacl-util": "^0.15.0",
30
30
  "@types/node-fetch": "^2.5.7"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^14.14.6",
34
- "eslint": "^7.11.0",
34
+ "eslint": "^7.32.0",
35
35
  "expect.js": "=0.3.1",
36
- "express": "^4.17.1",
36
+ "express": "^4.22.1",
37
37
  "https-proxy-agent": "^5.0.0",
38
- "mocha": "^7.2.0",
38
+ "mocha": "^9.2.2",
39
39
  "nock": "^12.0.3",
40
40
  "prettier": "2.1.2",
41
41
  "sinon": "=1.10.2",
42
42
  "webpack": "^4.42.1",
43
43
  "webpack-cli": "^3.3.11"
44
44
  },
45
+ "overrides": {
46
+ "cipher-base": "^1.0.6",
47
+ "cookie": "^0.7.1",
48
+ "elliptic": "^6.6.1",
49
+ "form-data": "^3.0.4",
50
+ "lodash": "^4.17.23",
51
+ "pbkdf2": "^3.1.5",
52
+ "qs": "^6.14.0",
53
+ "sha.js": "^2.4.12",
54
+ "tar": "^6.2.1"
55
+ },
45
56
  "scripts": {
46
57
  "local-test": "npx mocha 'tests/integration/**/*.js'",
47
58
  "test": "npx mocha 'tests/{integration,remote}/**/*.js'",