@rxdi/graphql-pubsub 0.7.135 → 0.7.138
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/dist/helpers/index.d.ts +1 -1
- package/dist/helpers/index.js +7 -7
- package/package.json +74 -74
package/dist/helpers/index.d.ts
CHANGED
package/dist/helpers/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WebSocketLink = exports.subscribeToTopic = exports.createWebsocketLink = void 0;
|
|
4
|
-
const
|
|
4
|
+
const core_1 = require("@apollo/client/core");
|
|
5
5
|
const ws_1 = require("@apollo/client/link/ws");
|
|
6
|
-
const
|
|
6
|
+
const core_2 = require("@rxdi/core");
|
|
7
7
|
const hapi_1 = require("@rxdi/hapi");
|
|
8
8
|
const rxjs_1 = require("rxjs");
|
|
9
9
|
const ws = require('ws');
|
|
10
10
|
const createWebsocketLink = (options = { uri: 'ws://localhost:9000/subscriptions' }) => {
|
|
11
11
|
let server;
|
|
12
12
|
try {
|
|
13
|
-
server =
|
|
13
|
+
server = core_2.Container.get(options.server || hapi_1.HAPI_SERVER);
|
|
14
14
|
}
|
|
15
15
|
catch (e) { }
|
|
16
16
|
if (server) {
|
|
17
17
|
options.uri = `ws://localhost:${server.info.port || server.port}/subscriptions`;
|
|
18
18
|
}
|
|
19
|
-
if (!
|
|
20
|
-
|
|
19
|
+
if (!core_2.Container.has(ws_1.WebSocketLink)) {
|
|
20
|
+
core_2.Container.set(ws_1.WebSocketLink, new ws_1.WebSocketLink({
|
|
21
21
|
uri: options.uri,
|
|
22
22
|
options: options || {
|
|
23
23
|
reconnect: true,
|
|
@@ -25,12 +25,12 @@ const createWebsocketLink = (options = { uri: 'ws://localhost:9000/subscriptions
|
|
|
25
25
|
webSocketImpl: ws,
|
|
26
26
|
}));
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return core_2.Container.get(ws_1.WebSocketLink);
|
|
29
29
|
};
|
|
30
30
|
exports.createWebsocketLink = createWebsocketLink;
|
|
31
31
|
const subscribeToTopic = (query, variables, link) => {
|
|
32
32
|
return new rxjs_1.Observable((o) => {
|
|
33
|
-
const cmd = (0,
|
|
33
|
+
const cmd = (0, core_1.execute)(link || (0, exports.createWebsocketLink)(), {
|
|
34
34
|
query,
|
|
35
35
|
variables,
|
|
36
36
|
}).subscribe({
|
package/package.json
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
],
|
|
27
|
-
"license": "MIT",
|
|
28
|
-
"bugs": {
|
|
29
|
-
"url": "https://github.com/rxdi/graphql-pubsub/issues"
|
|
30
|
-
},
|
|
31
|
-
"homepage": "https://github.com/rxdi/graphql-pubsub#readme",
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"@rxdi/graphql-rabbitmq-subscriptions": "^0.7.133",
|
|
34
|
-
"@apollo/client": "^3.4.16",
|
|
35
|
-
"graphql-request": "^1.8.2",
|
|
36
|
-
"subscriptions-transport-ws": "^0.9.19",
|
|
37
|
-
"ws": "6.2.1"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@rxdi/core": "^0.7.134",
|
|
41
|
-
"@rxdi/graphql": "^0.7.134",
|
|
42
|
-
"@rxdi/hapi": "^0.7.134",
|
|
43
|
-
"@types/graphql": "^14.5.0",
|
|
44
|
-
"@types/hapi": "^18.0.4",
|
|
45
|
-
"@types/jest": "^24.0.22",
|
|
46
|
-
"@types/node": "^12.0.10",
|
|
47
|
-
"jest": "^24.8.0",
|
|
48
|
-
"jest-cli": "^24.8.1",
|
|
49
|
-
"ts-jest": "^24.0.2",
|
|
50
|
-
"tslint": "^5.20.1",
|
|
51
|
-
"tslint-language-service": "^0.9.9",
|
|
52
|
-
"typescript": "^4.3.5"
|
|
53
|
-
},
|
|
54
|
-
"jest": {
|
|
55
|
-
"testEnvironment": "node",
|
|
56
|
-
"testPathIgnorePatterns": [
|
|
57
|
-
"/node_modules/"
|
|
58
|
-
],
|
|
59
|
-
"coverageReporters": [
|
|
60
|
-
"lcov",
|
|
61
|
-
"html"
|
|
62
|
-
],
|
|
63
|
-
"rootDir": "./",
|
|
64
|
-
"moduleFileExtensions": [
|
|
65
|
-
"ts",
|
|
66
|
-
"tsx",
|
|
67
|
-
"js",
|
|
68
|
-
"json",
|
|
69
|
-
"node"
|
|
2
|
+
"name": "@rxdi/graphql-pubsub",
|
|
3
|
+
"version": "0.7.138",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/rxdi/graphql-pubsub"
|
|
7
|
+
},
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"module": "./dist/index.js",
|
|
11
|
+
"typings": "./dist/index.d.ts",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "jest | true",
|
|
14
|
+
"build": "tsc || true",
|
|
15
|
+
"lint": "tslint -c tslint.json 'src/**/*.{ts,tsx}'",
|
|
16
|
+
"pretest": "npm run lint"
|
|
17
|
+
},
|
|
18
|
+
"author": {
|
|
19
|
+
"name": "Kristian Tachev(Stradivario)",
|
|
20
|
+
"email": "kristiqn.tachev@gmail.com"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"graphql",
|
|
24
|
+
"gapi",
|
|
25
|
+
"node"
|
|
70
26
|
],
|
|
71
|
-
"
|
|
72
|
-
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/rxdi/graphql-pubsub/issues"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/rxdi/graphql-pubsub#readme",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@rxdi/graphql-rabbitmq-subscriptions": "^0.7.137",
|
|
34
|
+
"@apollo/client": "^3.4.16",
|
|
35
|
+
"graphql-request": "^1.8.2",
|
|
36
|
+
"subscriptions-transport-ws": "^0.9.19",
|
|
37
|
+
"ws": "6.2.1"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@rxdi/core": "^0.7.137",
|
|
41
|
+
"@rxdi/graphql": "^0.7.137",
|
|
42
|
+
"@rxdi/hapi": "^0.7.137",
|
|
43
|
+
"@types/graphql": "^14.5.0",
|
|
44
|
+
"@types/hapi": "^18.0.4",
|
|
45
|
+
"@types/jest": "^24.0.22",
|
|
46
|
+
"@types/node": "^12.0.10",
|
|
47
|
+
"jest": "^24.8.0",
|
|
48
|
+
"jest-cli": "^24.8.1",
|
|
49
|
+
"ts-jest": "^24.0.2",
|
|
50
|
+
"tslint": "^5.20.1",
|
|
51
|
+
"tslint-language-service": "^0.9.9",
|
|
52
|
+
"typescript": "^4.3.5"
|
|
73
53
|
},
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
54
|
+
"jest": {
|
|
55
|
+
"testEnvironment": "node",
|
|
56
|
+
"testPathIgnorePatterns": [
|
|
57
|
+
"/node_modules/"
|
|
58
|
+
],
|
|
59
|
+
"coverageReporters": [
|
|
60
|
+
"lcov",
|
|
61
|
+
"html"
|
|
62
|
+
],
|
|
63
|
+
"rootDir": "./",
|
|
64
|
+
"moduleFileExtensions": [
|
|
65
|
+
"ts",
|
|
66
|
+
"tsx",
|
|
67
|
+
"js",
|
|
68
|
+
"json",
|
|
69
|
+
"node"
|
|
70
|
+
],
|
|
71
|
+
"transform": {
|
|
72
|
+
"\\.(ts|tsx)$": "ts-jest"
|
|
73
|
+
},
|
|
74
|
+
"testRegex": "/src/.*\\.spec.(ts|tsx|js)$",
|
|
75
|
+
"verbose": true,
|
|
76
|
+
"collectCoverage": true
|
|
77
|
+
}
|
|
78
78
|
}
|