@feathersjs/koa 5.0.0-pre.30 → 5.0.0-pre.32
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/CHANGELOG.md +16 -0
- package/lib/handlers.js +2 -2
- package/lib/handlers.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/package.json +15 -13
- package/src/handlers.ts +3 -3
- package/src/index.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [5.0.0-pre.32](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.31...v5.0.0-pre.32) (2022-10-26)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **transports:** Add remaining middleware for generated apps to Koa and Express ([#2796](https://github.com/feathersjs/feathers/issues/2796)) ([0d5781a](https://github.com/feathersjs/feathers/commit/0d5781a5c72a0cbb2ec8211bfa099f0aefe115a2))
|
|
11
|
+
|
|
12
|
+
# [5.0.0-pre.31](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.30...v5.0.0-pre.31) (2022-10-12)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- **koa:** Only set error code for Feathers errors ([#2793](https://github.com/feathersjs/feathers/issues/2793)) ([d3ee41e](https://github.com/feathersjs/feathers/commit/d3ee41e27b0ea5d29b344d6584ab03e48d16e2b4))
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- **cli:** Generate full client test suite and improve typed client ([#2788](https://github.com/feathersjs/feathers/issues/2788)) ([57119b6](https://github.com/feathersjs/feathers/commit/57119b6bb2797f7297cf054268a248c093ecd538))
|
|
21
|
+
|
|
6
22
|
# [5.0.0-pre.30](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.29...v5.0.0-pre.30) (2022-10-07)
|
|
7
23
|
|
|
8
24
|
### Bug Fixes
|
package/lib/handlers.js
CHANGED
|
@@ -6,11 +6,11 @@ const errorHandler = () => async (ctx, next) => {
|
|
|
6
6
|
try {
|
|
7
7
|
await next();
|
|
8
8
|
if (ctx.body === undefined) {
|
|
9
|
-
throw new errors_1.NotFound(
|
|
9
|
+
throw new errors_1.NotFound(`Path ${ctx.path} not found`);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
catch (error) {
|
|
13
|
-
ctx.response.status = error.code
|
|
13
|
+
ctx.response.status = error instanceof errors_1.FeathersError ? error.code : 500;
|
|
14
14
|
ctx.body =
|
|
15
15
|
typeof error.toJSON === 'function'
|
|
16
16
|
? error.toJSON()
|
package/lib/handlers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../src/handlers.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../src/handlers.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAGrD,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,KAAK,EAAE,GAAuB,EAAE,IAAwB,EAAE,EAAE;IAC5F,IAAI;QACF,MAAM,IAAI,EAAE,CAAA;QAEZ,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS,EAAE;YAC1B,MAAM,IAAI,iBAAQ,CAAC,QAAQ,GAAG,CAAC,IAAI,YAAY,CAAC,CAAA;SACjD;KACF;IAAC,OAAO,KAAU,EAAE;QACnB,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,KAAK,YAAY,sBAAa,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAA;QACvE,GAAG,CAAC,IAAI;YACN,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU;gBAChC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;gBAChB,CAAC,CAAC;oBACE,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB,CAAA;KACR;AACH,CAAC,CAAA;AAhBY,QAAA,YAAY,gBAgBxB"}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import Koa from 'koa';
|
|
|
2
2
|
import { Application as FeathersApplication } from '@feathersjs/feathers';
|
|
3
3
|
import bodyParser from 'koa-bodyparser';
|
|
4
4
|
import cors from '@koa/cors';
|
|
5
|
+
import serveStatic from 'koa-static';
|
|
5
6
|
import { Application } from './declarations';
|
|
6
|
-
export { Koa, bodyParser, cors };
|
|
7
|
+
export { Koa, bodyParser, cors, serveStatic };
|
|
7
8
|
export * from './authentication';
|
|
8
9
|
export * from './declarations';
|
|
9
10
|
export * from './handlers';
|
package/lib/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.koa = exports.cors = exports.bodyParser = exports.Koa = void 0;
|
|
20
|
+
exports.koa = exports.serveStatic = exports.cors = exports.bodyParser = exports.Koa = void 0;
|
|
21
21
|
const koa_1 = __importDefault(require("koa"));
|
|
22
22
|
exports.Koa = koa_1.default;
|
|
23
23
|
const koa_qs_1 = __importDefault(require("koa-qs"));
|
|
@@ -27,6 +27,8 @@ const koa_bodyparser_1 = __importDefault(require("koa-bodyparser"));
|
|
|
27
27
|
exports.bodyParser = koa_bodyparser_1.default;
|
|
28
28
|
const cors_1 = __importDefault(require("@koa/cors"));
|
|
29
29
|
exports.cors = cors_1.default;
|
|
30
|
+
const koa_static_1 = __importDefault(require("koa-static"));
|
|
31
|
+
exports.serveStatic = koa_static_1.default;
|
|
30
32
|
__exportStar(require("./authentication"), exports);
|
|
31
33
|
__exportStar(require("./declarations"), exports);
|
|
32
34
|
__exportStar(require("./handlers"), exports);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,8CAAqB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,8CAAqB;AAWZ,cAXF,aAAG,CAWE;AAVZ,oDAA0B;AAE1B,qEAAuD;AACvD,iDAAiD;AACjD,oEAAuC;AAMzB,qBANP,wBAAU,CAMO;AALxB,qDAA4B;AAKF,eALnB,cAAI,CAKmB;AAJ9B,4DAAoC;AAIJ,sBAJzB,oBAAW,CAIyB;AAC3C,mDAAgC;AAChC,iDAA8B;AAC9B,6CAA0B;AAC1B,yCAAsB;AAEtB,MAAM,KAAK,GAAG,IAAA,qBAAW,EAAC,iBAAiB,CAAC,CAAA;AAE5C,SAAgB,GAAG,CACjB,WAAuC,EACvC,SAAc,IAAI,aAAG,EAAE;IAEvB,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,MAAa,CAAA;KACrB;IAED,IAAI,OAAO,WAAW,CAAC,KAAK,KAAK,UAAU,EAAE;QAC3C,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAA;KAClF;IAED,MAAM,GAAG,GAAG,WAAuC,CAAA;IACnD,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;IACjD,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,WAAW,CAAA;IAEpE,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;QACjB,GAAG,CAAC,QAAiC,EAAE,GAAG,IAAW;YACnD,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;gBAChC,OAAQ,WAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,QA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AM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3C,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;QACpC,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;QAEpC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE;YAClD,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;SAC1C;IACH,CAAC,CAAC,CAAA;IAEF,IAAA,gBAAK,EAAC,GAAU,CAAC,CAAA;IAEjB,2BAA2B;IAC3B,GAAG,CAAC,KAAK,GAAG,WAAW,CAAC,KAAY,CAAA;IACpC,GAAG,CAAC,QAAQ,GAAG,WAAW,CAAC,QAAe,CAAA;IAE1C,GAAG,CAAC,SAAS,CAAC,IAAA,2BAAO,GAAS,CAAC,CAAA;IAC/B,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACpB,GAAG,CAAC,QAAQ,GAAG,EAAE,GAAG,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;QACpD,OAAO,IAAI,EAAE,CAAA;IACf,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC;AA7ED,kBA6EC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feathersjs/koa",
|
|
3
3
|
"description": "Feathers KoaJS framework bindings and REST provider",
|
|
4
|
-
"version": "5.0.0-pre.
|
|
4
|
+
"version": "5.0.0-pre.32",
|
|
5
5
|
"homepage": "https://feathersjs.com",
|
|
6
6
|
"main": "lib/",
|
|
7
7
|
"types": "lib/",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"url": "https://github.com/feathersjs/feathers/issues"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
28
|
+
"node": ">= 14"
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
|
31
31
|
"CHANGELOG.md",
|
|
@@ -49,25 +49,27 @@
|
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@feathersjs/authentication": "^5.0.0-pre.
|
|
53
|
-
"@feathersjs/commons": "^5.0.0-pre.
|
|
54
|
-
"@feathersjs/errors": "^5.0.0-pre.
|
|
55
|
-
"@feathersjs/transport-commons": "^5.0.0-pre.
|
|
56
|
-
"@koa/cors": "^
|
|
52
|
+
"@feathersjs/authentication": "^5.0.0-pre.32",
|
|
53
|
+
"@feathersjs/commons": "^5.0.0-pre.32",
|
|
54
|
+
"@feathersjs/errors": "^5.0.0-pre.32",
|
|
55
|
+
"@feathersjs/transport-commons": "^5.0.0-pre.32",
|
|
56
|
+
"@koa/cors": "^4.0.0",
|
|
57
57
|
"@types/koa": "^2.13.5",
|
|
58
58
|
"@types/koa-bodyparser": "^4.3.8",
|
|
59
59
|
"@types/koa-qs": "^2.0.0",
|
|
60
|
+
"@types/koa-static": "^4.0.2",
|
|
60
61
|
"@types/koa__cors": "^3.3.0",
|
|
61
62
|
"koa": "^2.13.4",
|
|
62
63
|
"koa-bodyparser": "^4.3.0",
|
|
63
64
|
"koa-compose": "^4.1.0",
|
|
64
|
-
"koa-qs": "^3.0.0"
|
|
65
|
+
"koa-qs": "^3.0.0",
|
|
66
|
+
"koa-static": "^5.0.0"
|
|
65
67
|
},
|
|
66
68
|
"devDependencies": {
|
|
67
|
-
"@feathersjs/authentication-local": "^5.0.0-pre.
|
|
68
|
-
"@feathersjs/feathers": "^5.0.0-pre.
|
|
69
|
-
"@feathersjs/memory": "^5.0.0-pre.
|
|
70
|
-
"@feathersjs/tests": "^5.0.0-pre.
|
|
69
|
+
"@feathersjs/authentication-local": "^5.0.0-pre.32",
|
|
70
|
+
"@feathersjs/feathers": "^5.0.0-pre.32",
|
|
71
|
+
"@feathersjs/memory": "^5.0.0-pre.32",
|
|
72
|
+
"@feathersjs/tests": "^5.0.0-pre.32",
|
|
71
73
|
"@types/koa-compose": "^3.2.5",
|
|
72
74
|
"@types/mocha": "^10.0.0",
|
|
73
75
|
"@types/node": "^18.8.2",
|
|
@@ -77,5 +79,5 @@
|
|
|
77
79
|
"ts-node": "^10.9.1",
|
|
78
80
|
"typescript": "^4.8.4"
|
|
79
81
|
},
|
|
80
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "b405e205fc6d9fbd42b42c7a3f30ea4bf33d121d"
|
|
81
83
|
}
|
package/src/handlers.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NotFound } from '@feathersjs/errors'
|
|
1
|
+
import { FeathersError, NotFound } from '@feathersjs/errors'
|
|
2
2
|
import { FeathersKoaContext } from './declarations'
|
|
3
3
|
|
|
4
4
|
export const errorHandler = () => async (ctx: FeathersKoaContext, next: () => Promise<any>) => {
|
|
@@ -6,10 +6,10 @@ export const errorHandler = () => async (ctx: FeathersKoaContext, next: () => Pr
|
|
|
6
6
|
await next()
|
|
7
7
|
|
|
8
8
|
if (ctx.body === undefined) {
|
|
9
|
-
throw new NotFound(
|
|
9
|
+
throw new NotFound(`Path ${ctx.path} not found`)
|
|
10
10
|
}
|
|
11
11
|
} catch (error: any) {
|
|
12
|
-
ctx.response.status = error.code
|
|
12
|
+
ctx.response.status = error instanceof FeathersError ? error.code : 500
|
|
13
13
|
ctx.body =
|
|
14
14
|
typeof error.toJSON === 'function'
|
|
15
15
|
? error.toJSON()
|
package/src/index.ts
CHANGED
|
@@ -5,10 +5,11 @@ import { routing } from '@feathersjs/transport-commons'
|
|
|
5
5
|
import { createDebug } from '@feathersjs/commons'
|
|
6
6
|
import bodyParser from 'koa-bodyparser'
|
|
7
7
|
import cors from '@koa/cors'
|
|
8
|
+
import serveStatic from 'koa-static'
|
|
8
9
|
|
|
9
10
|
import { Application } from './declarations'
|
|
10
11
|
|
|
11
|
-
export { Koa, bodyParser, cors }
|
|
12
|
+
export { Koa, bodyParser, cors, serveStatic }
|
|
12
13
|
export * from './authentication'
|
|
13
14
|
export * from './declarations'
|
|
14
15
|
export * from './handlers'
|