@emoyly/problem 9.1.0 → 9.1.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.
- package/.forgejo/workflows/main-forgejo.yaml +35 -0
- package/dist/middleware/axios.d.ts +1 -1
- package/dist/middleware/express.d.ts +1 -1
- package/dist/problem.d.ts +1 -1
- package/dist/util/version.d.ts +1 -1
- package/dist/util/version.js +1 -1
- package/package.json +2 -7
- package/src/middleware/axios.ts +1 -1
- package/src/middleware/express.ts +1 -1
- package/src/util/version.ts +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
on: [push]
|
|
2
|
+
|
|
3
|
+
jobs:
|
|
4
|
+
main-forgejo:
|
|
5
|
+
runs-on: docker
|
|
6
|
+
env:
|
|
7
|
+
YARN_NPM_PUBLISH_REGISTRY: "https://git.auxera.net/api/packages/emoyly/npm"
|
|
8
|
+
AUXERA_GIT_PACKAGES_TOKEN: "${secrets.AUXERA_GIT_PACKAGES_TOKEN}"
|
|
9
|
+
steps:
|
|
10
|
+
- uses: actions/checkout@v5
|
|
11
|
+
|
|
12
|
+
- name: Use Node.js
|
|
13
|
+
uses: actions/setup-node@v6
|
|
14
|
+
with:
|
|
15
|
+
node-version: 24.x
|
|
16
|
+
cache: yarn
|
|
17
|
+
|
|
18
|
+
- name: Install packages
|
|
19
|
+
run: |
|
|
20
|
+
yarn install --immutable
|
|
21
|
+
env:
|
|
22
|
+
NODE_ENV: development
|
|
23
|
+
|
|
24
|
+
- name: Lint
|
|
25
|
+
run: yarn lint
|
|
26
|
+
|
|
27
|
+
- name: Build
|
|
28
|
+
run: yarn build
|
|
29
|
+
|
|
30
|
+
- name: Test
|
|
31
|
+
run: yarn test
|
|
32
|
+
|
|
33
|
+
- name: Publish
|
|
34
|
+
if: ${{ github.ref == 'refs/heads/main' }}
|
|
35
|
+
run: yarn publish
|
|
@@ -4,7 +4,7 @@ type InterceptorArray = [undefined, (error: unknown) => Promise<never>];
|
|
|
4
4
|
export declare class AxiosMiddleware extends MiddlewareBase {
|
|
5
5
|
readonly name = "axios";
|
|
6
6
|
constructor(options?: PartialMiddlewareOptions);
|
|
7
|
-
|
|
7
|
+
protected readonly interceptor: (error: unknown) => Promise<never>;
|
|
8
8
|
/**
|
|
9
9
|
* @example instance.interceptors.response.use(...middleware.use())
|
|
10
10
|
*/
|
|
@@ -3,7 +3,7 @@ import type { PartialMiddlewareOptions } from '../typings/middleware.js';
|
|
|
3
3
|
import { MiddlewareBase } from './base.js';
|
|
4
4
|
export declare class ExpressMiddleware extends MiddlewareBase {
|
|
5
5
|
readonly name = "express";
|
|
6
|
-
|
|
6
|
+
protected middleware: (error: unknown, req: Request, res: Response, next: NextFunction) => void;
|
|
7
7
|
/**
|
|
8
8
|
* This function applies the middleware to your Express application. Put this at the very end of your middleware/routes.
|
|
9
9
|
* If you want to also handle 404 errors, check out the notFound middleware function.
|
package/dist/problem.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare class Problem extends Error implements IProblem {
|
|
|
6
6
|
detail: string | undefined;
|
|
7
7
|
instance: string | undefined;
|
|
8
8
|
errorObject?: unknown;
|
|
9
|
-
readonly __problemVersion = "9.1.
|
|
9
|
+
readonly __problemVersion = "9.1.1";
|
|
10
10
|
data: unknown;
|
|
11
11
|
source?: string;
|
|
12
12
|
constructor(opts: ProblemOpts);
|
package/dist/util/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "9.1.
|
|
1
|
+
export declare const version = "9.1.1";
|
|
2
2
|
export declare const major: number;
|
package/dist/util/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '9.1.
|
|
1
|
+
export const version = '9.1.1';
|
|
2
2
|
export const major = Number(version.split('.')[0]);
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emoyly/problem",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.1",
|
|
4
4
|
"description": "A simple error library based around the RFC-7807 standard with optional support for different parsers and middleware.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"repository": "https://github.com/emoyly/problem",
|
|
8
7
|
"author": "Emil Petersen <emoyly@gmail.com>",
|
|
9
8
|
"license": "MIT",
|
|
10
9
|
"type": "module",
|
|
@@ -61,11 +60,7 @@
|
|
|
61
60
|
"optional": true
|
|
62
61
|
}
|
|
63
62
|
},
|
|
64
|
-
"packageManager": "yarn@4.
|
|
65
|
-
"publishConfig": {
|
|
66
|
-
"access": "public",
|
|
67
|
-
"registry": "https://registry.npmjs.org"
|
|
68
|
-
},
|
|
63
|
+
"packageManager": "yarn@4.12.0",
|
|
69
64
|
"exports": {
|
|
70
65
|
".": "./dist/index.js",
|
|
71
66
|
"./defaults": "./dist/defaults/index.js",
|
package/src/middleware/axios.ts
CHANGED
|
@@ -13,7 +13,7 @@ export class AxiosMiddleware extends MiddlewareBase {
|
|
|
13
13
|
}, options)
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
protected readonly interceptor = async (error: unknown) => {
|
|
17
17
|
const problems = this.parse(error)
|
|
18
18
|
this.emit(problems)
|
|
19
19
|
return Promise.reject(problems)
|
|
@@ -7,7 +7,7 @@ import { codes4xx } from '../defaults/index.js'
|
|
|
7
7
|
export class ExpressMiddleware extends MiddlewareBase {
|
|
8
8
|
readonly name = 'express'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
protected middleware = (error: unknown, req: Request, res: Response, next: NextFunction) => {
|
|
11
11
|
const problems = this.parse(error)
|
|
12
12
|
for (const problem of problems) {
|
|
13
13
|
if (!problem.instance) {
|
package/src/util/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '9.1.
|
|
1
|
+
export const version = '9.1.1'
|
|
2
2
|
export const major = Number(version.split('.')[0])
|