@feathersjs/koa 5.0.0-pre.28 → 5.0.0-pre.30

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 CHANGED
@@ -3,238 +3,147 @@
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.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03)
7
-
6
+ # [5.0.0-pre.30](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.29...v5.0.0-pre.30) (2022-10-07)
8
7
 
9
8
  ### Bug Fixes
10
9
 
11
- * **cli:** Improve generated application and client ([#2701](https://github.com/feathersjs/feathers/issues/2701)) ([bd55ffb](https://github.com/feathersjs/feathers/commit/bd55ffb812e89bf215f4515e7f137656ea888c3f))
10
+ - **core:** Ensure setup and teardown can be overriden and maintain hook functionality ([#2779](https://github.com/feathersjs/feathers/issues/2779)) ([ab580cb](https://github.com/feathersjs/feathers/commit/ab580cbcaa68d19144d86798c13bf564f9d424a6))
12
11
 
12
+ ### Features
13
13
 
14
+ - **core:** Allow to unregister services at runtime ([#2756](https://github.com/feathersjs/feathers/issues/2756)) ([d16601f](https://github.com/feathersjs/feathers/commit/d16601f2277dca5357866ffdefba2a611f6dc7fa))
14
15
 
16
+ # [5.0.0-pre.29](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.28...v5.0.0-pre.29) (2022-09-16)
15
17
 
18
+ ### Features
16
19
 
17
- # [5.0.0-pre.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13)
20
+ - Add CORS support to oAuth, Express, Koa and generated application ([#2744](https://github.com/feathersjs/feathers/issues/2744)) ([fd218f2](https://github.com/feathersjs/feathers/commit/fd218f289f8ca4c101e9938e8683e2efef6e8131))
18
21
 
19
- **Note:** Version bump only for package @feathersjs/koa
22
+ # [5.0.0-pre.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03)
20
23
 
24
+ ### Bug Fixes
21
25
 
26
+ - **cli:** Improve generated application and client ([#2701](https://github.com/feathersjs/feathers/issues/2701)) ([bd55ffb](https://github.com/feathersjs/feathers/commit/bd55ffb812e89bf215f4515e7f137656ea888c3f))
22
27
 
28
+ # [5.0.0-pre.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13)
23
29
 
30
+ **Note:** Version bump only for package @feathersjs/koa
24
31
 
25
32
  # [5.0.0-pre.26](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.25...v5.0.0-pre.26) (2022-06-22)
26
33
 
27
34
  **Note:** Version bump only for package @feathersjs/koa
28
35
 
29
-
30
-
31
-
32
-
33
36
  # [5.0.0-pre.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22)
34
37
 
35
38
  **Note:** Version bump only for package @feathersjs/koa
36
39
 
37
-
38
-
39
-
40
-
41
40
  # [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21)
42
41
 
43
-
44
42
  ### Features
45
43
 
46
- * **cli:** Add support for JavaScript to the new CLI ([#2668](https://github.com/feathersjs/feathers/issues/2668)) ([ebac587](https://github.com/feathersjs/feathers/commit/ebac587f7d00dc7607c3f546352d79f79b89a5d4))
47
- * **cli:** Initial Feathers v5 CLI and Pinion generator ([#2578](https://github.com/feathersjs/feathers/issues/2578)) ([7f59ae7](https://github.com/feathersjs/feathers/commit/7f59ae7f1471895ba8a82aa4702f1a23f71b7682))
48
-
49
-
50
-
51
-
44
+ - **cli:** Add support for JavaScript to the new CLI ([#2668](https://github.com/feathersjs/feathers/issues/2668)) ([ebac587](https://github.com/feathersjs/feathers/commit/ebac587f7d00dc7607c3f546352d79f79b89a5d4))
45
+ - **cli:** Initial Feathers v5 CLI and Pinion generator ([#2578](https://github.com/feathersjs/feathers/issues/2578)) ([7f59ae7](https://github.com/feathersjs/feathers/commit/7f59ae7f1471895ba8a82aa4702f1a23f71b7682))
52
46
 
53
47
  # [5.0.0-pre.23](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.22...v5.0.0-pre.23) (2022-06-06)
54
48
 
55
49
  **Note:** Version bump only for package @feathersjs/koa
56
50
 
57
-
58
-
59
-
60
-
61
51
  # [5.0.0-pre.22](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.21...v5.0.0-pre.22) (2022-05-24)
62
52
 
63
53
  **Note:** Version bump only for package @feathersjs/koa
64
54
 
65
-
66
-
67
-
68
-
69
55
  # [5.0.0-pre.21](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.20...v5.0.0-pre.21) (2022-05-23)
70
56
 
71
57
  **Note:** Version bump only for package @feathersjs/koa
72
58
 
73
-
74
-
75
-
76
-
77
59
  # [5.0.0-pre.20](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.19...v5.0.0-pre.20) (2022-05-04)
78
60
 
79
-
80
61
  ### Bug Fixes
81
62
 
82
- * **dependencies:** Lock monorepo package version numbers ([#2623](https://github.com/feathersjs/feathers/issues/2623)) ([5640c10](https://github.com/feathersjs/feathers/commit/5640c1020cc139994e695d658c08bad3494db507))
83
-
84
-
85
-
86
-
63
+ - **dependencies:** Lock monorepo package version numbers ([#2623](https://github.com/feathersjs/feathers/issues/2623)) ([5640c10](https://github.com/feathersjs/feathers/commit/5640c1020cc139994e695d658c08bad3494db507))
87
64
 
88
65
  # [5.0.0-pre.19](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.18...v5.0.0-pre.19) (2022-05-01)
89
66
 
90
67
  **Note:** Version bump only for package @feathersjs/koa
91
68
 
92
-
93
-
94
-
95
-
96
69
  # [5.0.0-pre.18](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.17...v5.0.0-pre.18) (2022-04-11)
97
70
 
98
-
99
71
  ### Features
100
72
 
101
- * **core:** Add app.teardown functionality ([#2570](https://github.com/feathersjs/feathers/issues/2570)) ([fcdf524](https://github.com/feathersjs/feathers/commit/fcdf524ae1995bb59265d39f12e98b7794bed023))
102
- * **core:** Finalize app.teardown() functionality ([#2584](https://github.com/feathersjs/feathers/issues/2584)) ([1a166f3](https://github.com/feathersjs/feathers/commit/1a166f3ded811ecacf0ae8cb67880bc9fa2eeafa))
103
- * **transport-commons:** add `context.http.response` ([#2524](https://github.com/feathersjs/feathers/issues/2524)) ([5bc9d44](https://github.com/feathersjs/feathers/commit/5bc9d447043c2e2b742c73ed28ecf3b3264dd9e5))
104
-
105
-
106
-
107
-
73
+ - **core:** Add app.teardown functionality ([#2570](https://github.com/feathersjs/feathers/issues/2570)) ([fcdf524](https://github.com/feathersjs/feathers/commit/fcdf524ae1995bb59265d39f12e98b7794bed023))
74
+ - **core:** Finalize app.teardown() functionality ([#2584](https://github.com/feathersjs/feathers/issues/2584)) ([1a166f3](https://github.com/feathersjs/feathers/commit/1a166f3ded811ecacf0ae8cb67880bc9fa2eeafa))
75
+ - **transport-commons:** add `context.http.response` ([#2524](https://github.com/feathersjs/feathers/issues/2524)) ([5bc9d44](https://github.com/feathersjs/feathers/commit/5bc9d447043c2e2b742c73ed28ecf3b3264dd9e5))
108
76
 
109
77
  # [5.0.0-pre.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15)
110
78
 
111
79
  **Note:** Version bump only for package @feathersjs/koa
112
80
 
113
-
114
-
115
-
116
-
117
81
  # [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12)
118
82
 
119
-
120
83
  ### Features
121
84
 
122
- * **express, koa:** make transports similar ([#2486](https://github.com/feathersjs/feathers/issues/2486)) ([26aa937](https://github.com/feathersjs/feathers/commit/26aa937c114fb8596dfefc599b1f53cead69c159))
123
-
124
-
125
-
126
-
85
+ - **express, koa:** make transports similar ([#2486](https://github.com/feathersjs/feathers/issues/2486)) ([26aa937](https://github.com/feathersjs/feathers/commit/26aa937c114fb8596dfefc599b1f53cead69c159))
127
86
 
128
87
  # [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27)
129
88
 
130
-
131
89
  ### Bug Fixes
132
90
 
133
- * **typescript:** Overall typing improvements ([#2478](https://github.com/feathersjs/feathers/issues/2478)) ([b8eb804](https://github.com/feathersjs/feathers/commit/b8eb804158556d9651a8607e3c3fda15e0bfd110))
134
-
91
+ - **typescript:** Overall typing improvements ([#2478](https://github.com/feathersjs/feathers/issues/2478)) ([b8eb804](https://github.com/feathersjs/feathers/commit/b8eb804158556d9651a8607e3c3fda15e0bfd110))
135
92
 
136
93
  ### Features
137
94
 
138
- * **core:** add `context.http` and move `statusCode` there ([#2496](https://github.com/feathersjs/feathers/issues/2496)) ([b701bf7](https://github.com/feathersjs/feathers/commit/b701bf77fb83048aa1dffa492b3d77dd53f7b72b))
139
-
140
-
141
-
142
-
95
+ - **core:** add `context.http` and move `statusCode` there ([#2496](https://github.com/feathersjs/feathers/issues/2496)) ([b701bf7](https://github.com/feathersjs/feathers/commit/b701bf77fb83048aa1dffa492b3d77dd53f7b72b))
143
96
 
144
97
  # [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13)
145
98
 
146
99
  **Note:** Version bump only for package @feathersjs/koa
147
100
 
148
-
149
-
150
-
151
-
152
101
  # [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13)
153
102
 
154
103
  **Note:** Version bump only for package @feathersjs/koa
155
104
 
156
-
157
-
158
-
159
-
160
105
  # [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12)
161
106
 
162
107
  **Note:** Version bump only for package @feathersjs/koa
163
108
 
164
-
165
-
166
-
167
-
168
109
  # [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06)
169
110
 
170
111
  **Note:** Version bump only for package @feathersjs/koa
171
112
 
172
-
173
-
174
-
175
-
176
113
  # [5.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.9...v5.0.0-pre.10) (2021-09-19)
177
114
 
178
115
  **Note:** Version bump only for package @feathersjs/koa
179
116
 
180
-
181
-
182
-
183
-
184
117
  # [5.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.8...v5.0.0-pre.9) (2021-08-09)
185
118
 
186
119
  **Note:** Version bump only for package @feathersjs/koa
187
120
 
188
-
189
-
190
-
191
-
192
121
  # [5.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.7...v5.0.0-pre.8) (2021-08-09)
193
122
 
194
123
  **Note:** Version bump only for package @feathersjs/koa
195
124
 
196
-
197
-
198
-
199
-
200
125
  # [5.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.6...v5.0.0-pre.7) (2021-08-09)
201
126
 
202
127
  **Note:** Version bump only for package @feathersjs/koa
203
128
 
204
-
205
-
206
-
207
-
208
129
  # [5.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.5...v5.0.0-pre.6) (2021-08-08)
209
130
 
210
-
211
131
  ### Bug Fixes
212
132
 
213
- * **koa:** Throw a NotFound Feathers error on missing paths ([#2415](https://github.com/feathersjs/feathers/issues/2415)) ([e013f98](https://github.com/feathersjs/feathers/commit/e013f98315d550ced6eacffd615c61bb0912b4ba))
214
-
215
-
216
-
217
-
133
+ - **koa:** Throw a NotFound Feathers error on missing paths ([#2415](https://github.com/feathersjs/feathers/issues/2415)) ([e013f98](https://github.com/feathersjs/feathers/commit/e013f98315d550ced6eacffd615c61bb0912b4ba))
218
134
 
219
135
  # [5.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.4...v5.0.0-pre.5) (2021-06-23)
220
136
 
221
-
222
137
  ### Bug Fixes
223
138
 
224
- * **koa:** Use extended query parser for compatibility ([#2397](https://github.com/feathersjs/feathers/issues/2397)) ([b2944ba](https://github.com/feathersjs/feathers/commit/b2944bac3ec6d5ecc80dc518cd4e58093692db74))
225
-
139
+ - **koa:** Use extended query parser for compatibility ([#2397](https://github.com/feathersjs/feathers/issues/2397)) ([b2944ba](https://github.com/feathersjs/feathers/commit/b2944bac3ec6d5ecc80dc518cd4e58093692db74))
226
140
 
227
141
  ### Features
228
142
 
229
- * **adapter-commons:** Add support for params.adapter option and move memory adapter to @feathersjs/memory ([#2367](https://github.com/feathersjs/feathers/issues/2367)) ([a43e7da](https://github.com/feathersjs/feathers/commit/a43e7da22b6b981a96d1321736ea9a0cb924fb4f))
230
-
231
-
232
-
233
-
143
+ - **adapter-commons:** Add support for params.adapter option and move memory adapter to @feathersjs/memory ([#2367](https://github.com/feathersjs/feathers/issues/2367)) ([a43e7da](https://github.com/feathersjs/feathers/commit/a43e7da22b6b981a96d1321736ea9a0cb924fb4f))
234
144
 
235
145
  # [5.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.3...v5.0.0-pre.4) (2021-05-13)
236
146
 
237
-
238
147
  ### Features
239
148
 
240
- * **koa:** KoaJS transport adapter ([#2315](https://github.com/feathersjs/feathers/issues/2315)) ([2554b57](https://github.com/feathersjs/feathers/commit/2554b57cf05731df58feeba9c12faab18e442107))
149
+ - **koa:** KoaJS transport adapter ([#2315](https://github.com/feathersjs/feathers/issues/2315)) ([2554b57](https://github.com/feathersjs/feathers/commit/2554b57cf05731df58feeba9c12faab18e442107))
package/lib/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import Koa from 'koa';
2
2
  import { Application as FeathersApplication } from '@feathersjs/feathers';
3
3
  import bodyParser from 'koa-bodyparser';
4
+ import cors from '@koa/cors';
4
5
  import { Application } from './declarations';
5
- export { Koa, bodyParser };
6
+ export { Koa, bodyParser, cors };
6
7
  export * from './authentication';
7
8
  export * from './declarations';
8
9
  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.bodyParser = exports.Koa = void 0;
20
+ exports.koa = 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"));
@@ -25,6 +25,8 @@ const transport_commons_1 = require("@feathersjs/transport-commons");
25
25
  const commons_1 = require("@feathersjs/commons");
26
26
  const koa_bodyparser_1 = __importDefault(require("koa-bodyparser"));
27
27
  exports.bodyParser = koa_bodyparser_1.default;
28
+ const cors_1 = __importDefault(require("@koa/cors"));
29
+ exports.cors = cors_1.default;
28
30
  __exportStar(require("./authentication"), exports);
29
31
  __exportStar(require("./declarations"), exports);
30
32
  __exportStar(require("./handlers"), exports);
@@ -78,6 +80,9 @@ function koa(feathersApp, koaApp = new koa_1.default()) {
78
80
  }
79
81
  });
80
82
  (0, koa_qs_1.default)(app);
83
+ // This reinitializes hooks
84
+ app.setup = feathersApp.setup;
85
+ app.teardown = feathersApp.teardown;
81
86
  app.configure((0, transport_commons_1.routing)());
82
87
  app.use((ctx, next) => {
83
88
  ctx.feathers = { ...ctx.feathers, provider: 'rest' };
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,8CAAqB;AAQZ,cARF,aAAG,CAQE;AAPZ,oDAA0B;AAE1B,qEAAuD;AACvD,iDAAiD;AACjD,oEAAuC;AAGzB,qBAHP,wBAAU,CAGO;AACxB,mDAAgC;AAChC,iDAA8B;AAC9B,6CAA0B;AAC1B,yCAAsB;AAEtB,M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,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/lib/rest.js CHANGED
@@ -15,6 +15,7 @@ const serviceMiddleware = () => {
15
15
  return async (ctx, next) => {
16
16
  const { query, headers, path, body: data, method: httpMethod } = ctx.request;
17
17
  const methodOverride = ctx.request.headers[transport_commons_1.http.METHOD_HEADER];
18
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
18
19
  const { service, params: { __id: id = null, ...route } = {} } = ctx.lookup;
19
20
  const method = transport_commons_1.http.getServiceMethod(httpMethod, id, methodOverride);
20
21
  const { methods } = (0, feathers_1.getServiceOptions)(service);
package/lib/rest.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"rest.js","sourceRoot":"","sources":["../src/rest.ts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E,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAA;YACtF,MAAM,UAAU,GAAG,IAAA,qBAAO,EAAC,WAAW,CAAC,CAAA;YAEvC,OAAO,CAAC,GAAG,KAAX,OAAO,CAAC,GAAG,GAAK,EAAE,EAAA;YAClB,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,UAAU,CAAA;QACnC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC,CAAA;AApBY,QAAA,IAAI,QAoBhB"}
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.28",
4
+ "version": "5.0.0-pre.30",
5
5
  "homepage": "https://feathersjs.com",
6
6
  "main": "lib/",
7
7
  "types": "lib/",
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "scripts": {
40
40
  "prepublish": "npm run compile",
41
- "pack": "npm pack --pack-destination ../cli/test",
41
+ "pack": "npm pack --pack-destination ../cli/test/build",
42
42
  "compile": "shx rm -rf lib/ && tsc && npm run pack",
43
43
  "test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
44
44
  },
@@ -49,31 +49,33 @@
49
49
  "access": "public"
50
50
  },
51
51
  "dependencies": {
52
- "@feathersjs/authentication": "^5.0.0-pre.28",
53
- "@feathersjs/commons": "^5.0.0-pre.28",
54
- "@feathersjs/errors": "^5.0.0-pre.28",
55
- "@feathersjs/transport-commons": "^5.0.0-pre.28",
52
+ "@feathersjs/authentication": "^5.0.0-pre.30",
53
+ "@feathersjs/commons": "^5.0.0-pre.30",
54
+ "@feathersjs/errors": "^5.0.0-pre.30",
55
+ "@feathersjs/transport-commons": "^5.0.0-pre.30",
56
+ "@koa/cors": "^3.4.2",
56
57
  "@types/koa": "^2.13.5",
57
- "@types/koa-bodyparser": "^4.3.7",
58
+ "@types/koa-bodyparser": "^4.3.8",
58
59
  "@types/koa-qs": "^2.0.0",
60
+ "@types/koa__cors": "^3.3.0",
59
61
  "koa": "^2.13.4",
60
62
  "koa-bodyparser": "^4.3.0",
61
63
  "koa-compose": "^4.1.0",
62
64
  "koa-qs": "^3.0.0"
63
65
  },
64
66
  "devDependencies": {
65
- "@feathersjs/authentication-local": "^5.0.0-pre.28",
66
- "@feathersjs/feathers": "^5.0.0-pre.28",
67
- "@feathersjs/memory": "^5.0.0-pre.28",
68
- "@feathersjs/tests": "^5.0.0-pre.28",
67
+ "@feathersjs/authentication-local": "^5.0.0-pre.30",
68
+ "@feathersjs/feathers": "^5.0.0-pre.30",
69
+ "@feathersjs/memory": "^5.0.0-pre.30",
70
+ "@feathersjs/tests": "^5.0.0-pre.30",
69
71
  "@types/koa-compose": "^3.2.5",
70
- "@types/mocha": "^9.1.1",
71
- "@types/node": "^18.6.3",
72
+ "@types/mocha": "^10.0.0",
73
+ "@types/node": "^18.8.2",
72
74
  "axios": "^0.27.2",
73
75
  "mocha": "^10.0.0",
74
76
  "shx": "^0.3.4",
75
77
  "ts-node": "^10.9.1",
76
- "typescript": "^4.7.4"
78
+ "typescript": "^4.8.4"
77
79
  },
78
- "gitHead": "bf8e54fddc14d688ba8f505e72c9630a71656ff1"
80
+ "gitHead": "b535c91197f4b997520e0a0e608793eeba791931"
79
81
  }
package/src/index.ts CHANGED
@@ -4,9 +4,11 @@ import { Application as FeathersApplication } from '@feathersjs/feathers'
4
4
  import { routing } from '@feathersjs/transport-commons'
5
5
  import { createDebug } from '@feathersjs/commons'
6
6
  import bodyParser from 'koa-bodyparser'
7
+ import cors from '@koa/cors'
8
+
7
9
  import { Application } from './declarations'
8
10
 
9
- export { Koa, bodyParser }
11
+ export { Koa, bodyParser, cors }
10
12
  export * from './authentication'
11
13
  export * from './declarations'
12
14
  export * from './handlers'
@@ -80,6 +82,10 @@ export function koa<S = any, C = any>(
80
82
 
81
83
  koaQs(app as any)
82
84
 
85
+ // This reinitializes hooks
86
+ app.setup = feathersApp.setup as any
87
+ app.teardown = feathersApp.teardown as any
88
+
83
89
  app.configure(routing() as any)
84
90
  app.use((ctx, next) => {
85
91
  ctx.feathers = { ...ctx.feathers, provider: 'rest' }
package/src/rest.ts CHANGED
@@ -14,6 +14,7 @@ const serviceMiddleware = (): Middleware => {
14
14
  const { query, headers, path, body: data, method: httpMethod } = ctx.request
15
15
  const methodOverride = ctx.request.headers[http.METHOD_HEADER] as string | undefined
16
16
 
17
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
17
18
  const { service, params: { __id: id = null, ...route } = {} } = ctx.lookup!
18
19
  const method = http.getServiceMethod(httpMethod, id, methodOverride)
19
20
  const { methods } = getServiceOptions(service)