@tsed/graphql-ws 8.0.0-alpha.5 → 8.0.0-alpha.6

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/package.json CHANGED
@@ -1,17 +1,16 @@
1
1
  {
2
2
  "name": "@tsed/graphql-ws",
3
- "version": "8.0.0-alpha.5",
4
3
  "description": "An extension to allow GraphQL over WebSockets using graphql-ws protocol",
5
- "type": "commonjs",
4
+ "type": "module",
5
+ "version": "8.0.0-alpha.6",
6
6
  "source": "./src/index.ts",
7
- "main": "./lib/cjs/index.js",
7
+ "main": "./lib/esm/index.js",
8
8
  "module": "./lib/esm/index.js",
9
9
  "typings": "./lib/types/index.d.ts",
10
10
  "exports": {
11
11
  ".": {
12
12
  "types": "./lib/types/index.d.ts",
13
13
  "import": "./lib/esm/index.js",
14
- "require": "./lib/cjs/index.js",
15
14
  "default": "./lib/cjs/index.js"
16
15
  }
17
16
  },
@@ -24,20 +23,20 @@
24
23
  "tslib": "2.6.1"
25
24
  },
26
25
  "devDependencies": {
27
- "@tsed/barrels": "8.0.0-alpha.5",
28
- "@tsed/common": "8.0.0-alpha.5",
29
- "@tsed/core": "8.0.0-alpha.5",
30
- "@tsed/di": "8.0.0-alpha.5",
26
+ "@tsed/barrels": "8.0.0-alpha.6",
27
+ "@tsed/common": "8.0.0-alpha.6",
28
+ "@tsed/core": "8.0.0-alpha.6",
29
+ "@tsed/di": "8.0.0-alpha.6",
31
30
  "@tsed/logger": ">=6.7.5",
32
- "@tsed/typescript": "8.0.0-alpha.5",
31
+ "@tsed/typescript": "8.0.0-alpha.6",
33
32
  "eslint": "^8.57.0",
34
33
  "graphql-ws": "5.16.0",
35
34
  "typescript": "4.9.5"
36
35
  },
37
36
  "peerDependencies": {
38
- "@tsed/common": "8.0.0-alpha.5",
39
- "@tsed/core": "8.0.0-alpha.5",
40
- "@tsed/di": "8.0.0-alpha.5",
37
+ "@tsed/common": "8.0.0-alpha.6",
38
+ "@tsed/core": "8.0.0-alpha.6",
39
+ "@tsed/di": "8.0.0-alpha.6",
41
40
  "@tsed/logger": ">=6.7.5",
42
41
  "graphql-ws": ">=5.14.2"
43
42
  },
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GraphQLWSModule = void 0;
4
- const tslib_1 = require("tslib");
5
- const di_1 = require("@tsed/di");
6
- const ws_1 = require("graphql-ws/lib/use/ws");
7
- const http_1 = tslib_1.__importDefault(require("http"));
8
- const https_1 = tslib_1.__importDefault(require("https"));
9
- let GraphQLWSModule = class GraphQLWSModule {
10
- async createWSServer(settings) {
11
- // @ts-ignore
12
- const { WebSocketServer } = await import("ws");
13
- const wsServer = new WebSocketServer({
14
- ...(this.settings.wsServerOptions || {}),
15
- ...settings.wsServerOptions,
16
- server: this.httpsServer || this.httpServer,
17
- path: settings.path
18
- });
19
- return (0, ws_1.useServer)({
20
- ...(this.settings.wsUseServerOptions || {}),
21
- ...settings.wsUseServerOptions,
22
- schema: settings.schema
23
- }, wsServer);
24
- }
25
- async $alterApolloServerPlugins(plugins, settings) {
26
- const wsServer = await this.createWSServer(settings);
27
- this.injector.logger.info(`Create GraphQL WS server on: ${settings.path}`);
28
- return plugins.concat({
29
- serverWillStart() {
30
- return {
31
- async drainServer() {
32
- await wsServer.dispose();
33
- }
34
- };
35
- }
36
- });
37
- }
38
- };
39
- tslib_1.__decorate([
40
- (0, di_1.Constant)("graphqlWs", {}),
41
- tslib_1.__metadata("design:type", Object)
42
- ], GraphQLWSModule.prototype, "settings", void 0);
43
- tslib_1.__decorate([
44
- (0, di_1.Inject)(http_1.default.Server),
45
- tslib_1.__metadata("design:type", Object)
46
- ], GraphQLWSModule.prototype, "httpServer", void 0);
47
- tslib_1.__decorate([
48
- (0, di_1.Inject)(https_1.default.Server),
49
- tslib_1.__metadata("design:type", Object)
50
- ], GraphQLWSModule.prototype, "httpsServer", void 0);
51
- tslib_1.__decorate([
52
- (0, di_1.Inject)(),
53
- tslib_1.__metadata("design:type", di_1.InjectorService)
54
- ], GraphQLWSModule.prototype, "injector", void 0);
55
- GraphQLWSModule = tslib_1.__decorate([
56
- (0, di_1.Module)()
57
- ], GraphQLWSModule);
58
- exports.GraphQLWSModule = GraphQLWSModule;
59
- //# sourceMappingURL=GraphQLWSModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GraphQLWSModule.js","sourceRoot":"","sources":["../../src/GraphQLWSModule.ts"],"names":[],"mappings":";;;;AAAA,iCAAmE;AAEnE,8CAAgD;AAChD,wDAAwB;AACxB,0DAA0B;AAKnB,IAAM,eAAe,GAArB,MAAM,eAAe;IAa1B,KAAK,CAAC,cAAc,CAAC,QAA0B;QAC7C,aAAa;QACb,MAAM,EAAC,eAAe,EAAC,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;QAE7C,MAAM,QAAQ,GAAG,IAAI,eAAe,CAAC;YACnC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,IAAI,EAAE,CAAC;YACxC,GAAG,QAAQ,CAAC,eAAe;YAC3B,MAAM,EAAE,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,UAAW;YAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI;SACpB,CAAC,CAAC;QAEH,OAAO,IAAA,cAAS,EACd;YACE,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,IAAI,EAAE,CAAC;YAC3C,GAAG,QAAQ,CAAC,kBAAkB;YAC9B,MAAM,EAAE,QAAQ,CAAC,MAAM;SACxB,EACD,QAAQ,CACT,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,yBAAyB,CAAC,OAAc,EAAE,QAA0B;QACxE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAErD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QAE3E,OAAO,OAAO,CAAC,MAAM,CAAC;YACpB,eAAe;gBACb,OAAO;oBACL,KAAK,CAAC,WAAW;wBACf,MAAM,QAAQ,CAAC,OAAO,EAAE,CAAC;oBAC3B,CAAC;iBACF,CAAC;YACJ,CAAC;SACK,CAAC,CAAC;IACZ,CAAC;CACF,CAAA;AAhDC;IAAC,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"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=GraphQLWSOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GraphQLWSOptions.js","sourceRoot":"","sources":["../../src/GraphQLWSOptions.ts"],"names":[],"mappings":""}
package/lib/cjs/index.js DELETED
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- /**
5
- * @file Automatically generated by @tsed/barrels.
6
- */
7
- tslib_1.__exportStar(require("./GraphQLWSModule.js"), exports);
8
- tslib_1.__exportStar(require("./GraphQLWSOptions.js"), exports);
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,+DAAqC;AACrC,gEAAsC"}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
@@ -1,10 +0,0 @@
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
- }
@@ -1,16 +0,0 @@
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
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * @file Automatically generated by @tsed/barrels.
3
- */
4
- export * from "./GraphQLWSModule.js";
5
- export * from "./GraphQLWSOptions.js";