@feathersjs/transport-commons 5.0.0-pre.33 → 5.0.0-pre.34
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 +6 -0
- package/lib/channels/mixins.d.ts +2 -2
- package/lib/channels/mixins.js +1 -1
- package/lib/channels/mixins.js.map +1 -1
- package/lib/client.d.ts +1 -1
- package/package.json +9 -9
- package/src/channels/mixins.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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.34](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.33...v5.0.0-pre.34) (2022-12-14)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **core:** Improve service option usage and method option typings ([#2902](https://github.com/feathersjs/feathers/issues/2902)) ([164d75c](https://github.com/feathersjs/feathers/commit/164d75c0f11139a316baa91f1762de8f8eb7da2d))
|
|
11
|
+
|
|
6
12
|
# [5.0.0-pre.33](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.32...v5.0.0-pre.33) (2022-11-08)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @feathersjs/transport-commons
|
package/lib/channels/mixins.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export interface ChannelMixin {
|
|
|
15
15
|
channel(...names: string[]): Channel;
|
|
16
16
|
}
|
|
17
17
|
export declare function channelMixin(): ChannelMixin;
|
|
18
|
-
export
|
|
19
|
-
export
|
|
18
|
+
export type Event = string | typeof ALL_EVENTS;
|
|
19
|
+
export type Publisher<T = any, A = Application, S = any> = (data: T, context: HookContext<A, S>) => Channel | Channel[] | void | Promise<Channel | Channel[] | void>;
|
|
20
20
|
export interface PublishMixin<T = any> {
|
|
21
21
|
[PUBLISHERS]: {
|
|
22
22
|
[ALL_EVENTS]?: Publisher<T>;
|
package/lib/channels/mixins.js
CHANGED
|
@@ -57,7 +57,7 @@ function publishMixin() {
|
|
|
57
57
|
publisher = event;
|
|
58
58
|
event = ALL_EVENTS;
|
|
59
59
|
}
|
|
60
|
-
const { serviceEvents } = (0, feathers_1.getServiceOptions)(this);
|
|
60
|
+
const { serviceEvents = feathers_1.defaultServiceEvents } = (0, feathers_1.getServiceOptions)(this) || {};
|
|
61
61
|
if (event !== ALL_EVENTS && !serviceEvents.includes(event)) {
|
|
62
62
|
throw new Error(`'${event.toString()}' is not a valid service event`);
|
|
63
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mixins.js","sourceRoot":"","sources":["../../src/channels/mixins.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"mixins.js","sourceRoot":"","sources":["../../src/channels/mixins.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,mDAAwG;AACxG,iDAAiD;AACjD,yCAAwC;AACxC,iDAAoD;AAEpD,MAAM,KAAK,GAAG,IAAA,qBAAW,EAAC,+CAA+C,CAAC,CAAA;AAC1E,MAAM,UAAU,GAAG,MAAM,CAAC,0CAA0C,CAAC,CAAA;AACrE,MAAM,QAAQ,GAAG,MAAM,CAAC,wCAAwC,CAAC,CAAA;AACjE,MAAM,UAAU,GAAG,MAAM,CAAC,0CAA0C,CAAC,CAAA;AAExD,QAAA,IAAI,GAAG;IAClB,UAAU,EAAE,UAA+B;IAC3C,QAAQ,EAAE,QAA2B;IACrC,UAAU,EAAE,UAA+B;CAC5C,CAAA;AAOD,SAAgB,YAAY;IAC1B,MAAM,KAAK,GAAiB;QAC1B,CAAC,QAAQ,CAAC,EAAE,EAAE;QAEd,OAAO,CAAC,GAAG,KAAe;YACxB,KAAK,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAA;YAElC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;gBACtB,M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K,CAAC,CAAA;YAErC,IAAI,CAAC,SAAS,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;gBAC7C,SAAS,GAAG,KAAK,CAAA;gBACjB,KAAK,GAAG,UAAU,CAAA;aACnB;YAED,MAAM,EAAE,aAAa,GAAG,+BAAoB,EAAE,GAAG,IAAA,4BAAiB,EAAC,IAAI,CAAC,IAAI,EAAE,CAAA;YAE9E,IAAI,KAAK,KAAK,UAAU,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;gBAC1D,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,gCAAgC,CAAC,CAAA;aACtE;YAED,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,CAAA;YAEnC,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS,CAAA;YAE7B,OAAO,IAAI,CAAA;QACb,CAAC;KACF,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AA/BD,oCA+BC"}
|
package/lib/client.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ interface ServiceOptions {
|
|
|
5
5
|
method: string;
|
|
6
6
|
events?: string[];
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export type SocketService<T = any, D = Partial<any>, P extends Params = Params> = Service<T, D, P>;
|
|
9
9
|
export declare class Service<T = any, D = Partial<T>, P extends Params = Params> implements ServiceInterface<T, D, P> {
|
|
10
10
|
events: string[];
|
|
11
11
|
path: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feathersjs/transport-commons",
|
|
3
3
|
"description": "Shared functionality for websocket providers",
|
|
4
|
-
"version": "5.0.0-pre.
|
|
4
|
+
"version": "5.0.0-pre.34",
|
|
5
5
|
"homepage": "https://feathersjs.com",
|
|
6
6
|
"main": "lib/",
|
|
7
7
|
"types": "lib/",
|
|
@@ -54,21 +54,21 @@
|
|
|
54
54
|
"*.js"
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@feathersjs/commons": "^5.0.0-pre.
|
|
58
|
-
"@feathersjs/errors": "^5.0.0-pre.
|
|
59
|
-
"@feathersjs/feathers": "^5.0.0-pre.
|
|
57
|
+
"@feathersjs/commons": "^5.0.0-pre.34",
|
|
58
|
+
"@feathersjs/errors": "^5.0.0-pre.34",
|
|
59
|
+
"@feathersjs/feathers": "^5.0.0-pre.34",
|
|
60
60
|
"encodeurl": "^1.0.2",
|
|
61
61
|
"lodash": "^4.17.21"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@types/encodeurl": "^1.0.0",
|
|
65
|
-
"@types/lodash": "^4.14.
|
|
66
|
-
"@types/mocha": "^10.0.
|
|
67
|
-
"@types/node": "^18.11.
|
|
65
|
+
"@types/lodash": "^4.14.191",
|
|
66
|
+
"@types/mocha": "^10.0.1",
|
|
67
|
+
"@types/node": "^18.11.10",
|
|
68
68
|
"mocha": "^10.1.0",
|
|
69
69
|
"shx": "^0.3.4",
|
|
70
70
|
"ts-node": "^10.9.1",
|
|
71
|
-
"typescript": "^4.
|
|
71
|
+
"typescript": "^4.9.3"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "42cca600d00f0b3b9d89fa79be30fcd46bc50132"
|
|
74
74
|
}
|
package/src/channels/mixins.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
|
|
2
|
-
import { Application, HookContext, getServiceOptions } from '@feathersjs/feathers'
|
|
2
|
+
import { Application, HookContext, getServiceOptions, defaultServiceEvents } from '@feathersjs/feathers'
|
|
3
3
|
import { createDebug } from '@feathersjs/commons'
|
|
4
4
|
import { Channel } from './channel/base'
|
|
5
5
|
import { CombinedChannel } from './channel/combined'
|
|
@@ -90,7 +90,7 @@ export function publishMixin() {
|
|
|
90
90
|
event = ALL_EVENTS
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
const { serviceEvents } = getServiceOptions(this)
|
|
93
|
+
const { serviceEvents = defaultServiceEvents } = getServiceOptions(this) || {}
|
|
94
94
|
|
|
95
95
|
if (event !== ALL_EVENTS && !serviceEvents.includes(event)) {
|
|
96
96
|
throw new Error(`'${event.toString()}' is not a valid service event`)
|