@feathersjs/feathers 5.0.0-pre.11 → 5.0.0-pre.17
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 +61 -0
- package/LICENSE +1 -1
- package/{readme.md → README.md} +1 -1
- package/lib/application.d.ts +11 -11
- package/lib/application.js +6 -6
- package/lib/application.js.map +1 -1
- package/lib/declarations.d.ts +51 -33
- package/lib/hooks/index.d.ts +3 -4
- package/lib/hooks/index.js +24 -12
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/regular.d.ts +12 -0
- package/lib/hooks/regular.js +169 -0
- package/lib/hooks/regular.js.map +1 -0
- package/lib/service.js +1 -0
- package/lib/service.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +10 -10
- package/src/application.ts +23 -23
- package/src/declarations.ts +52 -37
- package/src/hooks/index.ts +27 -14
- package/src/hooks/regular.ts +207 -0
- package/src/service.ts +1 -0
- package/src/version.ts +1 -1
- package/lib/hooks/legacy.d.ts +0 -7
- package/lib/hooks/legacy.js +0 -126
- package/lib/hooks/legacy.js.map +0 -1
- package/src/hooks/legacy.ts +0 -150
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,67 @@
|
|
|
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.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @feathersjs/feathers
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **express, koa:** make transports similar ([#2486](https://github.com/feathersjs/feathers/issues/2486)) ([26aa937](https://github.com/feathersjs/feathers/commit/26aa937c114fb8596dfefc599b1f53cead69c159))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **typescript:** Overall typing improvements ([#2478](https://github.com/feathersjs/feathers/issues/2478)) ([b8eb804](https://github.com/feathersjs/feathers/commit/b8eb804158556d9651a8607e3c3fda15e0bfd110))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
* **core:** add `context.http` and move `statusCode` there ([#2496](https://github.com/feathersjs/feathers/issues/2496)) ([b701bf7](https://github.com/feathersjs/feathers/commit/b701bf77fb83048aa1dffa492b3d77dd53f7b72b))
|
|
36
|
+
* **core:** Improve legacy hooks integration ([08c8b40](https://github.com/feathersjs/feathers/commit/08c8b40999bf3889c61a4d4fad97a2c4f78bafc9))
|
|
37
|
+
* **transport-commons:** Ability to register routes with custom params ([#2482](https://github.com/feathersjs/feathers/issues/2482)) ([497990a](https://github.com/feathersjs/feathers/commit/497990ae4a980e5a52a1f0f932db12cd0e6e254a))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13)
|
|
44
|
+
|
|
45
|
+
**Note:** Version bump only for package @feathersjs/feathers
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13)
|
|
52
|
+
|
|
53
|
+
**Note:** Version bump only for package @feathersjs/feathers
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
# [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12)
|
|
60
|
+
|
|
61
|
+
**Note:** Version bump only for package @feathersjs/feathers
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
6
67
|
# [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06)
|
|
7
68
|
|
|
8
69
|
|
package/LICENSE
CHANGED
package/{readme.md → README.md}
RENAMED
|
@@ -31,6 +31,6 @@ The [Feathers docs](http://docs.feathersjs.com) are loaded with awesome stuff an
|
|
|
31
31
|
|
|
32
32
|
## License
|
|
33
33
|
|
|
34
|
-
Copyright (c)
|
|
34
|
+
Copyright (c) 2022 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors)
|
|
35
35
|
|
|
36
36
|
Licensed under the [MIT license](LICENSE).
|
package/lib/application.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from './dependencies';
|
|
3
3
|
import { FeathersApplication, ServiceMixin, Service, ServiceOptions, ServiceInterface, Application, HookOptions, FeathersService, HookMap } from './declarations';
|
|
4
|
-
export declare class Feathers<
|
|
5
|
-
services:
|
|
6
|
-
settings:
|
|
7
|
-
mixins: ServiceMixin<Application<
|
|
4
|
+
export declare class Feathers<Services, Settings> extends EventEmitter implements FeathersApplication<Services, Settings> {
|
|
5
|
+
services: Services;
|
|
6
|
+
settings: Settings;
|
|
7
|
+
mixins: ServiceMixin<Application<Services, Settings>>[];
|
|
8
8
|
version: string;
|
|
9
9
|
_isSetup: boolean;
|
|
10
|
-
appHooks: HookMap<Application<
|
|
11
|
-
private
|
|
10
|
+
appHooks: HookMap<Application<Services, Settings>, any>;
|
|
11
|
+
private regularHooks;
|
|
12
12
|
constructor();
|
|
13
|
-
get<L extends keyof
|
|
14
|
-
set<L extends keyof
|
|
13
|
+
get<L extends keyof Settings & string>(name: L): Settings[L];
|
|
14
|
+
set<L extends keyof Settings & string>(name: L, value: Settings[L]): this;
|
|
15
15
|
configure(callback: (this: this, app: this) => void): this;
|
|
16
|
-
defaultService(location: string): ServiceInterface
|
|
17
|
-
service<L extends keyof
|
|
18
|
-
use<L extends keyof
|
|
16
|
+
defaultService(location: string): ServiceInterface;
|
|
17
|
+
service<L extends keyof Services & string>(location: L): FeathersService<this, keyof any extends keyof Services ? Service : Services[L]>;
|
|
18
|
+
use<L extends keyof Services & string>(path: L, service: keyof any extends keyof Services ? ServiceInterface | Application : Services[L], options?: ServiceOptions): this;
|
|
19
19
|
hooks(hookMap: HookOptions<this, any>): any;
|
|
20
20
|
setup(): Promise<this>;
|
|
21
21
|
}
|
package/lib/application.js
CHANGED
|
@@ -9,7 +9,7 @@ const dependencies_1 = require("./dependencies");
|
|
|
9
9
|
const events_1 = require("./events");
|
|
10
10
|
const index_1 = require("./hooks/index");
|
|
11
11
|
const service_1 = require("./service");
|
|
12
|
-
const
|
|
12
|
+
const regular_1 = require("./hooks/regular");
|
|
13
13
|
const debug = (0, dependencies_1.createDebug)('@feathersjs/feathers');
|
|
14
14
|
class Feathers extends dependencies_1.EventEmitter {
|
|
15
15
|
constructor() {
|
|
@@ -22,7 +22,7 @@ class Feathers extends dependencies_1.EventEmitter {
|
|
|
22
22
|
this.appHooks = {
|
|
23
23
|
[dependencies_1.HOOKS]: [events_1.eventHook]
|
|
24
24
|
};
|
|
25
|
-
this.
|
|
25
|
+
this.regularHooks = (0, regular_1.enableRegularHooks)(this);
|
|
26
26
|
}
|
|
27
27
|
get(name) {
|
|
28
28
|
return this.settings[name];
|
|
@@ -59,7 +59,7 @@ class Feathers extends dependencies_1.EventEmitter {
|
|
|
59
59
|
return this;
|
|
60
60
|
}
|
|
61
61
|
const protoService = (0, service_1.wrapService)(location, service, options);
|
|
62
|
-
const serviceOptions = (0, service_1.getServiceOptions)(
|
|
62
|
+
const serviceOptions = (0, service_1.getServiceOptions)(protoService);
|
|
63
63
|
for (const name of service_1.protectedMethods) {
|
|
64
64
|
if (serviceOptions.methods.includes(name)) {
|
|
65
65
|
throw new Error(`'${name}' on service '${location}' is not allowed as a custom method name`);
|
|
@@ -77,9 +77,9 @@ class Feathers extends dependencies_1.EventEmitter {
|
|
|
77
77
|
return this;
|
|
78
78
|
}
|
|
79
79
|
hooks(hookMap) {
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
return this.
|
|
80
|
+
const regularMap = hookMap;
|
|
81
|
+
if (regularMap.before || regularMap.after || regularMap.error) {
|
|
82
|
+
return this.regularHooks(regularMap);
|
|
83
83
|
}
|
|
84
84
|
if (Array.isArray(hookMap)) {
|
|
85
85
|
this.appHooks[dependencies_1.HOOKS].push(...hookMap);
|
package/lib/application.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.js","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgC;AAChC,iDAEwB;AACxB,qCAAiD;AACjD,yCAA0C;AAC1C,uCAA6E;AAa7E,
|
|
1
|
+
{"version":3,"file":"application.js","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgC;AAChC,iDAEwB;AACxB,qCAAiD;AACjD,yCAA0C;AAC1C,uCAA6E;AAa7E,6CAAqD;AAErD,MAAM,KAAK,GAAG,IAAA,0BAAW,EAAC,sBAAsB,CAAC,CAAC;AAElD,MAAa,QAA6B,SAAQ,2BAAY;IAY5D;QACE,KAAK,EAAE,CAAC;QAZV,aAAQ,GAAc,EAAe,CAAC;QACtC,aAAQ,GAAc,EAAe,CAAC;QACtC,WAAM,GAAoD,CAAE,i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OAAO,CAAC,KAAK,KAAK,UAAU,EAAE;oBACvC,KAAK,CAAC,4BAA4B,IAAI,IAAI,CAAC,CAAC;oBAE5C,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;iBAClC;YACH,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE;YACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA3ID,4BA2IC"}
|
package/lib/declarations.d.ts
CHANGED
|
@@ -13,8 +13,11 @@ export interface ServiceOptions {
|
|
|
13
13
|
events?: string[];
|
|
14
14
|
methods?: string[];
|
|
15
15
|
serviceEvents?: string[];
|
|
16
|
+
routeParams?: {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
};
|
|
16
19
|
}
|
|
17
|
-
export interface ServiceMethods<T, D = Partial<T>> {
|
|
20
|
+
export interface ServiceMethods<T = any, D = Partial<T>> {
|
|
18
21
|
find(params?: Params): Promise<T | T[]>;
|
|
19
22
|
get(id: Id, params?: Params): Promise<T>;
|
|
20
23
|
create(data: D, params?: Params): Promise<T>;
|
|
@@ -23,7 +26,7 @@ export interface ServiceMethods<T, D = Partial<T>> {
|
|
|
23
26
|
remove(id: NullableId, params?: Params): Promise<T | T[]>;
|
|
24
27
|
setup(app: Application, path: string): Promise<void>;
|
|
25
28
|
}
|
|
26
|
-
export interface ServiceOverloads<T, D
|
|
29
|
+
export interface ServiceOverloads<T = any, D = Partial<T>> {
|
|
27
30
|
create?(data: D[], params?: Params): Promise<T[]>;
|
|
28
31
|
update?(id: Id, data: D, params?: Params): Promise<T>;
|
|
29
32
|
update?(id: null, data: D, params?: Params): Promise<T[]>;
|
|
@@ -32,9 +35,9 @@ export interface ServiceOverloads<T, D> {
|
|
|
32
35
|
remove?(id: Id, params?: Params): Promise<T>;
|
|
33
36
|
remove?(id: null, params?: Params): Promise<T[]>;
|
|
34
37
|
}
|
|
35
|
-
export declare type Service<T, D = Partial<T>> = ServiceMethods<T, D> & ServiceOverloads<T, D>;
|
|
36
|
-
export declare type ServiceInterface<T, D = Partial<T>> = Partial<ServiceMethods<T, D>>;
|
|
37
|
-
export interface ServiceAddons<A = Application, S = Service
|
|
38
|
+
export declare type Service<T = any, D = Partial<T>> = ServiceMethods<T, D> & ServiceOverloads<T, D>;
|
|
39
|
+
export declare type ServiceInterface<T = any, D = Partial<T>> = Partial<ServiceMethods<T, D>>;
|
|
40
|
+
export interface ServiceAddons<A = Application, S = Service> extends EventEmitter {
|
|
38
41
|
id?: string;
|
|
39
42
|
hooks(options: HookOptions<A, S>): this;
|
|
40
43
|
}
|
|
@@ -46,14 +49,16 @@ export interface ServiceHookOverloads<S> {
|
|
|
46
49
|
patch(id: NullableId, data: ServiceGenericData<S>, params: Params, context: HookContext): Promise<HookContext>;
|
|
47
50
|
remove(id: NullableId, params: Params, context: HookContext): Promise<HookContext>;
|
|
48
51
|
}
|
|
49
|
-
export declare type FeathersService<A = FeathersApplication, S = Service
|
|
50
|
-
export declare type
|
|
51
|
-
[
|
|
52
|
+
export declare type FeathersService<A = FeathersApplication, S = Service> = S & ServiceAddons<A, S> & OptionalPick<ServiceHookOverloads<S>, keyof S>;
|
|
53
|
+
export declare type CustomMethods<T extends {
|
|
54
|
+
[key: string]: [any, any];
|
|
55
|
+
}> = {
|
|
56
|
+
[K in keyof T]: (data: T[K][0], params?: Params) => Promise<T[K][1]>;
|
|
52
57
|
};
|
|
53
|
-
export declare type ServiceMixin<A> = (service: FeathersService<A>, path: string, options
|
|
58
|
+
export declare type ServiceMixin<A> = (service: FeathersService<A>, path: string, options: ServiceOptions) => void;
|
|
54
59
|
export declare type ServiceGenericType<S> = S extends ServiceInterface<infer T> ? T : any;
|
|
55
60
|
export declare type ServiceGenericData<S> = S extends ServiceInterface<infer _T, infer D> ? D : any;
|
|
56
|
-
export interface FeathersApplication<
|
|
61
|
+
export interface FeathersApplication<Services = any, Settings = any> {
|
|
57
62
|
/**
|
|
58
63
|
* The Feathers application version
|
|
59
64
|
*/
|
|
@@ -61,19 +66,19 @@ export interface FeathersApplication<ServiceTypes = any, AppSettings = any> {
|
|
|
61
66
|
/**
|
|
62
67
|
* A list of callbacks that run when a new service is registered
|
|
63
68
|
*/
|
|
64
|
-
mixins: ServiceMixin<Application<
|
|
69
|
+
mixins: ServiceMixin<Application<Services, Settings>>[];
|
|
65
70
|
/**
|
|
66
71
|
* The index of all services keyed by their path.
|
|
67
72
|
*
|
|
68
73
|
* __Important:__ Services should always be retrieved via `app.service('name')`
|
|
69
74
|
* not via `app.services`.
|
|
70
75
|
*/
|
|
71
|
-
services:
|
|
76
|
+
services: Services;
|
|
72
77
|
/**
|
|
73
78
|
* The application settings that can be used via
|
|
74
79
|
* `app.get` and `app.set`
|
|
75
80
|
*/
|
|
76
|
-
settings:
|
|
81
|
+
settings: Settings;
|
|
77
82
|
/**
|
|
78
83
|
* A private-ish indicator if `app.setup()` has been called already
|
|
79
84
|
*/
|
|
@@ -81,20 +86,20 @@ export interface FeathersApplication<ServiceTypes = any, AppSettings = any> {
|
|
|
81
86
|
/**
|
|
82
87
|
* Contains all registered application level hooks.
|
|
83
88
|
*/
|
|
84
|
-
appHooks: HookMap<Application<
|
|
89
|
+
appHooks: HookMap<Application<Services, Settings>, any>;
|
|
85
90
|
/**
|
|
86
91
|
* Retrieve an application setting by name
|
|
87
92
|
*
|
|
88
93
|
* @param name The setting name
|
|
89
94
|
*/
|
|
90
|
-
get<L extends keyof
|
|
95
|
+
get<L extends keyof Settings & string>(name: L): Settings[L];
|
|
91
96
|
/**
|
|
92
97
|
* Set an application setting
|
|
93
98
|
*
|
|
94
99
|
* @param name The setting name
|
|
95
100
|
* @param value The setting value
|
|
96
101
|
*/
|
|
97
|
-
set<L extends keyof
|
|
102
|
+
set<L extends keyof Settings & string>(name: L, value: Settings[L]): this;
|
|
98
103
|
/**
|
|
99
104
|
* Runs a callback configure function with the current application instance.
|
|
100
105
|
*
|
|
@@ -108,7 +113,7 @@ export interface FeathersApplication<ServiceTypes = any, AppSettings = any> {
|
|
|
108
113
|
*
|
|
109
114
|
* @param location The path of the service
|
|
110
115
|
*/
|
|
111
|
-
defaultService(location: string): ServiceInterface
|
|
116
|
+
defaultService(location: string): ServiceInterface;
|
|
112
117
|
/**
|
|
113
118
|
* Register a new service or a sub-app. When passed another
|
|
114
119
|
* Feathers application, all its services will be re-registered
|
|
@@ -119,7 +124,7 @@ export interface FeathersApplication<ServiceTypes = any, AppSettings = any> {
|
|
|
119
124
|
* Feathers application to use a sub-app under the `path` prefix.
|
|
120
125
|
* @param options The options for this service
|
|
121
126
|
*/
|
|
122
|
-
use<L extends keyof
|
|
127
|
+
use<L extends keyof Services & string>(path: L, service: keyof any extends keyof Services ? ServiceInterface | Application : Services[L], options?: ServiceOptions): this;
|
|
123
128
|
/**
|
|
124
129
|
* Get the Feathers service instance for a path. This will
|
|
125
130
|
* be the service originally registered with Feathers functionality
|
|
@@ -127,7 +132,7 @@ export interface FeathersApplication<ServiceTypes = any, AppSettings = any> {
|
|
|
127
132
|
*
|
|
128
133
|
* @param path The name of the service.
|
|
129
134
|
*/
|
|
130
|
-
service<L extends keyof
|
|
135
|
+
service<L extends keyof Services & string>(path: L): FeathersService<this, keyof any extends keyof Services ? Service : Services[L]>;
|
|
131
136
|
setup(server?: any): Promise<this>;
|
|
132
137
|
/**
|
|
133
138
|
* Register application level hooks.
|
|
@@ -136,7 +141,7 @@ export interface FeathersApplication<ServiceTypes = any, AppSettings = any> {
|
|
|
136
141
|
*/
|
|
137
142
|
hooks(map: HookOptions<this, any>): this;
|
|
138
143
|
}
|
|
139
|
-
export interface Application<
|
|
144
|
+
export interface Application<Services = any, Settings = any> extends FeathersApplication<Services, Settings>, EventEmitter {
|
|
140
145
|
}
|
|
141
146
|
export declare type Id = number | string;
|
|
142
147
|
export declare type NullableId = Id | null;
|
|
@@ -147,13 +152,20 @@ export interface Params {
|
|
|
147
152
|
query?: Query;
|
|
148
153
|
provider?: string;
|
|
149
154
|
route?: {
|
|
150
|
-
[key: string]:
|
|
155
|
+
[key: string]: any;
|
|
151
156
|
};
|
|
152
157
|
headers?: {
|
|
153
158
|
[key: string]: any;
|
|
154
159
|
};
|
|
155
160
|
[key: string]: any;
|
|
156
161
|
}
|
|
162
|
+
export interface Http {
|
|
163
|
+
/**
|
|
164
|
+
* A writeable, optional property that allows to override the standard HTTP status
|
|
165
|
+
* code that should be returned.
|
|
166
|
+
*/
|
|
167
|
+
statusCode?: number;
|
|
168
|
+
}
|
|
157
169
|
export interface HookContext<A = Application, S = any> extends BaseHookContext<ServiceGenericType<S>> {
|
|
158
170
|
/**
|
|
159
171
|
* A read only property that contains the Feathers application object. This can be used to
|
|
@@ -224,28 +236,34 @@ export interface HookContext<A = Application, S = any> extends BaseHookContext<S
|
|
|
224
236
|
/**
|
|
225
237
|
* A writeable, optional property that allows to override the standard HTTP status
|
|
226
238
|
* code that should be returned.
|
|
239
|
+
*
|
|
240
|
+
* @deprecated Use `http.statusCode` instead.
|
|
227
241
|
*/
|
|
228
242
|
statusCode?: number;
|
|
243
|
+
/**
|
|
244
|
+
* A writeable, optional property that contains options specific to HTTP transports.
|
|
245
|
+
*/
|
|
246
|
+
http?: Http;
|
|
229
247
|
/**
|
|
230
248
|
* The event emitted by this method. Can be set to `null` to skip event emitting.
|
|
231
249
|
*/
|
|
232
250
|
event: string | null;
|
|
233
251
|
}
|
|
234
|
-
export declare type
|
|
235
|
-
export declare type Hook<A = Application, S = Service
|
|
236
|
-
declare type
|
|
237
|
-
[L in keyof S]?: SelfOrArray<
|
|
252
|
+
export declare type RegularHookFunction<A = Application, S = Service> = (this: S, context: HookContext<A, S>) => (Promise<HookContext<Application, S> | void> | HookContext<Application, S> | void);
|
|
253
|
+
export declare type Hook<A = Application, S = Service> = RegularHookFunction<A, S>;
|
|
254
|
+
declare type RegularHookMethodMap<A, S> = {
|
|
255
|
+
[L in keyof S]?: SelfOrArray<RegularHookFunction<A, S>>;
|
|
238
256
|
} & {
|
|
239
|
-
all?: SelfOrArray<
|
|
257
|
+
all?: SelfOrArray<RegularHookFunction<A, S>>;
|
|
240
258
|
};
|
|
241
|
-
declare type
|
|
242
|
-
export declare type
|
|
243
|
-
before?:
|
|
244
|
-
after?:
|
|
245
|
-
error?:
|
|
259
|
+
declare type RegularHookTypeMap<A, S> = SelfOrArray<RegularHookFunction<A, S>> | RegularHookMethodMap<A, S>;
|
|
260
|
+
export declare type RegularHookMap<A, S> = {
|
|
261
|
+
before?: RegularHookTypeMap<A, S>;
|
|
262
|
+
after?: RegularHookTypeMap<A, S>;
|
|
263
|
+
error?: RegularHookTypeMap<A, S>;
|
|
246
264
|
};
|
|
247
|
-
export declare type HookFunction<A = Application, S = Service
|
|
265
|
+
export declare type HookFunction<A = Application, S = Service> = (context: HookContext<A, S>, next: NextFunction) => Promise<void>;
|
|
248
266
|
export declare type HookMap<A, S> = {
|
|
249
267
|
[L in keyof S]?: HookFunction<A, S>[];
|
|
250
268
|
};
|
|
251
|
-
export declare type HookOptions<A, S> = HookMap<A, S> | HookFunction<A, S>[] |
|
|
269
|
+
export declare type HookOptions<A, S> = HookMap<A, S> | HookFunction<A, S>[] | RegularHookMap<A, S>;
|
package/lib/hooks/index.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { HookContextData, HookManager, Middleware } from '../dependencies';
|
|
2
2
|
import { Service, ServiceOptions, HookContext, FeathersService, Application } from '../declarations';
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export declare function createContext(service: Service<any>, method: string, data?: HookContextData): HookContext<Application<any, any>, any>;
|
|
3
|
+
export { fromBeforeHook, fromBeforeHooks, fromAfterHook, fromAfterHooks, fromErrorHook, fromErrorHooks } from './regular';
|
|
4
|
+
export declare function createContext(service: Service, method: string, data?: HookContextData): HookContext<Application<any, any>, any>;
|
|
6
5
|
export declare class FeathersHookManager<A> extends HookManager {
|
|
7
6
|
app: A;
|
|
8
7
|
method: string;
|
|
9
8
|
constructor(app: A, method: string);
|
|
10
9
|
collectMiddleware(self: any, args: any[]): Middleware[];
|
|
11
|
-
initializeContext(self: any, args: any[], context: HookContext): import("@feathersjs/hooks/
|
|
10
|
+
initializeContext(self: any, args: any[], context: HookContext): import("@feathersjs/hooks/types/base").HookContext<any, any>;
|
|
12
11
|
middleware(mw: Middleware[]): this;
|
|
13
12
|
}
|
|
14
13
|
export declare function hookMixin<A>(this: A, service: FeathersService<A>, path: string, options: ServiceOptions): FeathersService<A, Service<any, Partial<any>>>;
|
package/lib/hooks/index.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hookMixin = exports.FeathersHookManager = exports.createContext = exports.fromErrorHooks = exports.
|
|
3
|
+
exports.hookMixin = exports.FeathersHookManager = exports.createContext = exports.fromErrorHooks = exports.fromErrorHook = exports.fromAfterHooks = exports.fromAfterHook = exports.fromBeforeHooks = exports.fromBeforeHook = void 0;
|
|
4
4
|
const dependencies_1 = require("../dependencies");
|
|
5
5
|
const service_1 = require("../service");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "fromBeforeHook", { enumerable: true, get: function () { return
|
|
9
|
-
Object.defineProperty(exports, "
|
|
6
|
+
const regular_1 = require("./regular");
|
|
7
|
+
var regular_2 = require("./regular");
|
|
8
|
+
Object.defineProperty(exports, "fromBeforeHook", { enumerable: true, get: function () { return regular_2.fromBeforeHook; } });
|
|
9
|
+
Object.defineProperty(exports, "fromBeforeHooks", { enumerable: true, get: function () { return regular_2.fromBeforeHooks; } });
|
|
10
|
+
Object.defineProperty(exports, "fromAfterHook", { enumerable: true, get: function () { return regular_2.fromAfterHook; } });
|
|
11
|
+
Object.defineProperty(exports, "fromAfterHooks", { enumerable: true, get: function () { return regular_2.fromAfterHooks; } });
|
|
12
|
+
Object.defineProperty(exports, "fromErrorHook", { enumerable: true, get: function () { return regular_2.fromErrorHook; } });
|
|
13
|
+
Object.defineProperty(exports, "fromErrorHooks", { enumerable: true, get: function () { return regular_2.fromErrorHooks; } });
|
|
10
14
|
function createContext(service, method, data = {}) {
|
|
11
15
|
const createContext = service[method].createContext;
|
|
12
16
|
if (typeof createContext !== 'function') {
|
|
@@ -25,10 +29,10 @@ class FeathersHookManager extends dependencies_1.HookManager {
|
|
|
25
29
|
collectMiddleware(self, args) {
|
|
26
30
|
const app = this.app;
|
|
27
31
|
const appHooks = app.appHooks[dependencies_1.HOOKS].concat(app.appHooks[this.method] || []);
|
|
28
|
-
const
|
|
32
|
+
const regularAppHooks = (0, regular_1.collectRegularHooks)(this.app, this.method);
|
|
29
33
|
const middleware = super.collectMiddleware(self, args);
|
|
30
|
-
const
|
|
31
|
-
return [...appHooks, ...
|
|
34
|
+
const regularHooks = (0, regular_1.collectRegularHooks)(self, this.method);
|
|
35
|
+
return [...appHooks, ...regularAppHooks, ...middleware, ...regularHooks];
|
|
32
36
|
}
|
|
33
37
|
initializeContext(self, args, context) {
|
|
34
38
|
const ctx = super.initializeContext(self, args, context);
|
|
@@ -46,7 +50,8 @@ function hookMixin(service, path, options) {
|
|
|
46
50
|
return service;
|
|
47
51
|
}
|
|
48
52
|
const app = this;
|
|
49
|
-
const
|
|
53
|
+
const hookMethods = (0, service_1.getHookMethods)(service, options);
|
|
54
|
+
const serviceMethodHooks = hookMethods.reduce((res, method) => {
|
|
50
55
|
const params = service_1.defaultServiceArguments[method] || ['data', 'params'];
|
|
51
56
|
res[method] = new FeathersHookManager(app, method)
|
|
52
57
|
.params(...params)
|
|
@@ -56,15 +61,22 @@ function hookMixin(service, path, options) {
|
|
|
56
61
|
method,
|
|
57
62
|
service,
|
|
58
63
|
event: null,
|
|
59
|
-
type: null
|
|
64
|
+
type: null,
|
|
65
|
+
get statusCode() {
|
|
66
|
+
var _a;
|
|
67
|
+
return (_a = this.http) === null || _a === void 0 ? void 0 : _a.statusCode;
|
|
68
|
+
},
|
|
69
|
+
set statusCode(value) {
|
|
70
|
+
(this.http || (this.http = {})).statusCode = value;
|
|
71
|
+
}
|
|
60
72
|
});
|
|
61
73
|
return res;
|
|
62
74
|
}, {});
|
|
63
|
-
const
|
|
75
|
+
const handleRegularHooks = (0, regular_1.enableRegularHooks)(service, hookMethods);
|
|
64
76
|
(0, dependencies_1.hooks)(service, serviceMethodHooks);
|
|
65
77
|
service.hooks = function (hookOptions) {
|
|
66
78
|
if (hookOptions.before || hookOptions.after || hookOptions.error) {
|
|
67
|
-
return
|
|
79
|
+
return handleRegularHooks.call(this, hookOptions);
|
|
68
80
|
}
|
|
69
81
|
if (Array.isArray(hookOptions)) {
|
|
70
82
|
return (0, dependencies_1.hooks)(this, hookOptions);
|
package/lib/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":";;;AAAA,kDAEyB;AAIzB,wCAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":";;;AAAA,kDAEyB;AAIzB,wCAAqE;AACrE,uCAGmB;AAEnB,qCAOmB;AANjB,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AACf,wGAAA,aAAa,OAAA;AACb,yGAAA,cAAc,OAAA;AACd,wGAAA,aAAa,OAAA;AACb,yGAAA,cAAc,OAAA;AAGhB,SAAgB,aAAa,CAAE,OAAgB,EAAE,MAAc,EAAE,OAAwB,EAAE;IACzF,MAAM,aAAa,GAAI,OAAe,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;IAE7D,IAAI,OAAO,aAAa,KAAK,UAAU,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,qCAAqC,MAAM,EAAE,CAAC,CAAC;KAChE;IAED,OAAO,aAAa,CAAC,IAAI,CAAgB,CAAC;AAC5C,CAAC;AARD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YAChE,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;SACnD;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;YAC9B,OAAO,IAAA,oBAAK,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;SACjC;QAED,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACxC,MAAM,OAAO,GAAG,IAAA,yBAAU,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;YAEzC,IAAI,CAAC,CAAC,OAAO,YAAY,mBAAmB,CAAC,EAAE;gBAC7C,MAAM,IAAI,KAAK,CAAC,UAAU,MAAM,iDAAiD,CAAC,CAAC;aACpF;YAED,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC,CAAA;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AA5DD,8BA4DC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HookFunction, RegularHookFunction, RegularHookMap } from '../declarations';
|
|
2
|
+
export declare function fromBeforeHook<A, S>(hook: RegularHookFunction<A, S>): HookFunction<A, S>;
|
|
3
|
+
export declare function fromAfterHook<A, S>(hook: RegularHookFunction<A, S>): HookFunction<A, S>;
|
|
4
|
+
export declare function fromErrorHook<A, S>(hook: RegularHookFunction<A, S>): HookFunction<A, S>;
|
|
5
|
+
export declare function fromBeforeHooks<A, S>(hooks: RegularHookFunction<A, S>[]): HookFunction<unknown, unknown>;
|
|
6
|
+
export declare function fromAfterHooks<A, S>(hooks: RegularHookFunction<A, S>[]): HookFunction<unknown, unknown>;
|
|
7
|
+
export declare function fromErrorHooks<A, S>(hooks: RegularHookFunction<A, S>[]): HookFunction<unknown, unknown>;
|
|
8
|
+
export declare function collectRegularHooks(target: any, method: string): any;
|
|
9
|
+
export declare function convertHookData(input: any): {
|
|
10
|
+
[method: string]: RegularHookFunction<import("../declarations").Application<any, any>, import("../declarations").Service<any, Partial<any>>>[];
|
|
11
|
+
};
|
|
12
|
+
export declare function enableRegularHooks(object: any, methods?: string[]): (this: any, input: RegularHookMap<any, any>) => any;
|