@feathersjs/feathers 5.0.0-pre.9 → 5.0.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 Feathers
3
+ Copyright (c) 2023 Feathers Contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,25 +1,24 @@
1
1
  <img style="width: 100%; max-width: 400px;" src="http://feathersjs.com/img/feathers-logo-wide.png" alt="Feathers logo">
2
2
 
3
- ## A framework for real-time applications and REST APIs with JavaScript and TypeScript
3
+ ## The API and real-time application framework
4
4
 
5
5
  [![CI](https://github.com/feathersjs/feathers/workflows/CI/badge.svg)](https://github.com/feathersjs/feathers/actions?query=workflow%3ACI)
6
6
  [![Maintainability](https://api.codeclimate.com/v1/badges/cb5ec42a2d0cc1a47a02/maintainability)](https://codeclimate.com/github/feathersjs/feathers/maintainability)
7
7
  [![Test Coverage](https://api.codeclimate.com/v1/badges/cb5ec42a2d0cc1a47a02/test_coverage)](https://codeclimate.com/github/feathersjs/feathers/test_coverage)
8
8
  [![Download Status](https://img.shields.io/npm/dm/@feathersjs/feathers.svg?style=flat-square)](https://www.npmjs.com/package/@feathersjs/feathers)
9
+ [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/qa8kez8QBx)
9
10
 
10
- Feathers is a lightweight web-framework for creating real-time applications and REST APIs using JavaScript or TypeScript.
11
+ Feathers is a lightweight web-framework for creating APIs and real-time applications using TypeScript or JavaScript.
11
12
 
12
- Feathers can interact with any backend technology, supports over a dozen databases and works with any frontend technology like React, VueJS, Angular, React Native, Android or iOS.
13
+ Feathers can interact with any backend technology, supports many databases out of the box and works with any frontend technology like React, VueJS, Angular, React Native, Android or iOS.
13
14
 
14
15
  ## Getting started
15
16
 
16
17
  You can build your first real-time and REST API in just 4 commands:
17
18
 
18
19
  ```bash
19
- $ npm install -g @feathersjs/cli
20
- $ mkdir my-new-app
21
- $ cd my-new-app/
22
- $ feathers generate app
20
+ $ npm init feathers my-new-app
21
+ $ cd my-new-app
23
22
  $ npm start
24
23
  ```
25
24
 
@@ -31,6 +30,6 @@ The [Feathers docs](http://docs.feathersjs.com) are loaded with awesome stuff an
31
30
 
32
31
  ## License
33
32
 
34
- Copyright (c) 2021 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors)
33
+ Copyright (c) 2023 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors)
35
34
 
36
35
  Licensed under the [MIT license](LICENSE).
@@ -1,21 +1,26 @@
1
1
  /// <reference types="node" />
2
- import { EventEmitter } from './dependencies';
3
- import { FeathersApplication, ServiceMixin, Service, ServiceOptions, ServiceInterface, Application, HookOptions, FeathersService, HookMap } from './declarations';
4
- export declare class Feathers<ServiceTypes, AppSettings> extends EventEmitter implements FeathersApplication<ServiceTypes, AppSettings> {
5
- services: ServiceTypes;
6
- settings: AppSettings;
7
- mixins: ServiceMixin<Application<ServiceTypes, AppSettings>>[];
2
+ import { EventEmitter } from 'events';
3
+ import { FeathersApplication, ServiceMixin, Service, ServiceOptions, ServiceInterface, Application, FeathersService, ApplicationHookOptions } from './declarations';
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<ServiceTypes, AppSettings>, any>;
11
- private legacyHooks;
10
+ protected registerHooks: (this: any, allHooks: any) => any;
12
11
  constructor();
13
- get<L extends keyof AppSettings & string>(name: L): AppSettings[L];
14
- set<L extends keyof AppSettings & string>(name: L, value: AppSettings[L]): this;
12
+ get<L extends keyof Settings & string>(name: L): Settings[L];
13
+ set<L extends keyof Settings & string>(name: L, value: Settings[L]): this;
15
14
  configure(callback: (this: this, app: this) => void): this;
16
- defaultService(location: string): ServiceInterface<any>;
17
- service<L extends keyof ServiceTypes & string>(location: L): FeathersService<this, keyof any extends keyof ServiceTypes ? Service<any> : ServiceTypes[L]>;
18
- use<L extends keyof ServiceTypes & string>(path: L, service: keyof any extends keyof ServiceTypes ? ServiceInterface<any> | Application : ServiceTypes[L], options?: ServiceOptions): this;
19
- hooks(hookMap: HookOptions<this, any>): any;
20
- setup(): Promise<this>;
15
+ defaultService(location: string): ServiceInterface;
16
+ service<L extends keyof Services & string>(location: L): FeathersService<this, keyof any extends keyof Services ? Service : Services[L]>;
17
+ protected _setup(): Promise<this>;
18
+ get setup(): () => Promise<this>;
19
+ set setup(value: () => Promise<this>);
20
+ protected _teardown(): Promise<this>;
21
+ get teardown(): () => Promise<this>;
22
+ set teardown(value: () => Promise<this>);
23
+ use<L extends keyof Services & string>(path: L, service: keyof any extends keyof Services ? ServiceInterface | Application : Services[L], options?: ServiceOptions<keyof any extends keyof Services ? string : keyof Services[L]>): this;
24
+ unuse<L extends keyof Services & string>(location: L): Promise<FeathersService<this, keyof any extends keyof Services ? Service : Services[L]>>;
25
+ hooks(hookMap: ApplicationHookOptions<this>): this;
21
26
  }
@@ -5,24 +5,26 @@ 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 dependencies_1 = require("./dependencies");
9
- const events_1 = require("./events");
10
- const index_1 = require("./hooks/index");
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 legacy_1 = require("./hooks/legacy");
13
- const debug = dependencies_1.createDebug('@feathersjs/feathers');
14
- class Feathers extends dependencies_1.EventEmitter {
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 = [index_1.hookMixin, events_1.eventMixin];
21
+ this.mixins = [hooks_2.hookMixin, events_2.eventMixin];
20
22
  this.version = version_1.default;
21
23
  this._isSetup = false;
22
- this.appHooks = {
23
- [dependencies_1.HOOKS]: [events_1.eventHook]
24
- };
25
- this.legacyHooks = legacy_1.enableLegacyHooks(this);
24
+ this.registerHooks = (0, hooks_3.enableHooks)(this);
25
+ this.registerHooks({
26
+ around: [events_2.eventHook]
27
+ });
26
28
  }
27
29
  get(name) {
28
30
  return this.settings[name];
@@ -39,7 +41,7 @@ class Feathers extends dependencies_1.EventEmitter {
39
41
  throw new Error(`Can not find service '${location}'`);
40
42
  }
41
43
  service(location) {
42
- const path = (dependencies_1.stripSlashes(location) || '/');
44
+ const path = ((0, commons_1.stripSlashes)(location) || '/');
43
45
  const current = this.services[path];
44
46
  if (typeof current === 'undefined') {
45
47
  this.use(path, this.defaultService(path));
@@ -47,19 +49,63 @@ class Feathers extends dependencies_1.EventEmitter {
47
49
  }
48
50
  return current;
49
51
  }
52
+ _setup() {
53
+ this._isSetup = true;
54
+ return Object.keys(this.services)
55
+ .reduce((current, path) => current.then(() => {
56
+ const service = this.service(path);
57
+ if (typeof service.setup === 'function') {
58
+ debug(`Setting up service for \`${path}\``);
59
+ return service.setup(this, path);
60
+ }
61
+ }), Promise.resolve())
62
+ .then(() => this);
63
+ }
64
+ get setup() {
65
+ return this._setup;
66
+ }
67
+ set setup(value) {
68
+ this._setup = value[hooks_1.HOOKS]
69
+ ? value
70
+ : (0, hooks_1.hooks)(value, (0, hooks_1.middleware)().params('server').props({
71
+ app: this
72
+ }));
73
+ }
74
+ _teardown() {
75
+ this._isSetup = false;
76
+ return Object.keys(this.services)
77
+ .reduce((current, path) => current.then(() => {
78
+ const service = this.service(path);
79
+ if (typeof service.teardown === 'function') {
80
+ debug(`Tearing down service for \`${path}\``);
81
+ return service.teardown(this, path);
82
+ }
83
+ }), Promise.resolve())
84
+ .then(() => this);
85
+ }
86
+ get teardown() {
87
+ return this._teardown;
88
+ }
89
+ set teardown(value) {
90
+ this._teardown = value[hooks_1.HOOKS]
91
+ ? value
92
+ : (0, hooks_1.hooks)(value, (0, hooks_1.middleware)().params('server').props({
93
+ app: this
94
+ }));
95
+ }
50
96
  use(path, service, options) {
51
97
  if (typeof path !== 'string') {
52
98
  throw new Error(`'${path}' is not a valid service path.`);
53
99
  }
54
- const location = (dependencies_1.stripSlashes(path) || '/');
100
+ const location = ((0, commons_1.stripSlashes)(path) || '/');
55
101
  const subApp = service;
56
102
  const isSubApp = typeof subApp.service === 'function' && subApp.services;
57
103
  if (isSubApp) {
58
- Object.keys(subApp.services).forEach(subPath => this.use(`${location}/${subPath}`, subApp.service(subPath)));
104
+ Object.keys(subApp.services).forEach((subPath) => this.use(`${location}/${subPath}`, subApp.service(subPath)));
59
105
  return this;
60
106
  }
61
- const protoService = service_1.wrapService(location, service, options);
62
- const serviceOptions = service_1.getServiceOptions(service, options);
107
+ const protoService = (0, service_1.wrapService)(location, service, options);
108
+ const serviceOptions = (0, service_1.getServiceOptions)(protoService);
63
109
  for (const name of service_1.protectedMethods) {
64
110
  if (serviceOptions.methods.includes(name)) {
65
111
  throw new Error(`'${name}' on service '${location}' is not allowed as a custom method name`);
@@ -67,49 +113,42 @@ class Feathers extends dependencies_1.EventEmitter {
67
113
  }
68
114
  debug(`Registering new service at \`${location}\``);
69
115
  // Add all the mixins
70
- this.mixins.forEach(fn => fn.call(this, protoService, location, serviceOptions));
116
+ this.mixins.forEach((fn) => fn.call(this, protoService, location, serviceOptions));
117
+ this.services[location] = protoService;
71
118
  // If we ran setup already, set this service up explicitly, this will not `await`
72
119
  if (this._isSetup && typeof protoService.setup === 'function') {
73
120
  debug(`Setting up service for \`${location}\``);
74
121
  protoService.setup(this, location);
75
122
  }
76
- this.services[location] = protoService;
77
123
  return this;
78
124
  }
125
+ async unuse(location) {
126
+ const path = ((0, commons_1.stripSlashes)(location) || '/');
127
+ const service = this.services[path];
128
+ if (service && typeof service.teardown === 'function') {
129
+ await service.teardown(this, path);
130
+ }
131
+ delete this.services[path];
132
+ return service;
133
+ }
79
134
  hooks(hookMap) {
80
- const legacyMap = hookMap;
81
- if (legacyMap.before || legacyMap.after || legacyMap.error) {
82
- return this.legacyHooks(legacyMap);
135
+ const untypedMap = hookMap;
136
+ if (untypedMap.before || untypedMap.after || untypedMap.error || untypedMap.around) {
137
+ // regular hooks for all service methods
138
+ this.registerHooks(untypedMap);
83
139
  }
84
- if (Array.isArray(hookMap)) {
85
- this.appHooks[dependencies_1.HOOKS].push(...hookMap);
140
+ else if (untypedMap.setup || untypedMap.teardown) {
141
+ // .setup and .teardown application hooks
142
+ (0, hooks_1.hooks)(this, untypedMap);
86
143
  }
87
144
  else {
88
- const methodHookMap = hookMap;
89
- Object.keys(methodHookMap).forEach(key => {
90
- const methodHooks = this.appHooks[key] || [];
91
- this.appHooks[key] = methodHooks.concat(methodHookMap[key]);
145
+ // Other registration formats are just `around` hooks
146
+ this.registerHooks({
147
+ around: untypedMap
92
148
  });
93
149
  }
94
150
  return this;
95
151
  }
96
- setup() {
97
- let promise = Promise.resolve();
98
- // Setup each service (pass the app so that they can look up other services etc.)
99
- for (const path of Object.keys(this.services)) {
100
- promise = promise.then(() => {
101
- const service = this.service(path);
102
- if (typeof service.setup === 'function') {
103
- debug(`Setting up service for \`${path}\``);
104
- return service.setup(this, path);
105
- }
106
- });
107
- }
108
- return promise.then(() => {
109
- this._isSetup = true;
110
- return this;
111
- });
112
- }
113
152
  }
114
153
  exports.Feathers = Feathers;
115
154
  //# sourceMappingURL=application.js.map
@@ -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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