@rxdi/graphql 0.7.171 → 0.7.172
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/config.tokens.d.ts +1 -1
- package/dist/decorators/query/query.decorator.d.ts +1 -1
- package/dist/plugin-init.d.ts +1 -1
- package/dist/plugin-init.js +1 -1
- package/dist/services/apollo.service.d.ts +2 -2
- package/dist/services/apollo.service.js +3 -3
- package/dist/services/error.service.d.ts +1 -1
- package/dist/services/error.service.js +1 -1
- package/dist/services/graphiql.service.d.ts +2 -2
- package/dist/services/graphiql.service.js +1 -1
- package/dist/services/server-push.service.d.ts +1 -1
- package/dist/services/server-push.service.js +1 -1
- package/dist/services/start.service.d.ts +1 -1
- package/dist/services/start.service.js +1 -1
- package/dist/test/helpers/core-module.d.ts +5 -5
- package/dist/test/helpers/core-module.js +1 -1
- package/package.json +4 -5
package/dist/config.tokens.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { InjectionToken } from '@rxdi/core';
|
|
|
2
2
|
import * as GraphiQL from 'apollo-server-module-graphiql';
|
|
3
3
|
import { GraphQLOptions } from 'apollo-server-core';
|
|
4
4
|
import { GraphQLSchema, GraphQLField, GraphQLDirective } from 'graphql';
|
|
5
|
-
import { Server, ResponseToolkit } from 'hapi';
|
|
5
|
+
import { Server, ResponseToolkit } from '@hapi/hapi';
|
|
6
6
|
import { RenderPageOptions } from 'graphql-playground-html';
|
|
7
7
|
export interface HapiOptionsFunction {
|
|
8
8
|
(req?: Request): GraphQLOptions | Promise<GraphQLOptions>;
|
|
@@ -19,4 +19,4 @@ export declare class GenericGapiResolversType implements GraphQLControllerOption
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
export declare function Query<T>(options?: any): (t: any, propKey:
|
|
22
|
+
export declare function Query<T>(options?: any): (t: any, propKey: any, descriptor: TypedPropertyDescriptor<any>) => TypedPropertyDescriptor<any>;
|
package/dist/plugin-init.d.ts
CHANGED
package/dist/plugin-init.js
CHANGED
|
@@ -25,7 +25,7 @@ exports.PluginInit = void 0;
|
|
|
25
25
|
const core_1 = require("@rxdi/core");
|
|
26
26
|
const graphql_tester_1 = require("graphql-tester");
|
|
27
27
|
const hapi_1 = require("@rxdi/hapi");
|
|
28
|
-
const hapi_2 = require("hapi");
|
|
28
|
+
const hapi_2 = require("@hapi/hapi");
|
|
29
29
|
const operators_1 = require("rxjs/operators");
|
|
30
30
|
const config_tokens_1 = require("./config.tokens");
|
|
31
31
|
let PluginInit = class PluginInit {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PluginInterface } from '@rxdi/core';
|
|
2
|
-
import { Server, Request, ResponseToolkit } from 'hapi';
|
|
2
|
+
import { Server, Request, ResponseToolkit } from '@hapi/hapi';
|
|
3
3
|
import { GRAPHQL_PLUGIN_CONFIG } from '../config.tokens';
|
|
4
4
|
import { BootstrapService } from '../services/bootstrap.service';
|
|
5
5
|
import { HookService } from './hooks.service';
|
|
@@ -14,6 +14,6 @@ export declare class ApolloService implements PluginInterface {
|
|
|
14
14
|
init(): void;
|
|
15
15
|
register(): Promise<void>;
|
|
16
16
|
defaultOrNew: (request: Request, response: ResponseToolkit, error: Error) => Promise<any>;
|
|
17
|
-
makeGQLRequest(request: Request, h: ResponseToolkit, err?: Error, context?: {}): Promise<import("hapi").ResponseObject>;
|
|
17
|
+
makeGQLRequest(request: Request, h: ResponseToolkit, err?: Error, context?: {}): Promise<import("@hapi/hapi").ResponseObject>;
|
|
18
18
|
handler: (request: Request, h: ResponseToolkit, err?: Error) => Promise<any>;
|
|
19
19
|
}
|
|
@@ -24,7 +24,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
24
24
|
exports.ApolloService = void 0;
|
|
25
25
|
const core_1 = require("@rxdi/core");
|
|
26
26
|
const Boom = require("boom");
|
|
27
|
-
const hapi_1 = require("hapi");
|
|
27
|
+
const hapi_1 = require("@hapi/hapi");
|
|
28
28
|
const apollo_server_core_1 = require("apollo-server-core");
|
|
29
29
|
const hapi_2 = require("@rxdi/hapi");
|
|
30
30
|
const config_tokens_1 = require("../config.tokens");
|
|
@@ -52,14 +52,14 @@ let ApolloService = class ApolloService {
|
|
|
52
52
|
this.config.authentication) {
|
|
53
53
|
try {
|
|
54
54
|
const serviceUtilsService = core_1.Container.get((this.config.authentication));
|
|
55
|
-
this.config.graphqlOptions.context
|
|
55
|
+
this.config.graphqlOptions.context['user'] = yield serviceUtilsService.validateToken(request.headers.authorization);
|
|
56
56
|
}
|
|
57
57
|
catch (e) {
|
|
58
58
|
return Boom.unauthorized();
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
|
-
this.config.graphqlOptions.context
|
|
62
|
+
this.config.graphqlOptions.context['user'] = null;
|
|
63
63
|
}
|
|
64
64
|
return this.makeGQLRequest(request, response, error, this.config.graphqlOptions.context);
|
|
65
65
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.errorUnauthorized = exports.createError = exports.Boom = exports.clientErrors = exports.attachErrorHandlers = void 0;
|
|
4
4
|
const formatError = require("apollo-errors");
|
|
5
|
-
const boom = require("boom");
|
|
5
|
+
const boom = require("@hapi/boom");
|
|
6
6
|
exports.attachErrorHandlers = formatError.formatError;
|
|
7
7
|
exports.clientErrors = formatError;
|
|
8
8
|
exports.Boom = boom;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PluginInterface } from '@rxdi/core';
|
|
2
2
|
import { GRAPHQL_PLUGIN_CONFIG } from '../config.tokens';
|
|
3
|
-
import { Request, Server, ResponseToolkit } from 'hapi';
|
|
3
|
+
import { Request, Server, ResponseToolkit } from '@hapi/hapi';
|
|
4
4
|
export declare class GraphiQLService implements PluginInterface {
|
|
5
5
|
private server;
|
|
6
6
|
private config;
|
|
7
7
|
constructor(server: Server, config: GRAPHQL_PLUGIN_CONFIG);
|
|
8
8
|
OnInit(): void;
|
|
9
9
|
register(): Promise<void>;
|
|
10
|
-
handler: (request: Request, h: ResponseToolkit, err?: Error) => Promise<import("hapi").ResponseObject>;
|
|
10
|
+
handler: (request: Request, h: ResponseToolkit, err?: Error) => Promise<import("@hapi/hapi").ResponseObject>;
|
|
11
11
|
}
|
|
@@ -25,7 +25,7 @@ exports.GraphiQLService = void 0;
|
|
|
25
25
|
const core_1 = require("@rxdi/core");
|
|
26
26
|
const hapi_1 = require("@rxdi/hapi");
|
|
27
27
|
const config_tokens_1 = require("../config.tokens");
|
|
28
|
-
const hapi_2 = require("hapi");
|
|
28
|
+
const hapi_2 = require("@hapi/hapi");
|
|
29
29
|
const GraphiQL = require("apollo-server-module-graphiql");
|
|
30
30
|
let GraphiQLService = class GraphiQLService {
|
|
31
31
|
constructor(server, config) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { PluginInterface, ExitHandlerService, AfterStarterService } from '@rxdi/core';
|
|
3
3
|
import { GRAPHQL_PLUGIN_CONFIG } from '../config.tokens';
|
|
4
4
|
import { Server, IncomingMessage, ServerResponse } from 'http';
|
|
5
|
-
import { Server as HapiServer } from 'hapi';
|
|
5
|
+
import { Server as HapiServer } from '@hapi/hapi';
|
|
6
6
|
import { Subject, Observable } from 'rxjs';
|
|
7
7
|
import { StartService } from './start.service';
|
|
8
8
|
export declare class ServerPushPlugin implements PluginInterface {
|
|
@@ -25,7 +25,7 @@ exports.ServerPushPlugin = void 0;
|
|
|
25
25
|
const core_1 = require("@rxdi/core");
|
|
26
26
|
const config_tokens_1 = require("../config.tokens");
|
|
27
27
|
const http_1 = require("http");
|
|
28
|
-
const hapi_1 = require("hapi");
|
|
28
|
+
const hapi_1 = require("@hapi/hapi");
|
|
29
29
|
const hapi_2 = require("@rxdi/hapi");
|
|
30
30
|
const rxjs_1 = require("rxjs");
|
|
31
31
|
const operators_1 = require("rxjs/operators");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BootstrapLogger } from '@rxdi/core';
|
|
2
2
|
import { OpenService } from '@rxdi/hapi';
|
|
3
|
-
import { Server } from 'hapi';
|
|
3
|
+
import { Server } from '@hapi/hapi';
|
|
4
4
|
import { GRAPHQL_PLUGIN_CONFIG } from '../config.tokens';
|
|
5
5
|
export declare class StartService {
|
|
6
6
|
private server;
|
|
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.StartService = void 0;
|
|
16
16
|
const core_1 = require("@rxdi/core");
|
|
17
17
|
const hapi_1 = require("@rxdi/hapi");
|
|
18
|
-
const hapi_2 = require("hapi");
|
|
18
|
+
const hapi_2 = require("@hapi/hapi");
|
|
19
19
|
const config_tokens_1 = require("../config.tokens");
|
|
20
20
|
let StartService = class StartService {
|
|
21
21
|
constructor(server, config, logger, openService) {
|
|
@@ -2,7 +2,7 @@ import { GRAPHQL_PLUGIN_CONFIG } from '../../config.tokens';
|
|
|
2
2
|
import { HapiConfigModel } from '@rxdi/hapi';
|
|
3
3
|
import { ConfigModel } from '@rxdi/core';
|
|
4
4
|
import { SendRequestQueryType } from '../../plugin-init';
|
|
5
|
-
import { Server } from 'hapi';
|
|
5
|
+
import { Server } from '@hapi/hapi';
|
|
6
6
|
export interface CoreModuleConfig {
|
|
7
7
|
server?: HapiConfigModel;
|
|
8
8
|
graphql?: GRAPHQL_PLUGIN_CONFIG;
|
|
@@ -38,11 +38,11 @@ export declare const DEFAULT_CONFIG: {
|
|
|
38
38
|
};
|
|
39
39
|
export declare const setConfigServer: (config?: HapiConfigModel) => {
|
|
40
40
|
randomPort: boolean;
|
|
41
|
-
staticConfig?: import("hapi").ServerRoute | import("hapi").ServerRoute[];
|
|
41
|
+
staticConfig?: import("@hapi/hapi").ServerRoute<import("@hapi/hapi").ReqRefDefaults> | import("@hapi/hapi").ServerRoute<import("@hapi/hapi").ReqRefDefaults>[];
|
|
42
42
|
hapi: {
|
|
43
43
|
port: number;
|
|
44
|
-
} | import("hapi").ServerOptions;
|
|
45
|
-
plugins?: (import("hapi").PluginBase<any> & (import("hapi").PluginNameVersion | import("hapi").PluginPackage))[];
|
|
44
|
+
} | import("@hapi/hapi").ServerOptions;
|
|
45
|
+
plugins?: (import("@hapi/hapi").PluginBase<any, any> & (import("@hapi/hapi").PluginNameVersion | import("@hapi/hapi").PluginPackage))[];
|
|
46
46
|
};
|
|
47
47
|
export declare const setConfigGraphql: (config?: GRAPHQL_PLUGIN_CONFIG) => {
|
|
48
48
|
path: string;
|
|
@@ -75,6 +75,6 @@ export declare const setConfigGraphql: (config?: GRAPHQL_PLUGIN_CONFIG) => {
|
|
|
75
75
|
};
|
|
76
76
|
export declare const startServer: (config?: CoreModuleConfig, bootstrapOptions?: ConfigModel) => import("rxjs").Observable<import("@rxdi/core/dist/container/observable-interface").ObservableContainer>;
|
|
77
77
|
export declare const stopServer: () => never;
|
|
78
|
-
export declare const getServer: () => import("rxjs").Observable<Server
|
|
78
|
+
export declare const getServer: () => import("rxjs").Observable<Server<import("@hapi/hapi").ServerApplicationState>>;
|
|
79
79
|
export declare const getGraphqlSchema: () => import("rxjs").Observable<import("graphql").GraphQLSchema>;
|
|
80
80
|
export declare const sendRequest: <T = {}>(request: SendRequestQueryType, url?: string) => PromiseLike<import("../../plugin-init").Response<T>>;
|
|
@@ -56,8 +56,8 @@ const startServer = (config = {}, bootstrapOptions) => {
|
|
|
56
56
|
};
|
|
57
57
|
exports.startServer = startServer;
|
|
58
58
|
const stopServer = () => {
|
|
59
|
-
process.exit();
|
|
60
59
|
core_1.Container.get(hapi_1.HAPI_SERVER).stop();
|
|
60
|
+
process.exit();
|
|
61
61
|
};
|
|
62
62
|
exports.stopServer = stopServer;
|
|
63
63
|
const getServer = () => (0, rxjs_1.of)(core_1.Container.get(hapi_1.HAPI_SERVER));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxdi/graphql",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.172",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/rxdi/graphql"
|
|
@@ -34,16 +34,15 @@
|
|
|
34
34
|
"apollo-errors": "1.9.0",
|
|
35
35
|
"apollo-server-core": "2.12.0",
|
|
36
36
|
"apollo-server-module-graphiql": "1.4.0",
|
|
37
|
-
"boom": "^
|
|
37
|
+
"@hapi/boom": "^10.0.1",
|
|
38
38
|
"fs-extra": "7.0.1",
|
|
39
39
|
"graphql-tester": "0.0.5"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"graphql": "^14.5.8",
|
|
43
|
-
"@rxdi/core": "^0.7.
|
|
44
|
-
"@rxdi/hapi": "^0.7.
|
|
43
|
+
"@rxdi/core": "^0.7.171",
|
|
44
|
+
"@rxdi/hapi": "^0.7.171",
|
|
45
45
|
"@types/graphql": "^14.5.0",
|
|
46
|
-
"@types/hapi": "^18.0.4",
|
|
47
46
|
"@types/jest": "^24.0.22",
|
|
48
47
|
"@types/node": "^12.0.10",
|
|
49
48
|
"jest": "^24.8.0",
|