@feathersjs/socketio-client 5.0.0-pre.23 → 5.0.0-pre.24

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,17 @@
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.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21)
7
+
8
+
9
+ ### Features
10
+
11
+ * **cli:** Add typed client to a generated app ([#2669](https://github.com/feathersjs/feathers/issues/2669)) ([5b801b5](https://github.com/feathersjs/feathers/commit/5b801b5017ddc3eaa95622b539f51d605916bc86))
12
+
13
+
14
+
15
+
16
+
6
17
  # [5.0.0-pre.23](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.22...v5.0.0-pre.23) (2022-06-06)
7
18
 
8
19
 
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { Service, SocketService } from '@feathersjs/transport-commons/client';
1
+ import { SocketService } from '@feathersjs/transport-commons/client';
2
2
  import { Socket } from 'socket.io-client';
3
- import { Application } from '@feathersjs/feathers';
3
+ import { TransportConnection } from '@feathersjs/feathers';
4
4
  export { SocketService };
5
5
  declare module '@feathersjs/feathers/lib/declarations' {
6
6
  interface FeathersApplication<Services, Settings> {
@@ -11,8 +11,4 @@ declare module '@feathersjs/feathers/lib/declarations' {
11
11
  io?: Socket;
12
12
  }
13
13
  }
14
- export default function socketioClient(connection: Socket, options?: any): {
15
- (app: Application): void;
16
- Service: typeof Service;
17
- service: (this: any, name: string) => any;
18
- };
14
+ export default function socketioClient<Services = any>(connection: Socket, options?: any): TransportConnection<Services>;
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,iEAA6E;AAE7E,mDAA0F;AAc1F,SA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;gBAE7F,OAAO,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC,CAAA;aAClC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,UAAU,CAAC,OAAO,GAAG,gBAAO,CAAA;IAC5B,UAAU,CAAC,OAAO,GAAG,cAAc,CAAA;IAEnC,OAAO,UAA2C,CAAA;AACpD,CAAC;AArCD,iCAqCC;AAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;CAC/D"}
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.23",
4
+ "version": "5.0.0-pre.24",
5
5
  "homepage": "https://feathersjs.com",
6
6
  "main": "lib/",
7
7
  "types": "lib/",
@@ -53,14 +53,14 @@
53
53
  "access": "public"
54
54
  },
55
55
  "dependencies": {
56
- "@feathersjs/transport-commons": "^5.0.0-pre.23"
56
+ "@feathersjs/transport-commons": "^5.0.0-pre.24"
57
57
  },
58
58
  "devDependencies": {
59
- "@feathersjs/commons": "^5.0.0-pre.23",
60
- "@feathersjs/feathers": "^5.0.0-pre.23",
61
- "@feathersjs/memory": "^5.0.0-pre.23",
62
- "@feathersjs/socketio": "^5.0.0-pre.23",
63
- "@feathersjs/tests": "^5.0.0-pre.23",
59
+ "@feathersjs/commons": "^5.0.0-pre.24",
60
+ "@feathersjs/feathers": "^5.0.0-pre.24",
61
+ "@feathersjs/memory": "^5.0.0-pre.24",
62
+ "@feathersjs/socketio": "^5.0.0-pre.24",
63
+ "@feathersjs/tests": "^5.0.0-pre.24",
64
64
  "@types/mocha": "^9.1.1",
65
65
  "@types/node": "^17.0.40",
66
66
  "mocha": "^10.0.0",
@@ -69,5 +69,5 @@
69
69
  "ts-node": "^10.8.1",
70
70
  "typescript": "^4.7.3"
71
71
  },
72
- "gitHead": "a60910bd730b88053ca6648337095f1ca1e3b39f"
72
+ "gitHead": "72779fa2938f43d7b345b6861ff0035481a07de3"
73
73
  }
package/src/index.ts CHANGED
@@ -1,6 +1,11 @@
1
1
  import { Service, SocketService } from '@feathersjs/transport-commons/client'
2
2
  import { Socket } from 'socket.io-client'
3
- import { Application, defaultEventMap, defaultServiceMethods } from '@feathersjs/feathers'
3
+ import {
4
+ Application,
5
+ TransportConnection,
6
+ defaultEventMap,
7
+ defaultServiceMethods
8
+ } from '@feathersjs/feathers'
4
9
 
5
10
  export { SocketService }
6
11
 
@@ -14,7 +19,7 @@ declare module '@feathersjs/feathers/lib/declarations' {
14
19
  }
15
20
  }
16
21
 
17
- export default function socketioClient(connection: Socket, options?: any) {
22
+ export default function socketioClient<Services = any>(connection: Socket, options?: any) {
18
23
  if (!connection) {
19
24
  throw new Error('Socket.io connection needs to be provided')
20
25
  }
@@ -31,7 +36,7 @@ export default function socketioClient(connection: Socket, options?: any) {
31
36
  return new Service(settings) as any
32
37
  }
33
38
 
34
- const initialize = function (app: Application) {
39
+ const initialize = function (app: Application<Services>) {
35
40
  if (app.io !== undefined) {
36
41
  throw new Error('Only one default client provider can be configured')
37
42
  }
@@ -50,7 +55,7 @@ export default function socketioClient(connection: Socket, options?: any) {
50
55
  initialize.Service = Service
51
56
  initialize.service = defaultService
52
57
 
53
- return initialize
58
+ return initialize as TransportConnection<Services>
54
59
  }
55
60
 
56
61
  if (typeof module !== 'undefined') {