@feathersjs/socketio-client 5.0.0-pre.1 → 5.0.0-pre.15

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,6 +3,157 @@
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.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **typescript:** Overall typing improvements ([#2478](https://github.com/feathersjs/feathers/issues/2478)) ([b8eb804](https://github.com/feathersjs/feathers/commit/b8eb804158556d9651a8607e3c3fda15e0bfd110))
12
+
13
+
14
+
15
+
16
+
17
+ # [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13)
18
+
19
+ **Note:** Version bump only for package @feathersjs/socketio-client
20
+
21
+
22
+
23
+
24
+
25
+ # [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13)
26
+
27
+ **Note:** Version bump only for package @feathersjs/socketio-client
28
+
29
+
30
+
31
+
32
+
33
+ # [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12)
34
+
35
+ **Note:** Version bump only for package @feathersjs/socketio-client
36
+
37
+
38
+
39
+
40
+
41
+ # [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06)
42
+
43
+ **Note:** Version bump only for package @feathersjs/socketio-client
44
+
45
+
46
+
47
+
48
+
49
+ # [5.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.9...v5.0.0-pre.10) (2021-09-19)
50
+
51
+ **Note:** Version bump only for package @feathersjs/socketio-client
52
+
53
+
54
+
55
+
56
+
57
+ # [5.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.8...v5.0.0-pre.9) (2021-08-09)
58
+
59
+ **Note:** Version bump only for package @feathersjs/socketio-client
60
+
61
+
62
+
63
+
64
+
65
+ # [5.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.7...v5.0.0-pre.8) (2021-08-09)
66
+
67
+ **Note:** Version bump only for package @feathersjs/socketio-client
68
+
69
+
70
+
71
+
72
+
73
+ # [5.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.6...v5.0.0-pre.7) (2021-08-09)
74
+
75
+ **Note:** Version bump only for package @feathersjs/socketio-client
76
+
77
+
78
+
79
+
80
+
81
+ # [5.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.5...v5.0.0-pre.6) (2021-08-08)
82
+
83
+ **Note:** Version bump only for package @feathersjs/socketio-client
84
+
85
+
86
+
87
+
88
+
89
+ # [5.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.4...v5.0.0-pre.5) (2021-06-23)
90
+
91
+
92
+ ### Features
93
+
94
+ * **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))
95
+
96
+
97
+
98
+
99
+
100
+ # [5.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.3...v5.0.0-pre.4) (2021-05-13)
101
+
102
+ **Note:** Version bump only for package @feathersjs/socketio-client
103
+
104
+
105
+
106
+
107
+
108
+ # [5.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.2...v5.0.0-pre.3) (2021-04-21)
109
+
110
+
111
+ ### Bug Fixes
112
+
113
+ * **typescript:** Improve TypeScript backwards compatibility ([#2310](https://github.com/feathersjs/feathers/issues/2310)) ([f33be73](https://github.com/feathersjs/feathers/commit/f33be73fc46a533efb15df9aab0658e3240d3897))
114
+
115
+
116
+
117
+
118
+
119
+ # [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06)
120
+
121
+ **Note:** Version bump only for package @feathersjs/socketio-client
122
+
123
+
124
+
125
+
126
+
127
+ # [5.0.0-beta.1](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2021-04-03)
128
+
129
+
130
+ ### Bug Fixes
131
+
132
+ * **dependencies:** Fix transport-commons dependency and update other dependencies ([#2284](https://github.com/feathersjs/feathers/issues/2284)) ([05b03b2](https://github.com/feathersjs/feathers/commit/05b03b27b40604d956047e3021d8053c3a137616))
133
+
134
+
135
+
136
+
137
+
138
+ # [5.0.0-beta.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.1...v5.0.0-beta.0) (2021-03-28)
139
+
140
+
141
+ ### Bug Fixes
142
+
143
+ * Update Grant usage and other dependencies ([#2264](https://github.com/feathersjs/feathers/issues/2264)) ([7b0f8fa](https://github.com/feathersjs/feathers/commit/7b0f8fad252419ed0ad0bf259cdf3104d322ab60))
144
+ * **socketio-client:** Fix client transport-commons reference ([#2164](https://github.com/feathersjs/feathers/issues/2164)) ([3a42c54](https://github.com/feathersjs/feathers/commit/3a42c544058456b19c7e21827226541bfa6ad621))
145
+
146
+
147
+ ### Features
148
+
149
+ * **core:** Public custom service methods ([#2270](https://github.com/feathersjs/feathers/issues/2270)) ([e65abfb](https://github.com/feathersjs/feathers/commit/e65abfb5388df6c19a11c565cf1076a29f32668d))
150
+ * Feathers v5 core refactoring and features ([#2255](https://github.com/feathersjs/feathers/issues/2255)) ([2dafb7c](https://github.com/feathersjs/feathers/commit/2dafb7ce14ba57406aeec13d10ca45b1e709bee9))
151
+ * **transport-commons:** New built-in high performance radix router ([#2177](https://github.com/feathersjs/feathers/issues/2177)) ([6d18065](https://github.com/feathersjs/feathers/commit/6d180651b4eb40289ecea3df3575f207aa6c5d1f))
152
+
153
+
154
+
155
+
156
+
6
157
  # [5.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.5.11...v5.0.0-pre.1) (2020-12-17)
7
158
 
8
159
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020 Feathers
3
+ Copyright (c) 2021 Feathers
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
package/README.md CHANGED
@@ -18,6 +18,6 @@ Refer to the [Feathers SocketIO API documentation](https://docs.feathersjs.com/a
18
18
 
19
19
  ## License
20
20
 
21
- Copyright (c) 2020 [Feathers contributors](https://github.com/feathersjs/client/graphs/contributors)
21
+ Copyright (c) 2021 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors)
22
22
 
23
23
  Licensed under the [MIT license](LICENSE).
package/lib/index.d.ts CHANGED
@@ -1,11 +1,8 @@
1
- import { Service } from '@feathersjs/transport-commons/src/client';
1
+ import { Service, SocketService } from '@feathersjs/transport-commons/client';
2
2
  import { Socket } from 'socket.io-client';
3
- interface SocketIOClientOptions {
4
- timeout?: number;
5
- }
6
- declare function socketioClient(connection: Socket, options?: SocketIOClientOptions): {
3
+ export { SocketService };
4
+ export default function socketioClient(connection: Socket, options?: any): {
7
5
  (app: any): void;
8
6
  Service: typeof Service;
9
- service: (this: any, name: string) => Service;
7
+ service: (this: any, name: string) => Service<any, Partial<any>>;
10
8
  };
11
- export = socketioClient;
package/lib/index.js CHANGED
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
- const client_1 = require("@feathersjs/transport-commons/src/client");
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const client_1 = require("@feathersjs/transport-commons/client");
4
+ const feathers_1 = require("@feathersjs/feathers");
3
5
  function socketioClient(connection, options) {
4
6
  if (!connection) {
5
7
  throw new Error('Socket.io connection needs to be provided');
6
8
  }
7
9
  const defaultService = function (name) {
8
- const events = Object.keys(this.eventMappings || {})
9
- .map(method => this.eventMappings[method]);
10
+ const events = Object.values(feathers_1.defaultEventMap);
10
11
  const settings = Object.assign({}, options, {
11
12
  events,
12
13
  name,
@@ -16,7 +17,7 @@ function socketioClient(connection, options) {
16
17
  return new client_1.Service(settings);
17
18
  };
18
19
  const initialize = function (app) {
19
- if (typeof app.defaultService === 'function') {
20
+ if (app.io !== undefined) {
20
21
  throw new Error('Only one default client provider can be configured');
21
22
  }
22
23
  app.io = connection;
@@ -26,5 +27,8 @@ function socketioClient(connection, options) {
26
27
  initialize.service = defaultService;
27
28
  return initialize;
28
29
  }
29
- module.exports = socketioClient;
30
+ exports.default = socketioClient;
31
+ if (typeof module !== 'undefined') {
32
+ module.exports = Object.assign(socketioClient, module.exports);
33
+ }
30
34
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qEAAmE;AAOnE,SAAS,cAAc,CAAE,UAAkB,EAAE,OAA+B;IAC1E,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;KAC9D;IAED,MAAM,cAAc,GAAG,UAAqB,IAAY;QACtD,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC;aACjD,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;QAE7C,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE;YAC1C,MAAM;YACN,IAAI;YACJ,UAAU;YACV,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;QAEH,OAAO,IAAI,gBAAO,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,UAAU,GAAQ;QACn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CAAC;IAEpC,OAAO,UAAU,CAAC;AACpB,CAAC;AA9BD,iCA8BC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;CAChE"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@feathersjs/socketio-client",
3
3
  "description": "The client for Socket.io through feathers-socketio",
4
- "version": "5.0.0-pre.1",
4
+ "version": "5.0.0-pre.15",
5
5
  "homepage": "https://feathersjs.com",
6
6
  "main": "lib/index.js",
7
7
  "keywords": [
@@ -27,7 +27,7 @@
27
27
  "url": "https://github.com/feathersjs/feathers/issues"
28
28
  },
29
29
  "engines": {
30
- "node": ">= 10"
30
+ "node": ">= 12"
31
31
  },
32
32
  "scripts": {
33
33
  "prepublish": "npm run compile",
@@ -50,22 +50,21 @@
50
50
  "access": "public"
51
51
  },
52
52
  "dependencies": {
53
- "@feathersjs/transport-commons": "^5.0.0-pre.1"
53
+ "@feathersjs/transport-commons": "^5.0.0-pre.15"
54
54
  },
55
55
  "devDependencies": {
56
- "@feathersjs/adapter-memory": "^5.0.0-pre.1",
57
- "@feathersjs/commons": "^5.0.0-pre.1",
58
- "@feathersjs/feathers": "^5.0.0-pre.1",
59
- "@feathersjs/socketio": "^5.0.0-pre.1",
60
- "@feathersjs/tests": "^5.0.0-pre.1",
61
- "@feathersjs/transport-commons": "^5.0.0-pre.0",
62
- "@types/mocha": "^8.0.4",
63
- "@types/node": "^14.14.10",
64
- "mocha": "^8.2.1",
56
+ "@feathersjs/commons": "^5.0.0-pre.15",
57
+ "@feathersjs/feathers": "^5.0.0-pre.15",
58
+ "@feathersjs/memory": "^5.0.0-pre.15",
59
+ "@feathersjs/socketio": "^5.0.0-pre.15",
60
+ "@feathersjs/tests": "^5.0.0-pre.15",
61
+ "@types/mocha": "^9.0.0",
62
+ "@types/node": "^16.11.6",
63
+ "mocha": "^9.1.3",
65
64
  "shx": "^0.3.3",
66
- "socket.io-client": "^3.0.3",
67
- "ts-node": "^9.1.0",
68
- "typescript": "^4.1.2"
65
+ "socket.io-client": "^4.3.2",
66
+ "ts-node": "^10.4.0",
67
+ "typescript": "^4.4.4"
69
68
  },
70
- "gitHead": "3756506935c520fc50d4be416ff649c2158afdac"
69
+ "gitHead": "8008bf4f8529a2a40b6a2f976c1f43ae13675693"
71
70
  }
package/src/index.ts CHANGED
@@ -1,19 +1,16 @@
1
- import { Service } from '@feathersjs/transport-commons/src/client';
1
+ import { Service, SocketService } from '@feathersjs/transport-commons/client';
2
2
  import { Socket } from 'socket.io-client';
3
+ import { defaultEventMap } from '@feathersjs/feathers';
3
4
 
4
- interface SocketIOClientOptions {
5
- timeout?: number;
6
- }
5
+ export { SocketService };
7
6
 
8
- function socketioClient (connection: Socket, options?: SocketIOClientOptions) {
7
+ export default function socketioClient (connection: Socket, options?: any) {
9
8
  if (!connection) {
10
9
  throw new Error('Socket.io connection needs to be provided');
11
10
  }
12
11
 
13
12
  const defaultService = function (this: any, name: string) {
14
- const events = Object.keys(this.eventMappings || {})
15
- .map(method => this.eventMappings[method]);
16
-
13
+ const events = Object.values(defaultEventMap);
17
14
  const settings = Object.assign({}, options, {
18
15
  events,
19
16
  name,
@@ -25,7 +22,7 @@ function socketioClient (connection: Socket, options?: SocketIOClientOptions) {
25
22
  };
26
23
 
27
24
  const initialize = function (app: any) {
28
- if (typeof app.defaultService === 'function') {
25
+ if (app.io !== undefined) {
29
26
  throw new Error('Only one default client provider can be configured');
30
27
  }
31
28
 
@@ -39,4 +36,6 @@ function socketioClient (connection: Socket, options?: SocketIOClientOptions) {
39
36
  return initialize;
40
37
  }
41
38
 
42
- export = socketioClient;
39
+ if (typeof module !== 'undefined') {
40
+ module.exports = Object.assign(socketioClient, module.exports);
41
+ }