@veryfront/ext-node-websocket-ws 0.1.1289-rc.26244 → 0.1.1289-rc.26253

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.
@@ -0,0 +1,4 @@
1
+ /** Pinned pure-JavaScript ws transport with no host environment or native addon reads. */
2
+ import "./_dnt.polyfills.js";
3
+ export declare const PortableWsNodeWebSocketServerProvider: any;
4
+ //# sourceMappingURL=portable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portable.d.ts","sourceRoot":"","sources":["../src/portable.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,qBAAqB,CAAC;AAM7B,eAAO,MAAM,qCAAqC,KAA+C,CAAC"}
@@ -0,0 +1,6 @@
1
+ /** Pinned pure-JavaScript ws transport with no host environment or native addon reads. */
2
+ import "./_dnt.polyfills.js";
3
+ // @ts-types="@types/ws"
4
+ import { WebSocket, WebSocketServer } from "./portable-runtime.generated.js";
5
+ import { createWsProvider } from "./provider.js";
6
+ export const PortableWsNodeWebSocketServerProvider = createWsProvider(WebSocketServer, WebSocket);
@@ -0,0 +1,4 @@
1
+ import type { WebSocket, WebSocketServer } from "ws";
2
+ /** Preserve the transport contract for both native-optimized and portable ws. */
3
+ export declare function createWsProvider(Server: typeof WebSocketServer, Connection: typeof WebSocket): any;
4
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAMrD,iFAAiF;AACjF,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,OAAO,eAAe,EAC9B,UAAU,EAAE,OAAO,SAAS,OAY7B"}
@@ -0,0 +1,12 @@
1
+ import { captureNodeWebSocketServer, createNodeWebSocketServerProvider, } from "veryfront/extensions/websocket";
2
+ /** Preserve the transport contract for both native-optimized and portable ws. */
3
+ export function createWsProvider(Server, Connection) {
4
+ return createNodeWebSocketServerProvider((options) => captureNodeWebSocketServer(new Server(options)), {
5
+ supportsIdleTimeout: true,
6
+ getBufferedAmount(connection) {
7
+ if (!(connection instanceof Connection))
8
+ throw new TypeError("Unknown ws connection");
9
+ return connection.bufferedAmount;
10
+ },
11
+ });
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veryfront/ext-node-websocket-ws",
3
- "version": "0.1.1289-rc.26244",
3
+ "version": "0.1.1289-rc.26253",
4
4
  "description": "Veryfront first-party extension package for ext-node-websocket-ws",
5
5
  "keywords": [
6
6
  "veryfront",
@@ -23,6 +23,10 @@
23
23
  ".": {
24
24
  "import": "./esm/index.js",
25
25
  "types": "./esm/index.d.ts"
26
+ },
27
+ "./portable": {
28
+ "import": "./esm/portable.js",
29
+ "types": "./esm/portable.d.ts"
26
30
  }
27
31
  },
28
32
  "scripts": {},
@@ -55,7 +59,7 @@
55
59
  "ws": "8.21.1"
56
60
  },
57
61
  "peerDependencies": {
58
- "veryfront": "^0.1.1289-rc.26244"
62
+ "veryfront": "^0.1.1289-rc.26253"
59
63
  },
60
64
  "type": "module",
61
65
  "types": "./esm/index.d.ts",
@@ -65,5 +69,5 @@
65
69
  "NOTICE",
66
70
  "README.md"
67
71
  ],
68
- "gitHead": "0de123dbdd1001f0d1283630b67197807495562c"
72
+ "gitHead": "330ae64e9b7576d0b088727030170fd4ac48ebde"
69
73
  }