@tsed/typegraphql 6.91.0 → 6.92.0
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/TypeGraphQLModule.d.ts +2 -2
- package/lib/cjs/TypeGraphQLModule.js +6 -6
- package/lib/cjs/TypeGraphQLModule.js.map +1 -1
- package/lib/cjs/decorators/dataSourceService.js +3 -3
- package/lib/cjs/decorators/dataSourceService.js.map +1 -1
- package/lib/esm/TypeGraphQLModule.js +1 -1
- package/lib/esm/TypeGraphQLModule.js.map +1 -1
- package/lib/esm/decorators/dataSourceService.js +1 -1
- package/lib/esm/decorators/dataSourceService.js.map +1 -1
- package/lib/types/TypeGraphQLModule.d.ts +2 -2
- package/package.json +4 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Configuration, InjectorService } from "@tsed/di";
|
|
2
2
|
import { TypeGraphQLSettings } from "./interfaces";
|
|
3
3
|
import { TypeGraphQLService } from "./services/TypeGraphQLService";
|
|
4
4
|
/**
|
|
5
5
|
* @ignore
|
|
6
6
|
*/
|
|
7
|
-
export declare class TypeGraphQLModule
|
|
7
|
+
export declare class TypeGraphQLModule {
|
|
8
8
|
protected service: TypeGraphQLService;
|
|
9
9
|
protected injector: InjectorService;
|
|
10
10
|
protected configuration: Configuration;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TypeGraphQLModule = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const di_1 = require("@tsed/di");
|
|
6
6
|
const TypeGraphQLService_1 = require("./services/TypeGraphQLService");
|
|
7
7
|
/**
|
|
8
8
|
* @ignore
|
|
@@ -36,19 +36,19 @@ let TypeGraphQLModule = class TypeGraphQLModule {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
(0, tslib_1.__decorate)([
|
|
39
|
-
(0,
|
|
39
|
+
(0, di_1.Inject)(),
|
|
40
40
|
(0, tslib_1.__metadata)("design:type", TypeGraphQLService_1.TypeGraphQLService)
|
|
41
41
|
], TypeGraphQLModule.prototype, "service", void 0);
|
|
42
42
|
(0, tslib_1.__decorate)([
|
|
43
|
-
(0,
|
|
44
|
-
(0, tslib_1.__metadata)("design:type",
|
|
43
|
+
(0, di_1.Inject)(),
|
|
44
|
+
(0, tslib_1.__metadata)("design:type", di_1.InjectorService)
|
|
45
45
|
], TypeGraphQLModule.prototype, "injector", void 0);
|
|
46
46
|
(0, tslib_1.__decorate)([
|
|
47
|
-
(0,
|
|
47
|
+
(0, di_1.Configuration)(),
|
|
48
48
|
(0, tslib_1.__metadata)("design:type", Object)
|
|
49
49
|
], TypeGraphQLModule.prototype, "configuration", void 0);
|
|
50
50
|
TypeGraphQLModule = (0, tslib_1.__decorate)([
|
|
51
|
-
(0,
|
|
51
|
+
(0, di_1.Module)()
|
|
52
52
|
], TypeGraphQLModule);
|
|
53
53
|
exports.TypeGraphQLModule = TypeGraphQLModule;
|
|
54
54
|
//# sourceMappingURL=TypeGraphQLModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeGraphQLModule.js","sourceRoot":"","sources":["../../src/TypeGraphQLModule.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"TypeGraphQLModule.js","sourceRoot":"","sources":["../../src/TypeGraphQLModule.ts"],"names":[],"mappings":";;;;AAAA,iCAAwE;AAExE,sEAAiE;AAEjE;;GAEG;AAEH,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAU5B,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACpF,CAAC;IAED,aAAa;QACX,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC;QACxB,IAAI,QAAQ,EA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,GAAE;2CACW,oBAAe;mDAAC;AAGpC;IADC,IAAA,kBAAa,GAAE;;wDACuB;AAR5B,iBAAiB;IAD7B,IAAA,WAAM,GAAE;GACI,iBAAiB,CA4C7B;AA5CY,8CAAiB","sourcesContent":["import {Configuration, Inject, InjectorService, Module} from \"@tsed/di\";\nimport {TypeGraphQLSettings} from \"./interfaces\";\nimport {TypeGraphQLService} from \"./services/TypeGraphQLService\";\n\n/**\n * @ignore\n */\n@Module()\nexport class TypeGraphQLModule {\n @Inject()\n protected service: TypeGraphQLService;\n\n @Inject()\n protected injector: InjectorService;\n\n @Configuration()\n protected configuration: Configuration;\n\n get settings(): {[key: string]: TypeGraphQLSettings} | undefined {\n return this.configuration.get(\"graphql\") || this.configuration.get(\"typegraphql\");\n }\n\n $onRoutesInit(): Promise<any> | void {\n const {settings} = this;\n if (settings) {\n const promises = Object.entries(settings).map(async ([key, options]) => {\n return this.service.createServer(key, options);\n });\n\n return Promise.all(promises);\n }\n }\n\n $afterListen(): Promise<any> | void {\n const host = this.configuration.getBestHost();\n\n const displayLog = (key: string, path: string) => {\n const url = typeof host.port === \"number\" ? `${host.protocol}://${host.address}:${host.port}` : \"\";\n\n this.injector.logger.info(`[${key}] GraphQL server is available on ${url}/${path.replace(/^\\//, \"\")}`);\n };\n\n const {settings} = this;\n\n if (settings) {\n Object.entries(settings).map(async ([key, options]) => {\n const {path} = options;\n\n displayLog(key, path);\n });\n }\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DataSourceService = void 0;
|
|
4
|
-
const
|
|
4
|
+
const di_1 = require("@tsed/di");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
/**
|
|
7
7
|
* Create a new DataSource binded with Tsed DI.
|
|
@@ -31,9 +31,9 @@ const constants_1 = require("../constants");
|
|
|
31
31
|
* @graphql
|
|
32
32
|
*/
|
|
33
33
|
function DataSourceService() {
|
|
34
|
-
return (0,
|
|
34
|
+
return (0, di_1.Injectable)({
|
|
35
35
|
type: constants_1.PROVIDER_TYPE_DATASOURCE_SERVICE,
|
|
36
|
-
scope:
|
|
36
|
+
scope: di_1.ProviderScope.INSTANCE
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
exports.DataSourceService = DataSourceService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataSourceService.js","sourceRoot":"","sources":["../../../src/decorators/dataSourceService.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"dataSourceService.js","sourceRoot":"","sources":["../../../src/decorators/dataSourceService.ts"],"names":[],"mappings":";;;AAAA,iCAAmD;AACnD,4CAA8D;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,SAAgB,iBAAiB;IAC/B,OAAO,IAAA,eAAU,EAAC;QAChB,IAAI,EAAE,4CAAgC;QACtC,KAAK,EAAE,kBAAa,CAAC,QAAQ;KAC9B,CAAC,CAAC;AACL,CAAC;AALD,8CAKC","sourcesContent":["import {Injectable, ProviderScope} from \"@tsed/di\";\nimport {PROVIDER_TYPE_DATASOURCE_SERVICE} from \"../constants\";\n\n/**\n * Create a new DataSource binded with Tsed DI.\n *\n * ```typescript\n * import { DataSourceService } from \"@tsed/graphql\";\n * import { RESTDataSource } from 'apollo-datasource-rest';\n *\n * @DataSourceService()\n * export class MyDataSource extends RESTDataSource {\n * constructor() {\n * super();\n * this.baseURL = 'https://awesome-api.example.com';\n * }\n *\n * willSendRequest(request) {\n * request.headers.set('Authorization', this.context.token);\n * }\n *\n * getMyData(id: string) {\n * return this.get(`/v1/my_rest_data/${id}`);\n * }\n * }\n * ```\n *\n * @decorator\n * @graphql\n */\nexport function DataSourceService(): ClassDecorator {\n return Injectable({\n type: PROVIDER_TYPE_DATASOURCE_SERVICE,\n scope: ProviderScope.INSTANCE\n });\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Configuration, Inject, InjectorService, Module } from "@tsed/
|
|
2
|
+
import { Configuration, Inject, InjectorService, Module } from "@tsed/di";
|
|
3
3
|
import { TypeGraphQLService } from "./services/TypeGraphQLService";
|
|
4
4
|
/**
|
|
5
5
|
* @ignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeGraphQLModule.js","sourceRoot":"","sources":["../../src/TypeGraphQLModule.ts"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"TypeGraphQLModule.js","sourceRoot":"","sources":["../../src/TypeGraphQLModule.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAC,MAAM,UAAU,CAAC;AAExE,OAAO,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AAEjE;;GAEG;AAEH,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAU5B,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACpF,CAAC;IAED,aAAa;QACX,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC;QACxB,IAAI,QAAQ,EAAE;YACZ,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE;gBACrE,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;YAEH,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;SAC9B;IACH,CAAC;IAED,YAAY;QACV,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC;QAE9C,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,IAAY,EAAE,EAAE;YAC/C,MAAM,GAAG,GAAG,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,MAAM,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAEnG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,GAAG,oCAAoC,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;QACzG,CAAC,CAAC;QAEF,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC;QAExB,IAAI,QAAQ,EAAE;YACZ,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE;gBACpD,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,CAAC;gBAEvB,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YACxB,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;CACF,CAAA;AA1CC;IADC,MAAM,EAAE;8BACU,kBAAkB;kDAAC;AAGtC;IADC,MAAM,EAAE;8BACW,eAAe;mDAAC;AAGpC;IADC,aAAa,EAAE;;wDACuB;AAR5B,iBAAiB;IAD7B,MAAM,EAAE;GACI,iBAAiB,CA4C7B;SA5CY,iBAAiB","sourcesContent":["import {Configuration, Inject, InjectorService, Module} from \"@tsed/di\";\nimport {TypeGraphQLSettings} from \"./interfaces\";\nimport {TypeGraphQLService} from \"./services/TypeGraphQLService\";\n\n/**\n * @ignore\n */\n@Module()\nexport class TypeGraphQLModule {\n @Inject()\n protected service: TypeGraphQLService;\n\n @Inject()\n protected injector: InjectorService;\n\n @Configuration()\n protected configuration: Configuration;\n\n get settings(): {[key: string]: TypeGraphQLSettings} | undefined {\n return this.configuration.get(\"graphql\") || this.configuration.get(\"typegraphql\");\n }\n\n $onRoutesInit(): Promise<any> | void {\n const {settings} = this;\n if (settings) {\n const promises = Object.entries(settings).map(async ([key, options]) => {\n return this.service.createServer(key, options);\n });\n\n return Promise.all(promises);\n }\n }\n\n $afterListen(): Promise<any> | void {\n const host = this.configuration.getBestHost();\n\n const displayLog = (key: string, path: string) => {\n const url = typeof host.port === \"number\" ? `${host.protocol}://${host.address}:${host.port}` : \"\";\n\n this.injector.logger.info(`[${key}] GraphQL server is available on ${url}/${path.replace(/^\\//, \"\")}`);\n };\n\n const {settings} = this;\n\n if (settings) {\n Object.entries(settings).map(async ([key, options]) => {\n const {path} = options;\n\n displayLog(key, path);\n });\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataSourceService.js","sourceRoot":"","sources":["../../../src/decorators/dataSourceService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"dataSourceService.js","sourceRoot":"","sources":["../../../src/decorators/dataSourceService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC;AACnD,OAAO,EAAC,gCAAgC,EAAC,MAAM,cAAc,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,UAAU,CAAC;QAChB,IAAI,EAAE,gCAAgC;QACtC,KAAK,EAAE,aAAa,CAAC,QAAQ;KAC9B,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Injectable, ProviderScope} from \"@tsed/di\";\nimport {PROVIDER_TYPE_DATASOURCE_SERVICE} from \"../constants\";\n\n/**\n * Create a new DataSource binded with Tsed DI.\n *\n * ```typescript\n * import { DataSourceService } from \"@tsed/graphql\";\n * import { RESTDataSource } from 'apollo-datasource-rest';\n *\n * @DataSourceService()\n * export class MyDataSource extends RESTDataSource {\n * constructor() {\n * super();\n * this.baseURL = 'https://awesome-api.example.com';\n * }\n *\n * willSendRequest(request) {\n * request.headers.set('Authorization', this.context.token);\n * }\n *\n * getMyData(id: string) {\n * return this.get(`/v1/my_rest_data/${id}`);\n * }\n * }\n * ```\n *\n * @decorator\n * @graphql\n */\nexport function DataSourceService(): ClassDecorator {\n return Injectable({\n type: PROVIDER_TYPE_DATASOURCE_SERVICE,\n scope: ProviderScope.INSTANCE\n });\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Configuration, InjectorService } from "@tsed/di";
|
|
2
2
|
import { TypeGraphQLSettings } from "./interfaces";
|
|
3
3
|
import { TypeGraphQLService } from "./services/TypeGraphQLService";
|
|
4
4
|
/**
|
|
5
5
|
* @ignore
|
|
6
6
|
*/
|
|
7
|
-
export declare class TypeGraphQLModule
|
|
7
|
+
export declare class TypeGraphQLModule {
|
|
8
8
|
protected service: TypeGraphQLService;
|
|
9
9
|
protected injector: InjectorService;
|
|
10
10
|
protected configuration: Configuration;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/typegraphql",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.92.0",
|
|
4
4
|
"description": "TypeGraphQL package for Ts.ED framework, based on Apollo-server-core and Type-graphql",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"test": "cross-env NODE_ENV=test nyc mocha"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@tsed/apollo": "6.
|
|
23
|
+
"@tsed/apollo": "6.92.0",
|
|
24
24
|
"tslib": "2.2.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@tsed/common": "6.
|
|
28
|
-
"@tsed/core": "6.
|
|
27
|
+
"@tsed/common": "6.92.0",
|
|
28
|
+
"@tsed/core": "6.92.0",
|
|
29
29
|
"@types/graphql": "^14.5.0",
|
|
30
30
|
"class-validator": "~0.13.1",
|
|
31
31
|
"graphql-passport": "0.6.3",
|