strong-error-handler 3.5.0 → 4.0.1

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.
@@ -2,9 +2,6 @@
2
2
  Questions:
3
3
  https://groups.google.com/forum/#!forum/loopbackjs
4
4
  https://gitter.im/strongloop/loopback
5
- Immediate support:
6
- https://strongloop.com/api-connect-faqs/
7
- https://strongloop.com/node-js/subscription-plans/
8
5
  -->
9
6
 
10
7
  # Description/Steps to reproduce
@@ -0,0 +1,2 @@
1
+ paths-ignore:
2
+ - '**/test/**'
@@ -0,0 +1,28 @@
1
+ name: "CodeQL"
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ # The branches below must be a subset of the branches above
8
+ branches: [master]
9
+ schedule:
10
+ - cron: '0 13 * * 6'
11
+
12
+ jobs:
13
+ analyze:
14
+ name: Analyze
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - name: Checkout repository
19
+ uses: actions/checkout@v3
20
+
21
+ - name: Initialize CodeQL
22
+ uses: github/codeql-action/init@v2
23
+ with:
24
+ languages: 'javascript'
25
+ config-file: ./.github/codeql/codeql-config.yml
26
+
27
+ - name: Perform CodeQL Analysis
28
+ uses: github/codeql-action/analyze@v2
@@ -0,0 +1,74 @@
1
+ name: Continuous Integration
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ # The branches below must be a subset of the branches above
8
+ branches: [master]
9
+ schedule:
10
+ - cron: '0 2 * * 1' # At 02:00 on Monday
11
+
12
+ env:
13
+ NODE_OPTIONS: --max-old-space-size=4096
14
+
15
+ jobs:
16
+ test:
17
+ name: Test
18
+ timeout-minutes: 15
19
+ strategy:
20
+ matrix:
21
+ os: [ubuntu-latest]
22
+ node-version: [10, 12, 14, 16]
23
+ include:
24
+ - os: macos-latest
25
+ node-version: 14 # LTS
26
+ fail-fast: false
27
+ runs-on: ${{ matrix.os }}
28
+ steps:
29
+ - uses: actions/checkout@v3
30
+ with:
31
+ fetch-depth: 0
32
+ - name: Use Node.js ${{ matrix.node-version }}
33
+ uses: actions/setup-node@v3
34
+ with:
35
+ node-version: ${{ matrix.node-version }}
36
+ - name: Bootstrap project
37
+ run: |
38
+ npm ci --ignore-scripts
39
+ - uses: Yuri6037/Action-FakeTTY@v1.1
40
+ - name: Run tests
41
+ run: faketty npm test --ignore-scripts
42
+
43
+ code-lint:
44
+ name: Code Lint
45
+ runs-on: ubuntu-latest
46
+ steps:
47
+ - uses: actions/checkout@v3
48
+ - name: Use Node.js 14
49
+ uses: actions/setup-node@v3
50
+ with:
51
+ node-version: 14
52
+ - name: Bootstrap project
53
+ run: |
54
+ npm ci --ignore-scripts
55
+ - name: Verify code linting
56
+ run: npm run lint
57
+
58
+ commit-lint:
59
+ name: Commit Lint
60
+ runs-on: ubuntu-latest
61
+ if: ${{ github.event.pull_request }}
62
+ steps:
63
+ - uses: actions/checkout@v3
64
+ with:
65
+ fetch-depth: 0
66
+ - name: Use Node.js 14
67
+ uses: actions/setup-node@v3
68
+ with:
69
+ node-version: 14
70
+ - name: Bootstrap project
71
+ run: |
72
+ npm ci --ignore-scripts
73
+ - name: Verify commit linting
74
+ run: npx commitlint --from origin/master --to HEAD --verbose
package/CHANGES.md CHANGED
@@ -1,3 +1,101 @@
1
+ 2022-11-07, Version 4.0.1
2
+ =========================
3
+
4
+ * chore: update dependency mocha to v10 (renovate[bot])
5
+
6
+ * chore: update dependency chai to ^4.3.7 (renovate[bot])
7
+
8
+ * chore: lock file maintenance (renovate[bot])
9
+
10
+ * chore: update dependency eslint to ^8.27.0 (renovate[bot])
11
+
12
+ * chore: update dependency eslint to v8 (renovate[bot])
13
+
14
+ * chore: update dependency @commitlint/config-conventional to ^17.2.0 (renovate[bot])
15
+
16
+ * chore: update dependency supertest to ^6.3.1 (renovate[bot])
17
+
18
+ * chore: update dependency express to ^4.18.2 (renovate[bot])
19
+
20
+ * chore: update dependency supertest to ^6.3.0 (renovate[bot])
21
+
22
+ * chore: update dependency @types/express to ^4.17.14 (renovate[bot])
23
+
24
+ * chore: update dependency @commitlint/config-conventional to v17 (renovate[bot])
25
+
26
+ * chore: update dependency http-status to ^1.5.3 (renovate[bot])
27
+
28
+ * chore: update dependency supertest to ^6.2.4 (renovate[bot])
29
+
30
+ * chore: lock file maintenance (Renovate Bot)
31
+
32
+ * chore: update dependency ejs to ^3.1.8 (Renovate Bot)
33
+
34
+ * chore: update dependency http-status to ^1.5.2 (Renovate Bot)
35
+
36
+ * chore: update dependency supertest to ^6.2.3 (Renovate Bot)
37
+
38
+ * chore: update dependency @commitlint/config-conventional to ^16.2.4 (Renovate Bot)
39
+
40
+ * chore: update github/codeql-action action to v2 (Renovate Bot)
41
+
42
+ * chore: update dependency express to ^4.18.1 (Renovate Bot)
43
+
44
+ * chore: update dependency ejs to ^3.1.7 (Renovate Bot)
45
+
46
+ * chore: update dependency http-status to ^1.5.1 (Renovate Bot)
47
+
48
+ * chore: update dependency @commitlint/config-conventional to v16 (Renovate Bot)
49
+
50
+ * chore: update actions/setup-node action to v3 (Renovate Bot)
51
+
52
+ * chore: update actions/checkout action to v3 (Renovate Bot)
53
+
54
+ * chore: update dependency supertest to ^6.2.2 (Renovate Bot)
55
+
56
+ * chore: update dependency mocha to ^9.2.2 (Renovate Bot)
57
+
58
+ * chore: update dependency fast-safe-stringify to ^2.1.1 (Renovate Bot)
59
+
60
+ * chore: update dependency eslint to ^7.32.0 (Renovate Bot)
61
+
62
+ * chore: update dependency js2xmlparser to ^4.0.2 (Renovate Bot)
63
+
64
+ * chore: update dependency ejs to ^3.1.6 (Renovate Bot)
65
+
66
+ * chore: update dependency strong-globalize to ^6.0.5 (Renovate Bot)
67
+
68
+ * chore: update dependency http-status to ^1.5.0 (Renovate Bot)
69
+
70
+ * chore: update dependency express to ^4.17.3 (Renovate Bot)
71
+
72
+ * chore: update dependency debug to ^4.3.4 (Renovate Bot)
73
+
74
+ * chore: update dependency accepts to ^1.3.8 (Renovate Bot)
75
+
76
+ * chore: update dependency chai to ^4.3.6 (Renovate Bot)
77
+
78
+ * ci: add renovate config (Rifa Achrinza)
79
+
80
+ * docs: add SECURITY.md (Diana Lau)
81
+
82
+ * docs: update coc (Diana Lau)
83
+
84
+ * docs: add code of conduct (Diana Lau)
85
+
86
+ * feat: update CI pipeline (Rifa Achrinza)
87
+
88
+ * chore: move repo to loopbackio org (Diana Lau)
89
+
90
+
91
+ 2020-10-13, Version 4.0.0
92
+ =========================
93
+
94
+ * docs: update LTS versions in README (Miroslav Bajtoš)
95
+
96
+ * [SEMVER-MAJOR] Reword log messages for clarity (Miroslav Bajtoš)
97
+
98
+
1
99
  2020-06-23, Version 3.5.0
2
100
  =========================
3
101
 
@@ -0,0 +1,178 @@
1
+ # Code of Conduct
2
+
3
+ LoopBack, as member project of the OpenJS Foundation, use
4
+ [Contributor Covenant v2.0](https://contributor-covenant.org/version/2/0/code_of_conduct)
5
+ as their code of conduct. The full text is included
6
+ [below](#contributor-covenant-code-of-conduct-v2.0) in English, and translations
7
+ are available from the Contributor Covenant organisation:
8
+
9
+ - [contributor-covenant.org/translations](https://www.contributor-covenant.org/translations)
10
+ - [github.com/ContributorCovenant](https://github.com/ContributorCovenant/contributor_covenant/tree/release/content/version/2/0)
11
+
12
+ Refer to the sections on reporting and escalation in this document for the
13
+ specific emails that can be used to report and escalate issues.
14
+
15
+ ## Reporting
16
+
17
+ ### Project Spaces
18
+
19
+ For reporting issues in spaces related to LoopBack, please use the email
20
+ `tsc@loopback.io`. The LoopBack Technical Steering Committee (TSC) handles CoC issues related to the spaces that it
21
+ maintains. The project TSC commits to:
22
+
23
+ - maintain the confidentiality with regard to the reporter of an incident
24
+ - to participate in the path for escalation as outlined in the section on
25
+ Escalation when required.
26
+
27
+ ### Foundation Spaces
28
+
29
+ For reporting issues in spaces managed by the OpenJS Foundation, for example,
30
+ repositories within the OpenJS organization, use the email
31
+ `report@lists.openjsf.org`. The Cross Project Council (CPC) is responsible for
32
+ managing these reports and commits to:
33
+
34
+ - maintain the confidentiality with regard to the reporter of an incident
35
+ - to participate in the path for escalation as outlined in the section on
36
+ Escalation when required.
37
+
38
+ ## Escalation
39
+
40
+ The OpenJS Foundation maintains a Code of Conduct Panel (CoCP). This is a
41
+ foundation-wide team established to manage escalation when a reporter believes
42
+ that a report to a member project or the CPC has not been properly handled. In
43
+ order to escalate to the CoCP send an email to
44
+ `coc-escalation@lists.openjsf.org`.
45
+
46
+ For more information, refer to the full
47
+ [Code of Conduct governance document](https://github.com/openjs-foundation/cross-project-council/blob/HEAD/CODE_OF_CONDUCT.md).
48
+
49
+ ---
50
+
51
+ ## Contributor Covenant Code of Conduct v2.0
52
+
53
+ ## Our Pledge
54
+
55
+ We as members, contributors, and leaders pledge to make participation in our
56
+ community a harassment-free experience for everyone, regardless of age, body
57
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
58
+ identity and expression, level of experience, education, socio-economic status,
59
+ nationality, personal appearance, race, religion, or sexual identity and
60
+ orientation.
61
+
62
+ We pledge to act and interact in ways that contribute to an open, welcoming,
63
+ diverse, inclusive, and healthy community.
64
+
65
+ ## Our Standards
66
+
67
+ Examples of behavior that contributes to a positive environment for our
68
+ community include:
69
+
70
+ - Demonstrating empathy and kindness toward other people
71
+ - Being respectful of differing opinions, viewpoints, and experiences
72
+ - Giving and gracefully accepting constructive feedback
73
+ - Accepting responsibility and apologizing to those affected by our mistakes,
74
+ and learning from the experience
75
+ - Focusing on what is best not just for us as individuals, but for the overall
76
+ community
77
+
78
+ Examples of unacceptable behavior include:
79
+
80
+ - The use of sexualized language or imagery, and sexual attention or advances of
81
+ any kind
82
+ - Trolling, insulting or derogatory comments, and personal or political attacks
83
+ - Public or private harassment
84
+ - Publishing others' private information, such as a physical or email address,
85
+ without their explicit permission
86
+ - Other conduct which could reasonably be considered inappropriate in a
87
+ professional setting
88
+
89
+ ## Enforcement Responsibilities
90
+
91
+ Community leaders are responsible for clarifying and enforcing our standards of
92
+ acceptable behavior and will take appropriate and fair corrective action in
93
+ response to any behavior that they deem inappropriate, threatening, offensive,
94
+ or harmful.
95
+
96
+ Community leaders have the right and responsibility to remove, edit, or reject
97
+ comments, commits, code, wiki edits, issues, and other contributions that are
98
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
99
+ decisions when appropriate.
100
+
101
+ ## Scope
102
+
103
+ This Code of Conduct applies within all community spaces, and also applies when
104
+ an individual is officially representing the community in public spaces.
105
+ Examples of representing our community include using an official e-mail address,
106
+ posting via an official social media account, or acting as an appointed
107
+ representative at an online or offline event.
108
+
109
+ ## Enforcement
110
+
111
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
112
+ reported to the community leaders responsible for enforcement at
113
+ [tsc@loopback.io](mailto:tsc@loopback.io). All complaints will be reviewed and
114
+ investigated promptly and fairly.
115
+
116
+ All community leaders are obligated to respect the privacy and security of the
117
+ reporter of any incident.
118
+
119
+ ## Enforcement Guidelines
120
+
121
+ Community leaders will follow these Community Impact Guidelines in determining
122
+ the consequences for any action they deem in violation of this Code of Conduct:
123
+
124
+ ### 1. Correction
125
+
126
+ **Community Impact**: Use of inappropriate language or other behavior deemed
127
+ unprofessional or unwelcome in the community.
128
+
129
+ **Consequence**: A private, written warning from community leaders, providing
130
+ clarity around the nature of the violation and an explanation of why the
131
+ behavior was inappropriate. A public apology may be requested.
132
+
133
+ ### 2. Warning
134
+
135
+ **Community Impact**: A violation through a single incident or series of
136
+ actions.
137
+
138
+ **Consequence**: A warning with consequences for continued behavior. No
139
+ interaction with the people involved, including unsolicited interaction with
140
+ those enforcing the Code of Conduct, for a specified period of time. This
141
+ includes avoiding interactions in community spaces as well as external channels
142
+ like social media. Violating these terms may lead to a temporary or permanent
143
+ ban.
144
+
145
+ ### 3. Temporary Ban
146
+
147
+ **Community Impact**: A serious violation of community standards, including
148
+ sustained inappropriate behavior.
149
+
150
+ **Consequence**: A temporary ban from any sort of interaction or public
151
+ communication with the community for a specified period of time. No public or
152
+ private interaction with the people involved, including unsolicited interaction
153
+ with those enforcing the Code of Conduct, is allowed during this period.
154
+ Violating these terms may lead to a permanent ban.
155
+
156
+ ### 4. Permanent Ban
157
+
158
+ **Community Impact**: Demonstrating a pattern of violation of community
159
+ standards, including sustained inappropriate behavior, harassment of an
160
+ individual, or aggression toward or disparagement of classes of individuals.
161
+
162
+ **Consequence**: A permanent ban from any sort of public interaction within the
163
+ community.
164
+
165
+ ## Attribution
166
+
167
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
168
+ version 2.0, available at
169
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
170
+
171
+ Community Impact Guidelines were inspired by
172
+ [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
173
+
174
+ [homepage]: https://www.contributor-covenant.org
175
+
176
+ For answers to common questions about this code of conduct, see the FAQ at
177
+ https://www.contributor-covenant.org/faq. Translations are available at
178
+ https://www.contributor-covenant.org/translations.
@@ -0,0 +1,35 @@
1
+ ### Contributing ###
2
+
3
+ Thank you for your interest in `strong-error-handler`, an open source project
4
+ as part of LoopBack.
5
+
6
+ Contributing to `strong-error-handler` is easy. In a few simple steps:
7
+
8
+ * Ensure that your effort is aligned with the project's roadmap by
9
+ talking to the maintainers, especially if you are going to spend a
10
+ lot of time on it.
11
+
12
+ * Make something better or fix a bug.
13
+
14
+ * Adhere to code style outlined in the [Google C++ Style Guide][] and
15
+ [Google Javascript Style Guide][].
16
+
17
+ * Sign the [Developer Certificate of Origin](#developer-certificate-of-origin)
18
+
19
+ * Submit a pull request through Github.
20
+
21
+
22
+ ### Developer Certificate of Origin
23
+
24
+ This project uses [DCO](https://developercertificate.org/). Be sure to sign off
25
+ your commits using the `-s` flag or adding `Signed-off-By: Name<Email>` in the
26
+ commit message.
27
+
28
+ **Example**
29
+
30
+ ```
31
+ git commit -s -m "feat: my commit message"
32
+ ```
33
+
34
+ [Google C++ Style Guide]: https://google.github.io/styleguide/cppguide.html
35
+ [Google Javascript Style Guide]: https://google.github.io/styleguide/javascriptguide.xml
package/README.md CHANGED
@@ -14,11 +14,15 @@ In debug mode, `strong-error-handler` returns full error stack traces and intern
14
14
 
15
15
  ## Supported versions
16
16
 
17
- | Current | Long Term Support | Maintenance |
18
- | :-----: | :---------------: | :---------: |
19
- | 4.x | 3.x | 2.x |
17
+ This module adopts the [Module Long Term Support (LTS)](http://github.com/CloudNativeJS/ModuleLTS) policy, with the following End Of Life (EOL) dates:
20
18
 
21
- Learn more about our LTS plan in [docs](http://loopback.io/doc/en/contrib/Long-term-support.html).
19
+ | Version | Status | Published | EOL |
20
+ | ---------- | --------------- | --------- | -------------------- |
21
+ | 4.x | Current | Oct 2020 | Apr 2023 _(minimum)_ |
22
+ | 3.x | Active LTS | Jun 2018 | Dec 2022 |
23
+ | 2.x | End-of-life | Mar 2017 | Oct 2020 |
24
+
25
+ Learn more about our LTS plan in the [LoopBack documentation](http://loopback.io/doc/en/contrib/Long-term-support.html).
22
26
 
23
27
  ## Installation
24
28
 
package/SECURITY.md ADDED
@@ -0,0 +1,19 @@
1
+ # Security Policy
2
+
3
+ ## Security advisories
4
+
5
+ Security advisories can be found on the
6
+ [LoopBack website](https://loopback.io/doc/en/sec/index.html).
7
+
8
+ ## Reporting a vulnerability
9
+
10
+ If you think you have discovered a new security issue with any LoopBack package,
11
+ **please do not report it on GitHub**. Instead, send an email to
12
+ [security@loopback.io](mailto:security@loopback.io) with the following details:
13
+
14
+ - Full description of the vulnerability.
15
+ - Steps to reproduce the issue.
16
+ - Possible solutions.
17
+
18
+ If you are sending us any logs as part of the report, then make sure to redact
19
+ any sensitive data from them.
@@ -0,0 +1,20 @@
1
+ // Copyright IBM Corp. 2017,2018. All Rights Reserved.
2
+ // Node module: loopback-next
3
+ // This file is licensed under the MIT License.
4
+ // License text available at https://opensource.org/licenses/MIT
5
+ 'use strict';
6
+
7
+ const isCI = process.env.CI;
8
+ module.exports = {
9
+ extends: [
10
+ '@commitlint/config-conventional',
11
+ ],
12
+ rules: {
13
+ 'header-max-length': [2, 'always', 100],
14
+ 'body-leading-blank': [2, 'always'],
15
+ 'footer-leading-blank': [0, 'always'],
16
+ // Only enforce the rule if CI flag is not set. This is useful for release
17
+ // commits to skip DCO
18
+ 'signed-off-by': [isCI ? 0 : 2, 'always', 'Signed-off-by:'],
19
+ },
20
+ };
package/lib/logger.js CHANGED
@@ -10,12 +10,12 @@ const g = require('strong-globalize')();
10
10
 
11
11
  module.exports = function logToConsole(req, err) {
12
12
  if (!Array.isArray(err)) {
13
- g.error('Unhandled error for request %s %s: %s',
13
+ g.error('Request %s %s failed: %s',
14
14
  req.method, req.url, err.stack || err);
15
15
  return;
16
16
  }
17
17
 
18
- const errMsg = g.f('Unhandled array of errors for request %s %s\n',
18
+ const errMsg = g.f('Request %s %s failed with multiple errors:\n',
19
19
  req.method, req.url);
20
20
  const errors = err.map(formatError).join('\n');
21
21
  console.error(errMsg, errors);
package/package.json CHANGED
@@ -2,13 +2,13 @@
2
2
  "name": "strong-error-handler",
3
3
  "description": "Error handler for use in development and production environments.",
4
4
  "license": "MIT",
5
- "version": "3.5.0",
5
+ "version": "4.0.1",
6
6
  "engines": {
7
7
  "node": ">=10"
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/strongloop/strong-error-handler.git"
11
+ "url": "https://github.com/loopbackio/strong-error-handler.git"
12
12
  },
13
13
  "main": "lib/handler.js",
14
14
  "scripts": {
@@ -17,30 +17,26 @@
17
17
  "posttest": "npm run lint"
18
18
  },
19
19
  "dependencies": {
20
- "@types/express": "^4.16.0",
21
- "accepts": "^1.3.3",
22
- "debug": "^4.1.1",
23
- "ejs": "^3.1.3",
24
- "fast-safe-stringify": "^2.0.6",
25
- "http-status": "^1.1.2",
26
- "js2xmlparser": "^4.0.0",
27
- "strong-globalize": "^6.0.1"
20
+ "accepts": "^1.3.8",
21
+ "debug": "^4.3.4",
22
+ "ejs": "^3.1.8",
23
+ "fast-safe-stringify": "^2.1.1",
24
+ "http-status": "^1.5.3",
25
+ "js2xmlparser": "^4.0.2",
26
+ "strong-globalize": "^6.0.5"
28
27
  },
29
28
  "devDependencies": {
30
- "chai": "^4.1.2",
31
- "eslint": "^7.0.0",
29
+ "@commitlint/config-conventional": "^17.2.0",
30
+ "@types/express": "^4.17.14",
31
+ "chai": "^4.3.7",
32
+ "eslint": "^8.27.0",
32
33
  "eslint-config-loopback": "^13.1.0",
33
- "express": "^4.16.3",
34
- "mocha": "^7.1.2",
35
- "supertest": "^4.0.2"
34
+ "express": "^4.18.2",
35
+ "mocha": "^10.1.0",
36
+ "supertest": "^6.3.1"
36
37
  },
37
38
  "browser": {
38
39
  "strong-error-handler": false
39
40
  },
40
- "ci": {
41
- "downstreamIgnoreList": [
42
- "dashboard-controller"
43
- ]
44
- },
45
41
  "author": "IBM Corp."
46
42
  }
package/renovate.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": [
3
+ "github>loopbackio/cicd//shared-configs/renovate/base"
4
+ ]
5
+ }