@tsed/graphql-ws 7.79.4 → 7.80.1
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/lib/cjs/GraphQLWSModule.js +4 -3
- package/lib/cjs/GraphQLWSModule.js.map +1 -1
- package/lib/esm/GraphQLWSModule.js +4 -3
- package/lib/esm/GraphQLWSModule.js.map +1 -1
- package/lib/types/GraphQLWSModule.d.ts +2 -1
- package/lib/types-esm/GraphQLWSModule.d.ts +10 -0
- package/lib/types-esm/GraphQLWSOptions.d.ts +16 -0
- package/lib/types-esm/index.d.ts +5 -0
- package/package.json +18 -15
- package/lib/cjs/package.json +0 -3
- package/lib/esm/package.json +0 -3
- package/tsconfig.esm.json +0 -39
|
@@ -6,14 +6,15 @@ const di_1 = require("@tsed/di");
|
|
|
6
6
|
const ws_1 = require("graphql-ws/lib/use/ws");
|
|
7
7
|
const http_1 = tslib_1.__importDefault(require("http"));
|
|
8
8
|
const https_1 = tslib_1.__importDefault(require("https"));
|
|
9
|
-
const ws_2 = require("ws");
|
|
10
9
|
let GraphQLWSModule = class GraphQLWSModule {
|
|
11
10
|
settings;
|
|
12
11
|
httpServer;
|
|
13
12
|
httpsServer;
|
|
14
13
|
injector;
|
|
15
|
-
createWSServer(settings) {
|
|
16
|
-
|
|
14
|
+
async createWSServer(settings) {
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
const { WebSocketServer } = await import("ws");
|
|
17
|
+
const wsServer = new WebSocketServer({
|
|
17
18
|
...(this.settings.wsServerOptions || {}),
|
|
18
19
|
...settings.wsServerOptions,
|
|
19
20
|
server: this.httpsServer || this.httpServer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphQLWSModule.js","sourceRoot":"","sources":["../../src/GraphQLWSModule.ts"],"names":[],"mappings":";;;;AAAA,iCAAmE;
|
|
1
|
+
{"version":3,"file":"GraphQLWSModule.js","sourceRoot":"","sources":["../../src/GraphQLWSModule.ts"],"names":[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IAAA,aAAQ,EAAC,WAAW,EAAE,EAAE,CAAC;;iDACS;AAEnC;IAAC,IAAA,WAAM,EAAC,cAAI,CAAC,MAAM,CAAC;;mDACmB;AAEvC;IAAC,IAAA,WAAM,EAAC,eAAK,CAAC,MAAM,CAAC;;oDACoB;AAEzC;IAAC,IAAA,WAAM,GAAE;sCACS,oBAAe;iDAAC;AAXvB,eAAe;IAD3B,IAAA,WAAM,GAAE;GACI,eAAe,CAiD3B;AAjDY,0CAAe"}
|
|
@@ -3,14 +3,15 @@ import { Constant, Inject, InjectorService, Module } from "@tsed/di";
|
|
|
3
3
|
import { useServer } from "graphql-ws/lib/use/ws";
|
|
4
4
|
import Http from "http";
|
|
5
5
|
import Https from "https";
|
|
6
|
-
import { Server } from "ws";
|
|
7
6
|
let GraphQLWSModule = class GraphQLWSModule {
|
|
8
7
|
settings;
|
|
9
8
|
httpServer;
|
|
10
9
|
httpsServer;
|
|
11
10
|
injector;
|
|
12
|
-
createWSServer(settings) {
|
|
13
|
-
|
|
11
|
+
async createWSServer(settings) {
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
const { WebSocketServer } = await import("ws");
|
|
14
|
+
const wsServer = new WebSocketServer({
|
|
14
15
|
...(this.settings.wsServerOptions || {}),
|
|
15
16
|
...settings.wsServerOptions,
|
|
16
17
|
server: this.httpsServer || this.httpServer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphQLWSModule.js","sourceRoot":"","sources":["../../src/GraphQLWSModule.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"GraphQLWSModule.js","sourceRoot":"","sources":["../../src/GraphQLWSModule.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAC,MAAM,UAAU,CAAC;AAEnE,OAAO,EAAC,SAAS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ACF,CAAA;AAhDC;IAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;;iDACS;AAEnC;IAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;;mDACmB;AAEvC;IAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;;oDACoB;AAEzC;IAAC,MAAM,EAAE;8BACS,eAAe;iDAAC;AAXvB,eAAe;IAD3B,MAAM,EAAE;GACI,eAAe,CAiD3B;SAjDY,eAAe"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { Disposable } from "graphql-ws";
|
|
1
2
|
import { GraphQLWSOptions } from "./GraphQLWSOptions.js";
|
|
2
3
|
export declare class GraphQLWSModule {
|
|
3
4
|
private settings;
|
|
4
5
|
private httpServer;
|
|
5
6
|
private httpsServer;
|
|
6
7
|
private injector;
|
|
7
|
-
createWSServer(settings: GraphQLWSOptions):
|
|
8
|
+
createWSServer(settings: GraphQLWSOptions): Promise<Disposable>;
|
|
8
9
|
$alterApolloServerPlugins(plugins: any[], settings: GraphQLWSOptions): Promise<any[]>;
|
|
9
10
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Disposable } from "graphql-ws";
|
|
2
|
+
import { GraphQLWSOptions } from "./GraphQLWSOptions.js";
|
|
3
|
+
export declare class GraphQLWSModule {
|
|
4
|
+
private settings;
|
|
5
|
+
private httpServer;
|
|
6
|
+
private httpsServer;
|
|
7
|
+
private injector;
|
|
8
|
+
createWSServer(settings: GraphQLWSOptions): Promise<Disposable>;
|
|
9
|
+
$alterApolloServerPlugins(plugins: any[], settings: GraphQLWSOptions): Promise<any[]>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ServerOptions } from "graphql-ws/lib/server";
|
|
2
|
+
import { ServerOptions as WSServerOptions } from "ws";
|
|
3
|
+
export interface GraphQLWSOptions {
|
|
4
|
+
path: string;
|
|
5
|
+
schema: any;
|
|
6
|
+
wsUseServerOptions?: ServerOptions;
|
|
7
|
+
wsServerOptions?: WSServerOptions;
|
|
8
|
+
}
|
|
9
|
+
declare global {
|
|
10
|
+
namespace TsED {
|
|
11
|
+
interface ApolloSettings {
|
|
12
|
+
wsUseServerOptions?: ServerOptions;
|
|
13
|
+
wsServerOptions?: WSServerOptions;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,40 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/graphql-ws",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.80.1",
|
|
4
4
|
"description": "An extension to allow GraphQL over WebSockets using graphql-ws protocol",
|
|
5
|
+
"type": "commonjs",
|
|
5
6
|
"source": "./src/index.ts",
|
|
6
7
|
"main": "./lib/cjs/index.js",
|
|
7
8
|
"module": "./lib/esm/index.js",
|
|
8
9
|
"typings": "./lib/types/index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./lib/types/index.d.ts",
|
|
13
|
+
"import": "./lib/esm/index.js",
|
|
14
|
+
"default": "./lib/cjs/index.js"
|
|
15
|
+
}
|
|
14
16
|
},
|
|
15
17
|
"scripts": {
|
|
16
18
|
"build": "yarn barrels && yarn build:ts",
|
|
17
19
|
"barrels": "barrels",
|
|
18
|
-
"build:ts": "tsc --build tsconfig.json
|
|
20
|
+
"build:ts": "tsc --build tsconfig.json"
|
|
19
21
|
},
|
|
20
22
|
"dependencies": {
|
|
21
23
|
"tslib": "2.6.1"
|
|
22
24
|
},
|
|
23
25
|
"devDependencies": {
|
|
24
|
-
"@tsed/barrels": "7.
|
|
25
|
-
"@tsed/common": "7.
|
|
26
|
-
"@tsed/core": "7.
|
|
27
|
-
"@tsed/di": "7.
|
|
26
|
+
"@tsed/barrels": "7.80.1",
|
|
27
|
+
"@tsed/common": "7.80.1",
|
|
28
|
+
"@tsed/core": "7.80.1",
|
|
29
|
+
"@tsed/di": "7.80.1",
|
|
28
30
|
"@tsed/logger": ">=6.7.5",
|
|
29
|
-
"@tsed/typescript": "7.
|
|
31
|
+
"@tsed/typescript": "7.80.1",
|
|
30
32
|
"eslint": "^8.57.0",
|
|
31
33
|
"graphql-ws": "^5.15.0",
|
|
32
|
-
"jest": "^29.7.0"
|
|
34
|
+
"jest": "^29.7.0",
|
|
35
|
+
"typescript": "4.9.5"
|
|
33
36
|
},
|
|
34
37
|
"peerDependencies": {
|
|
35
|
-
"@tsed/common": "7.
|
|
36
|
-
"@tsed/core": "7.
|
|
37
|
-
"@tsed/di": "7.
|
|
38
|
+
"@tsed/common": "7.80.1",
|
|
39
|
+
"@tsed/core": "7.80.1",
|
|
40
|
+
"@tsed/di": "7.80.1",
|
|
38
41
|
"@tsed/logger": ">=6.7.5",
|
|
39
42
|
"graphql-ws": ">=5.14.2"
|
|
40
43
|
},
|
package/lib/cjs/package.json
DELETED
package/lib/esm/package.json
DELETED
package/tsconfig.esm.json
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@tsed/typescript/tsconfig.node.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"baseUrl": ".",
|
|
5
|
-
"module": "ES2020",
|
|
6
|
-
"rootDir": "src",
|
|
7
|
-
"outDir": "./lib/esm",
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"declarationDir": "./lib/types",
|
|
10
|
-
"composite": true,
|
|
11
|
-
"noEmit": false
|
|
12
|
-
},
|
|
13
|
-
"include": ["src", "src/**/*.json"],
|
|
14
|
-
"exclude": [
|
|
15
|
-
"node_modules",
|
|
16
|
-
"test",
|
|
17
|
-
"lib",
|
|
18
|
-
"benchmark",
|
|
19
|
-
"coverage",
|
|
20
|
-
"spec",
|
|
21
|
-
"**/*.benchmark.ts",
|
|
22
|
-
"**/*.spec.ts",
|
|
23
|
-
"keys",
|
|
24
|
-
"jest.config.js",
|
|
25
|
-
"**/__mock__/**",
|
|
26
|
-
"webpack.config.js"
|
|
27
|
-
],
|
|
28
|
-
"references": [
|
|
29
|
-
{
|
|
30
|
-
"path": "../../platform/common"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"path": "../../core"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"path": "../../di"
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
}
|