@feathersjs/feathers 5.0.0-pre.22 → 5.0.0-pre.25
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 +32 -0
- package/lib/application.d.ts +3 -4
- package/lib/application.js +36 -34
- package/lib/application.js.map +1 -1
- package/lib/declarations.d.ts +37 -18
- package/lib/events.d.ts +1 -1
- package/lib/events.js +4 -5
- package/lib/events.js.map +1 -1
- package/lib/hooks.d.ts +17 -0
- package/lib/hooks.js +169 -0
- package/lib/hooks.js.map +1 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/service.js +9 -15
- 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 +9 -9
- package/src/application.ts +106 -97
- package/src/declarations.ts +144 -145
- package/src/events.ts +15 -15
- package/src/hooks.ts +230 -0
- package/src/index.ts +13 -12
- package/src/service.ts +33 -49
- package/src/version.ts +1 -1
- package/lib/dependencies.d.ts +0 -4
- package/lib/dependencies.js +0 -22
- package/lib/dependencies.js.map +0 -1
- package/lib/hooks/index.d.ts +0 -13
- package/lib/hooks/index.js +0 -96
- package/lib/hooks/index.js.map +0 -1
- package/lib/hooks/regular.d.ts +0 -12
- package/lib/hooks/regular.js +0 -169
- package/lib/hooks/regular.js.map +0 -1
- package/src/dependencies.ts +0 -5
- package/src/hooks/index.ts +0 -122
- package/src/hooks/regular.ts +0 -207
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
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.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @feathersjs/feathers
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **authentication-local:** Add passwordHash property resolver ([#2660](https://github.com/feathersjs/feathers/issues/2660)) ([b41279b](https://github.com/feathersjs/feathers/commit/b41279b55eea3771a6fa4983a37be2413287bbc6))
|
|
20
|
+
* **cli:** Add typed client to a generated app ([#2669](https://github.com/feathersjs/feathers/issues/2669)) ([5b801b5](https://github.com/feathersjs/feathers/commit/5b801b5017ddc3eaa95622b539f51d605916bc86))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# [5.0.0-pre.23](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.22...v5.0.0-pre.23) (2022-06-06)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* **client:** Improve client side custom method support ([#2654](https://github.com/feathersjs/feathers/issues/2654)) ([c138acf](https://github.com/feathersjs/feathers/commit/c138acf50affbe6b66177d084d3c7a3e9220f09f))
|
|
32
|
+
* **core:** Rename async hooks to around hooks, allow usual registration format ([#2652](https://github.com/feathersjs/feathers/issues/2652)) ([2a485a0](https://github.com/feathersjs/feathers/commit/2a485a07929184261f27437fc0fdfe5a44694834))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
# [5.0.0-pre.22](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.21...v5.0.0-pre.22) (2022-05-24)
|
|
7
39
|
|
|
8
40
|
|
package/lib/application.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from '
|
|
3
|
-
import { FeathersApplication, ServiceMixin, Service, ServiceOptions, ServiceInterface, Application, FeathersService,
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import { FeathersApplication, ServiceMixin, Service, ServiceOptions, ServiceInterface, Application, FeathersService, ApplicationHookOptions } from './declarations';
|
|
4
4
|
export declare class Feathers<Services, Settings> extends EventEmitter implements FeathersApplication<Services, Settings> {
|
|
5
5
|
services: Services;
|
|
6
6
|
settings: Settings;
|
|
7
7
|
mixins: ServiceMixin<Application<Services, Settings>>[];
|
|
8
8
|
version: string;
|
|
9
9
|
_isSetup: boolean;
|
|
10
|
-
|
|
11
|
-
private regularHooks;
|
|
10
|
+
protected registerHooks: (this: any, allHooks: any) => any;
|
|
12
11
|
constructor();
|
|
13
12
|
get<L extends keyof Settings & string>(name: L): Settings[L];
|
|
14
13
|
set<L extends keyof Settings & string>(name: L, value: Settings[L]): this;
|
package/lib/application.js
CHANGED
|
@@ -5,32 +5,34 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Feathers = void 0;
|
|
7
7
|
const version_1 = __importDefault(require("./version"));
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
8
|
+
const events_1 = require("events");
|
|
9
|
+
const commons_1 = require("@feathersjs/commons");
|
|
10
|
+
const hooks_1 = require("@feathersjs/hooks");
|
|
11
|
+
const events_2 = require("./events");
|
|
12
|
+
const hooks_2 = require("./hooks");
|
|
11
13
|
const service_1 = require("./service");
|
|
12
|
-
const
|
|
13
|
-
const debug = (0,
|
|
14
|
-
class Feathers extends
|
|
14
|
+
const hooks_3 = require("./hooks");
|
|
15
|
+
const debug = (0, commons_1.createDebug)('@feathersjs/feathers');
|
|
16
|
+
class Feathers extends events_1.EventEmitter {
|
|
15
17
|
constructor() {
|
|
16
18
|
super();
|
|
17
19
|
this.services = {};
|
|
18
20
|
this.settings = {};
|
|
19
|
-
this.mixins = [
|
|
21
|
+
this.mixins = [hooks_2.hookMixin, events_2.eventMixin];
|
|
20
22
|
this.version = version_1.default;
|
|
21
23
|
this._isSetup = false;
|
|
22
|
-
this
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
this.regularHooks = (0, regular_1.enableRegularHooks)(this);
|
|
26
|
-
(0, dependencies_1.hooks)(this, {
|
|
27
|
-
setup: (0, dependencies_1.middleware)().params('server').props({
|
|
24
|
+
(0, hooks_1.hooks)(this, {
|
|
25
|
+
setup: (0, hooks_1.middleware)().params('server').props({
|
|
28
26
|
app: this
|
|
29
27
|
}),
|
|
30
|
-
teardown: (0,
|
|
28
|
+
teardown: (0, hooks_1.middleware)().params('server').props({
|
|
31
29
|
app: this
|
|
32
30
|
})
|
|
33
31
|
});
|
|
32
|
+
this.registerHooks = (0, hooks_3.enableHooks)(this);
|
|
33
|
+
this.registerHooks({
|
|
34
|
+
around: [events_2.eventHook]
|
|
35
|
+
});
|
|
34
36
|
}
|
|
35
37
|
get(name) {
|
|
36
38
|
return this.settings[name];
|
|
@@ -47,7 +49,7 @@ class Feathers extends dependencies_1.EventEmitter {
|
|
|
47
49
|
throw new Error(`Can not find service '${location}'`);
|
|
48
50
|
}
|
|
49
51
|
service(location) {
|
|
50
|
-
const path = ((0,
|
|
52
|
+
const path = ((0, commons_1.stripSlashes)(location) || '/');
|
|
51
53
|
const current = this.services[path];
|
|
52
54
|
if (typeof current === 'undefined') {
|
|
53
55
|
this.use(path, this.defaultService(path));
|
|
@@ -59,11 +61,11 @@ class Feathers extends dependencies_1.EventEmitter {
|
|
|
59
61
|
if (typeof path !== 'string') {
|
|
60
62
|
throw new Error(`'${path}' is not a valid service path.`);
|
|
61
63
|
}
|
|
62
|
-
const location = ((0,
|
|
64
|
+
const location = ((0, commons_1.stripSlashes)(path) || '/');
|
|
63
65
|
const subApp = service;
|
|
64
66
|
const isSubApp = typeof subApp.service === 'function' && subApp.services;
|
|
65
67
|
if (isSubApp) {
|
|
66
|
-
Object.keys(subApp.services).forEach(subPath => this.use(`${location}/${subPath}`, subApp.service(subPath)));
|
|
68
|
+
Object.keys(subApp.services).forEach((subPath) => this.use(`${location}/${subPath}`, subApp.service(subPath)));
|
|
67
69
|
return this;
|
|
68
70
|
}
|
|
69
71
|
const protoService = (0, service_1.wrapService)(location, service, options);
|
|
@@ -75,7 +77,7 @@ class Feathers extends dependencies_1.EventEmitter {
|
|
|
75
77
|
}
|
|
76
78
|
debug(`Registering new service at \`${location}\``);
|
|
77
79
|
// Add all the mixins
|
|
78
|
-
this.mixins.forEach(fn => fn.call(this, protoService, location, serviceOptions));
|
|
80
|
+
this.mixins.forEach((fn) => fn.call(this, protoService, location, serviceOptions));
|
|
79
81
|
this.services[location] = protoService;
|
|
80
82
|
// If we ran setup already, set this service up explicitly, this will not `await`
|
|
81
83
|
if (this._isSetup && typeof protoService.setup === 'function') {
|
|
@@ -86,45 +88,45 @@ class Feathers extends dependencies_1.EventEmitter {
|
|
|
86
88
|
}
|
|
87
89
|
hooks(hookMap) {
|
|
88
90
|
const untypedMap = hookMap;
|
|
89
|
-
if (untypedMap.before || untypedMap.after || untypedMap.error) {
|
|
90
|
-
|
|
91
|
+
if (untypedMap.before || untypedMap.after || untypedMap.error || untypedMap.around) {
|
|
92
|
+
// regular hooks for all service methods
|
|
93
|
+
this.registerHooks(untypedMap);
|
|
91
94
|
}
|
|
92
95
|
else if (untypedMap.setup || untypedMap.teardown) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
else if (Array.isArray(hookMap)) {
|
|
96
|
-
this.appHooks[dependencies_1.HOOKS].push(...hookMap);
|
|
96
|
+
// .setup and .teardown application hooks
|
|
97
|
+
(0, hooks_1.hooks)(this, untypedMap);
|
|
97
98
|
}
|
|
98
99
|
else {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this.appHooks[key] = methodHooks.concat(methodHookMap[key]);
|
|
100
|
+
// Other registration formats are just `around` hooks
|
|
101
|
+
this.registerHooks({
|
|
102
|
+
around: untypedMap
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
return this;
|
|
106
106
|
}
|
|
107
107
|
setup() {
|
|
108
108
|
this._isSetup = true;
|
|
109
|
-
return Object.keys(this.services)
|
|
110
|
-
.then(() => {
|
|
109
|
+
return Object.keys(this.services)
|
|
110
|
+
.reduce((current, path) => current.then(() => {
|
|
111
111
|
const service = this.service(path);
|
|
112
112
|
if (typeof service.setup === 'function') {
|
|
113
113
|
debug(`Setting up service for \`${path}\``);
|
|
114
114
|
return service.setup(this, path);
|
|
115
115
|
}
|
|
116
|
-
}), Promise.resolve())
|
|
116
|
+
}), Promise.resolve())
|
|
117
|
+
.then(() => this);
|
|
117
118
|
}
|
|
118
119
|
teardown() {
|
|
119
120
|
this._isSetup = false;
|
|
120
|
-
return Object.keys(this.services)
|
|
121
|
-
.then(() => {
|
|
121
|
+
return Object.keys(this.services)
|
|
122
|
+
.reduce((current, path) => current.then(() => {
|
|
122
123
|
const service = this.service(path);
|
|
123
124
|
if (typeof service.teardown === 'function') {
|
|
124
125
|
debug(`Tearing down service for \`${path}\``);
|
|
125
126
|
return service.teardown(this, path);
|
|
126
127
|
}
|
|
127
|
-
}), Promise.resolve())
|
|
128
|
+
}), Promise.resolve())
|
|
129
|
+
.then(() => this);
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
132
|
exports.Feathers = Feathers;
|
package/lib/application.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.js","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"application.js","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA+B;AAC/B,mCAAqC;AACrC,iDAA+D;AAC/D,6CAAqD;AACrD,qCAAgD;AAChD,mCAAmC;AACnC,uCAA4E;AAW5E,mCAAqC;AAErC,MAAM,KAAK,GAAG,IAAA,qBAAW,EAAC,sBAAsB,CAAC,CAAA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
|
3
|
+
import { NextFunction, HookContext as BaseHookContext } from '@feathersjs/hooks';
|
|
3
4
|
declare type SelfOrArray<S> = S | S[];
|
|
4
5
|
declare type OptionalPick<T, K extends PropertyKey> = Pick<T, Extract<keyof T, K>>;
|
|
5
6
|
export type { NextFunction };
|
|
7
|
+
/**
|
|
8
|
+
* The object returned from `.find` call by standard database adapters
|
|
9
|
+
*/
|
|
6
10
|
export interface Paginated<T> {
|
|
7
11
|
total: number;
|
|
8
12
|
limit: number;
|
|
9
13
|
skip: number;
|
|
10
14
|
data: T[];
|
|
11
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Options that can be passed when registering a service via `app.use(name, service, options)`
|
|
18
|
+
*/
|
|
12
19
|
export interface ServiceOptions {
|
|
13
20
|
events?: string[];
|
|
14
21
|
methods?: string[];
|
|
@@ -56,6 +63,19 @@ export declare type CustomMethods<T extends {
|
|
|
56
63
|
}> = {
|
|
57
64
|
[K in keyof T]: (data: T[K][0], params?: Params) => Promise<T[K][1]>;
|
|
58
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* An interface usually use by transport clients that represents a e.g. HTTP or websocket
|
|
68
|
+
* connection that can be configured on the application.
|
|
69
|
+
*/
|
|
70
|
+
export declare type TransportConnection<Services = any> = {
|
|
71
|
+
(app: Application<Services>): void;
|
|
72
|
+
Service: any;
|
|
73
|
+
service: <L extends keyof Services & string>(name: L) => keyof any extends keyof Services ? ServiceInterface : Services[L];
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* The interface for a custom service method. Can e.g. be used to type client side services.
|
|
77
|
+
*/
|
|
78
|
+
export declare type CustomMethod<T = any, R = T, P extends Params = Params> = (data: T, params?: P) => Promise<R>;
|
|
59
79
|
export declare type ServiceMixin<A> = (service: FeathersService<A>, path: string, options: ServiceOptions) => void;
|
|
60
80
|
export declare type ServiceGenericType<S> = S extends ServiceInterface<infer T> ? T : any;
|
|
61
81
|
export declare type ServiceGenericData<S> = S extends ServiceInterface<infer _T, infer D> ? D : any;
|
|
@@ -85,10 +105,6 @@ export interface FeathersApplication<Services = any, Settings = any> {
|
|
|
85
105
|
* A private-ish indicator if `app.setup()` has been called already
|
|
86
106
|
*/
|
|
87
107
|
_isSetup: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* Contains all registered application level hooks.
|
|
90
|
-
*/
|
|
91
|
-
appHooks: HookMap<Application<Services, Settings>, any>;
|
|
92
108
|
/**
|
|
93
109
|
* Retrieve an application setting by name
|
|
94
110
|
*
|
|
@@ -270,24 +286,27 @@ export interface HookContext<A = Application, S = any> extends BaseHookContext<S
|
|
|
270
286
|
*/
|
|
271
287
|
event: string | null;
|
|
272
288
|
}
|
|
273
|
-
export declare type
|
|
274
|
-
export declare type Hook<A = Application, S = Service> =
|
|
275
|
-
declare type
|
|
276
|
-
[L in keyof S]?: SelfOrArray<
|
|
289
|
+
export declare type HookFunction<A = Application, S = Service> = (this: S, context: HookContext<A, S>) => Promise<HookContext<Application, S> | void> | HookContext<Application, S> | void;
|
|
290
|
+
export declare type Hook<A = Application, S = Service> = HookFunction<A, S>;
|
|
291
|
+
declare type HookMethodMap<A, S> = {
|
|
292
|
+
[L in keyof S]?: SelfOrArray<HookFunction<A, S>>;
|
|
277
293
|
} & {
|
|
278
|
-
all?: SelfOrArray<
|
|
294
|
+
all?: SelfOrArray<HookFunction<A, S>>;
|
|
279
295
|
};
|
|
280
|
-
declare type
|
|
281
|
-
export declare type
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
296
|
+
declare type HookTypeMap<A, S> = SelfOrArray<HookFunction<A, S>> | HookMethodMap<A, S>;
|
|
297
|
+
export declare type AroundHookFunction<A = Application, S = Service> = (context: HookContext<A, S>, next: NextFunction) => Promise<void>;
|
|
298
|
+
export declare type AroundHookMap<A, S> = {
|
|
299
|
+
[L in keyof S]?: AroundHookFunction<A, S>[];
|
|
300
|
+
} & {
|
|
301
|
+
all?: AroundHookFunction<A, S>[];
|
|
285
302
|
};
|
|
286
|
-
export declare type HookFunction<A = Application, S = Service> = (context: HookContext<A, S>, next: NextFunction) => Promise<void>;
|
|
287
303
|
export declare type HookMap<A, S> = {
|
|
288
|
-
|
|
304
|
+
around?: AroundHookMap<A, S>;
|
|
305
|
+
before?: HookTypeMap<A, S>;
|
|
306
|
+
after?: HookTypeMap<A, S>;
|
|
307
|
+
error?: HookTypeMap<A, S>;
|
|
289
308
|
};
|
|
290
|
-
export declare type HookOptions<A, S> =
|
|
309
|
+
export declare type HookOptions<A, S> = AroundHookMap<A, S> | AroundHookFunction<A, S>[] | HookMap<A, S>;
|
|
291
310
|
export interface ApplicationHookContext<A = Application> extends BaseHookContext {
|
|
292
311
|
app: A;
|
|
293
312
|
server: any;
|
package/lib/events.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NextFunction } from '
|
|
1
|
+
import { NextFunction } from '@feathersjs/hooks';
|
|
2
2
|
import { HookContext, FeathersService } from './declarations';
|
|
3
3
|
export declare function eventHook(context: HookContext, next: NextFunction): Promise<void>;
|
|
4
4
|
export declare function eventMixin<A>(service: FeathersService<A>): FeathersService<A, import("./declarations").Service<any, Partial<any>, import("./declarations").Params<import("./declarations").Query>>>;
|
package/lib/events.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.eventMixin = exports.eventHook = void 0;
|
|
4
|
-
const
|
|
4
|
+
const events_1 = require("events");
|
|
5
5
|
const service_1 = require("./service");
|
|
6
6
|
function eventHook(context, next) {
|
|
7
7
|
const { events } = (0, service_1.getServiceOptions)(context.self);
|
|
@@ -12,16 +12,15 @@ function eventHook(context, next) {
|
|
|
12
12
|
// This is used for custom events and for client services receiving event from the server
|
|
13
13
|
if (typeof context.event === 'string' && !events.includes(context.event)) {
|
|
14
14
|
const results = Array.isArray(context.result) ? context.result : [context.result];
|
|
15
|
-
results.forEach(element => context.self.emit(context.event, element, context));
|
|
15
|
+
results.forEach((element) => context.self.emit(context.event, element, context));
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
exports.eventHook = eventHook;
|
|
20
20
|
function eventMixin(service) {
|
|
21
|
-
const isEmitter = typeof service.on === 'function' &&
|
|
22
|
-
typeof service.emit === 'function';
|
|
21
|
+
const isEmitter = typeof service.on === 'function' && typeof service.emit === 'function';
|
|
23
22
|
if (!isEmitter) {
|
|
24
|
-
Object.assign(service,
|
|
23
|
+
Object.assign(service, events_1.EventEmitter.prototype);
|
|
25
24
|
}
|
|
26
25
|
return service;
|
|
27
26
|
}
|
package/lib/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AAGrC,uCAA8D;AAE9D,SAAgB,SAAS,CAAC,OAAoB,EAAE,IAAkB;IAChE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,2BAAiB,EAAE,OAAe,CAAC,IAAI,CAAC,CAAA;IAC3D,MAAM,YAAY,GAAI,yBAAuB,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,CAAA;IAErE,OAAO,CAAC,KAAK,GAAG,YAAY,CAAA;IAE5B,OAAO,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;QACtB,+FAA+F;QAC/F,yFAAyF;QACzF,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACxE,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YAEjF,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAE,OAAe,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;SAC1F;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAfD,8BAeC;AAED,SAAgB,UAAU,CAAI,OAA2B;IACvD,MAAM,SAAS,GAAG,OAAO,OAAO,CAAC,EAAE,KAAK,UAAU,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU,CAAA;IAExF,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,qBAAY,CAAC,SAAS,CAAC,CAAA;KAC/C;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AARD,gCAQC"}
|
package/lib/hooks.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HookContextData, HookManager, Middleware } from '@feathersjs/hooks';
|
|
2
|
+
import { Service, ServiceOptions, HookContext, FeathersService, HookMap, AroundHookFunction, HookFunction } from './declarations';
|
|
3
|
+
export declare function collectHooks(target: any, method: string): any;
|
|
4
|
+
export declare function convertHookData(input: any): {
|
|
5
|
+
[method: string]: HookFunction<import("./declarations").Application<any, any>, Service<any, Partial<any>, import("./declarations").Params<import("./declarations").Query>>>[] | AroundHookFunction<import("./declarations").Application<any, any>, Service<any, Partial<any>, import("./declarations").Params<import("./declarations").Query>>>[];
|
|
6
|
+
};
|
|
7
|
+
export declare function enableHooks(object: any, methods?: string[]): (this: any, input: HookMap<any, any>) => any;
|
|
8
|
+
export declare function createContext(service: Service, method: string, data?: HookContextData): HookContext<import("./declarations").Application<any, any>, any>;
|
|
9
|
+
export declare class FeathersHookManager<A> extends HookManager {
|
|
10
|
+
app: A;
|
|
11
|
+
method: string;
|
|
12
|
+
constructor(app: A, method: string);
|
|
13
|
+
collectMiddleware(self: any, args: any[]): Middleware[];
|
|
14
|
+
initializeContext(self: any, args: any[], context: HookContext): import("@feathersjs/hooks").HookContext<any, any>;
|
|
15
|
+
middleware(mw: Middleware[]): this;
|
|
16
|
+
}
|
|
17
|
+
export declare function hookMixin<A>(this: A, service: FeathersService<A>, path: string, options: ServiceOptions): FeathersService<A, Service<any, Partial<any>, import("./declarations").Params<import("./declarations").Query>>>;
|
package/lib/hooks.js
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hookMixin = exports.FeathersHookManager = exports.createContext = exports.enableHooks = exports.convertHookData = exports.collectHooks = void 0;
|
|
4
|
+
const hooks_1 = require("@feathersjs/hooks");
|
|
5
|
+
const service_1 = require("./service");
|
|
6
|
+
function collectHooks(target, method) {
|
|
7
|
+
return target.__hooks.hooks[method] || [];
|
|
8
|
+
}
|
|
9
|
+
exports.collectHooks = collectHooks;
|
|
10
|
+
// Converts different hook registration formats into the
|
|
11
|
+
// same internal format
|
|
12
|
+
function convertHookData(input) {
|
|
13
|
+
const result = {};
|
|
14
|
+
if (Array.isArray(input)) {
|
|
15
|
+
result.all = input;
|
|
16
|
+
}
|
|
17
|
+
else if (typeof input !== 'object') {
|
|
18
|
+
result.all = [input];
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
for (const key of Object.keys(input)) {
|
|
22
|
+
const value = input[key];
|
|
23
|
+
result[key] = Array.isArray(value) ? value : [value];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
exports.convertHookData = convertHookData;
|
|
29
|
+
const types = ['before', 'after', 'error', 'around'];
|
|
30
|
+
const isType = (value) => types.includes(value);
|
|
31
|
+
const createMap = (input, methods) => {
|
|
32
|
+
const map = {};
|
|
33
|
+
Object.keys(input).forEach((type) => {
|
|
34
|
+
if (!isType(type)) {
|
|
35
|
+
throw new Error(`'${type}' is not a valid hook type`);
|
|
36
|
+
}
|
|
37
|
+
const data = convertHookData(input[type]);
|
|
38
|
+
Object.keys(data).forEach((method) => {
|
|
39
|
+
if (method !== 'all' && !methods.includes(method) && !service_1.defaultServiceMethods.includes(method)) {
|
|
40
|
+
throw new Error(`'${method}' is not a valid hook method`);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
map[type] = data;
|
|
44
|
+
});
|
|
45
|
+
return map;
|
|
46
|
+
};
|
|
47
|
+
const updateStore = (store, map) => Object.keys(store.hooks).forEach((method) => {
|
|
48
|
+
Object.keys(map).forEach((key) => {
|
|
49
|
+
var _a;
|
|
50
|
+
const type = key;
|
|
51
|
+
const allHooks = map[type].all || [];
|
|
52
|
+
const methodHooks = map[type][method] || [];
|
|
53
|
+
if (allHooks.length || methodHooks.length) {
|
|
54
|
+
const list = [...allHooks, ...methodHooks];
|
|
55
|
+
const hooks = ((_a = store[type])[method] || (_a[method] = []));
|
|
56
|
+
hooks.push(...list);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const collected = (0, hooks_1.collect)({
|
|
60
|
+
before: store.before[method] || [],
|
|
61
|
+
after: store.after[method] || [],
|
|
62
|
+
error: store.error[method] || []
|
|
63
|
+
});
|
|
64
|
+
store.hooks[method] = [...(store.around[method] || []), collected];
|
|
65
|
+
});
|
|
66
|
+
// Add `.hooks` functionality to an object
|
|
67
|
+
function enableHooks(object, methods = service_1.defaultServiceMethods) {
|
|
68
|
+
const store = {
|
|
69
|
+
around: {},
|
|
70
|
+
before: {},
|
|
71
|
+
after: {},
|
|
72
|
+
error: {},
|
|
73
|
+
hooks: {}
|
|
74
|
+
};
|
|
75
|
+
for (const method of methods) {
|
|
76
|
+
store.hooks[method] = [];
|
|
77
|
+
}
|
|
78
|
+
Object.defineProperty(object, '__hooks', {
|
|
79
|
+
configurable: true,
|
|
80
|
+
value: store,
|
|
81
|
+
writable: true
|
|
82
|
+
});
|
|
83
|
+
return function registerHooks(input) {
|
|
84
|
+
const store = this.__hooks;
|
|
85
|
+
const map = createMap(input, methods);
|
|
86
|
+
updateStore(store, map);
|
|
87
|
+
return this;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
exports.enableHooks = enableHooks;
|
|
91
|
+
function createContext(service, method, data = {}) {
|
|
92
|
+
const createContext = service[method].createContext;
|
|
93
|
+
if (typeof createContext !== 'function') {
|
|
94
|
+
throw new Error(`Can not create context for method ${method}`);
|
|
95
|
+
}
|
|
96
|
+
return createContext(data);
|
|
97
|
+
}
|
|
98
|
+
exports.createContext = createContext;
|
|
99
|
+
class FeathersHookManager extends hooks_1.HookManager {
|
|
100
|
+
constructor(app, method) {
|
|
101
|
+
super();
|
|
102
|
+
this.app = app;
|
|
103
|
+
this.method = method;
|
|
104
|
+
this._middleware = [];
|
|
105
|
+
}
|
|
106
|
+
collectMiddleware(self, args) {
|
|
107
|
+
const appHooks = collectHooks(this.app, this.method);
|
|
108
|
+
const middleware = super.collectMiddleware(self, args);
|
|
109
|
+
const methodHooks = collectHooks(self, this.method);
|
|
110
|
+
return [...appHooks, ...middleware, ...methodHooks];
|
|
111
|
+
}
|
|
112
|
+
initializeContext(self, args, context) {
|
|
113
|
+
const ctx = super.initializeContext(self, args, context);
|
|
114
|
+
ctx.params = ctx.params || {};
|
|
115
|
+
return ctx;
|
|
116
|
+
}
|
|
117
|
+
middleware(mw) {
|
|
118
|
+
this._middleware.push(...mw);
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.FeathersHookManager = FeathersHookManager;
|
|
123
|
+
function hookMixin(service, path, options) {
|
|
124
|
+
if (typeof service.hooks === 'function') {
|
|
125
|
+
return service;
|
|
126
|
+
}
|
|
127
|
+
const hookMethods = (0, service_1.getHookMethods)(service, options);
|
|
128
|
+
const serviceMethodHooks = hookMethods.reduce((res, method) => {
|
|
129
|
+
const params = service_1.defaultServiceArguments[method] || ['data', 'params'];
|
|
130
|
+
res[method] = new FeathersHookManager(this, method).params(...params).props({
|
|
131
|
+
app: this,
|
|
132
|
+
path,
|
|
133
|
+
method,
|
|
134
|
+
service,
|
|
135
|
+
event: null,
|
|
136
|
+
type: null,
|
|
137
|
+
get statusCode() {
|
|
138
|
+
var _a;
|
|
139
|
+
return (_a = this.http) === null || _a === void 0 ? void 0 : _a.status;
|
|
140
|
+
},
|
|
141
|
+
set statusCode(value) {
|
|
142
|
+
this.http = this.http || {};
|
|
143
|
+
this.http.status = value;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
return res;
|
|
147
|
+
}, {});
|
|
148
|
+
const registerHooks = enableHooks(service, hookMethods);
|
|
149
|
+
(0, hooks_1.hooks)(service, serviceMethodHooks);
|
|
150
|
+
service.hooks = function (hookOptions) {
|
|
151
|
+
if (hookOptions.before || hookOptions.after || hookOptions.error || hookOptions.around) {
|
|
152
|
+
return registerHooks.call(this, hookOptions);
|
|
153
|
+
}
|
|
154
|
+
if (Array.isArray(hookOptions)) {
|
|
155
|
+
return (0, hooks_1.hooks)(this, hookOptions);
|
|
156
|
+
}
|
|
157
|
+
Object.keys(hookOptions).forEach((method) => {
|
|
158
|
+
const manager = (0, hooks_1.getManager)(this[method]);
|
|
159
|
+
if (!(manager instanceof FeathersHookManager)) {
|
|
160
|
+
throw new Error(`Method ${method} is not a Feathers hooks enabled service method`);
|
|
161
|
+
}
|
|
162
|
+
manager.middleware(hookOptions[method]);
|
|
163
|
+
});
|
|
164
|
+
return this;
|
|
165
|
+
};
|
|
166
|
+
return service;
|
|
167
|
+
}
|
|
168
|
+
exports.hookMixin = hookMixin;
|
|
169
|
+
//# sourceMappingURL=hooks.js.map
|
package/lib/hooks.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":";;;AAAA,6CAQ0B;AAU1B,uCAA0F;AAE1F,SAAgB,YAAY,CAAC,MAAW,EAAE,MAAc;IACtD,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI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AC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;SAC7C;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;YAC9B,OAAO,IAAA,aAAK,EAAC,IAAI,EAAE,WAAW,CAAC,CAAA;SAChC;QAED,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YAC1C,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;YAExC,IAAI,CAAC,CAAC,OAAO,YAAY,mBAAmB,CAAC,EAAE;gBAC7C,MAAM,IAAI,KAAK,CAAC,UAAU,MAAM,iDAAiD,CAAC,CAAA;aACnF;YAED,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAA;QACzC,CAAC,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC,CAAA;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAxDD,8BAwDC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { Feathers } from './application';
|
|
|
3
3
|
import { Application } from './declarations';
|
|
4
4
|
export declare function feathers<T = any, S = any>(): Application<T, S>;
|
|
5
5
|
export declare namespace feathers {
|
|
6
|
-
var setDebug: typeof import("@feathersjs/commons
|
|
6
|
+
var setDebug: typeof import("@feathersjs/commons").setDebug;
|
|
7
7
|
}
|
|
8
8
|
export { version, Feathers };
|
|
9
|
-
export * from './hooks
|
|
9
|
+
export * from './hooks';
|
|
10
10
|
export * from './declarations';
|
|
11
11
|
export * from './service';
|
package/lib/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.Feathers = exports.version = exports.feathers = void 0;
|
|
21
|
-
const
|
|
21
|
+
const commons_1 = require("@feathersjs/commons");
|
|
22
22
|
const version_1 = __importDefault(require("./version"));
|
|
23
23
|
exports.version = version_1.default;
|
|
24
24
|
const application_1 = require("./application");
|
|
@@ -27,8 +27,8 @@ function feathers() {
|
|
|
27
27
|
return new application_1.Feathers();
|
|
28
28
|
}
|
|
29
29
|
exports.feathers = feathers;
|
|
30
|
-
feathers.setDebug =
|
|
31
|
-
__exportStar(require("./hooks
|
|
30
|
+
feathers.setDebug = commons_1.setDebug;
|
|
31
|
+
__exportStar(require("./hooks"), exports);
|
|
32
32
|
__exportStar(require("./declarations"), exports);
|
|
33
33
|
__exportStar(require("./service"), exports);
|
|
34
34
|
if (typeof module !== 'undefined') {
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,iDAA8C;AAE9C,wDAA+B;AAUtB,kBAVF,iBAAO,CAUE;AAThB,+CAAwC;AAStB,yFATT,sBAAQ,OASS;AAN1B,SAAgB,QAAQ;IACtB,OAAO,IAAI,sBAAQ,EAA6B,CAAA;AAClD,CAAC;AAFD,4BAEC;AAED,QAAQ,CAAC,QAAQ,GAAG,kBAAQ,CAAA;AAG5B,0CAAuB;AACvB,iDAA8B;AAC9B,4CAAyB;AAEzB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;CACzD"}
|