@nest-boot/graphql-logger 7.0.2 → 7.0.3
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/graphql-logger-module-options.interface.d.ts +1 -0
- package/dist/graphql-logger-module-options.interface.js +1 -0
- package/dist/graphql-logger-module-options.interface.js.map +1 -1
- package/dist/graphql-logger.module-definition.d.ts +1 -1
- package/dist/graphql-logger.module-definition.js +2 -2
- package/dist/graphql-logger.module-definition.js.map +1 -1
- package/dist/graphql-logger.module.d.ts +21 -1
- package/dist/graphql-logger.module.js +23 -0
- package/dist/graphql-logger.module.js.map +1 -1
- package/dist/graphql-logger.plugin.d.ts +14 -0
- package/dist/graphql-logger.plugin.js +14 -0
- package/dist/graphql-logger.plugin.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +21 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-logger-module-options.interface.js","sourceRoot":"","sources":["../src/graphql-logger-module-options.interface.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"graphql-logger-module-options.interface.js","sourceRoot":"","sources":["../src/graphql-logger-module-options.interface.ts"],"names":[],"mappings":";AAAA,4DAA4D"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type GraphQLLoggerModuleOptions } from "./graphql-logger-module-options.interface";
|
|
2
|
-
export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<GraphQLLoggerModuleOptions, "forRoot", "create", {}>, MODULE_OPTIONS_TOKEN: string | symbol
|
|
2
|
+
export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<GraphQLLoggerModuleOptions, "forRoot", "create", {}>, MODULE_OPTIONS_TOKEN: string | symbol, OPTIONS_TYPE: GraphQLLoggerModuleOptions & Partial<{}>, ASYNC_OPTIONS_TYPE: import("@nestjs/common").ConfigurableModuleAsyncOptions<GraphQLLoggerModuleOptions, "create"> & Partial<{}>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.MODULE_OPTIONS_TOKEN = exports.ConfigurableModuleClass = void 0;
|
|
4
|
+
exports.ASYNC_OPTIONS_TYPE = exports.OPTIONS_TYPE = exports.MODULE_OPTIONS_TOKEN = exports.ConfigurableModuleClass = void 0;
|
|
5
5
|
const common_1 = require("@nestjs/common");
|
|
6
6
|
_a = new common_1.ConfigurableModuleBuilder()
|
|
7
7
|
.setClassMethodName("forRoot")
|
|
8
|
-
.build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN;
|
|
8
|
+
.build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN, exports.OPTIONS_TYPE = _a.OPTIONS_TYPE, exports.ASYNC_OPTIONS_TYPE = _a.ASYNC_OPTIONS_TYPE;
|
|
9
9
|
//# sourceMappingURL=graphql-logger.module-definition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-logger.module-definition.js","sourceRoot":"","sources":["../src/graphql-logger.module-definition.ts"],"names":[],"mappings":";;;;AAAA,2CAA2D;AAI9C,
|
|
1
|
+
{"version":3,"file":"graphql-logger.module-definition.js","sourceRoot":"","sources":["../src/graphql-logger.module-definition.ts"],"names":[],"mappings":";;;;AAAA,2CAA2D;AAI9C,KAKT,IAAI,kCAAyB,EAA8B;KAC5D,kBAAkB,CAAC,SAAS,CAAC;KAC7B,KAAK,EAAE,EANR,+BAAuB,+BACvB,4BAAoB,4BACpB,oBAAY,oBACZ,0BAAkB,yBAGT"}
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type DynamicModule } from "@nestjs/common";
|
|
2
|
+
import { ASYNC_OPTIONS_TYPE, ConfigurableModuleClass, OPTIONS_TYPE } from "./graphql-logger.module-definition";
|
|
3
|
+
/**
|
|
4
|
+
* GraphQL request logging module.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Provides an Apollo Server plugin that logs GraphQL operations
|
|
8
|
+
* including query details, variables, and execution timing.
|
|
9
|
+
*/
|
|
2
10
|
export declare class GraphQLLoggerModule extends ConfigurableModuleClass {
|
|
11
|
+
/**
|
|
12
|
+
* Registers the GraphQLLoggerModule with the given options.
|
|
13
|
+
* @param options - Configuration options for GraphQL logging
|
|
14
|
+
* @returns Dynamic module configuration
|
|
15
|
+
*/
|
|
16
|
+
static forRoot(options: typeof OPTIONS_TYPE): DynamicModule;
|
|
17
|
+
/**
|
|
18
|
+
* Registers the GraphQLLoggerModule asynchronously with factory functions.
|
|
19
|
+
* @param options - Async configuration options
|
|
20
|
+
* @returns Dynamic module configuration
|
|
21
|
+
*/
|
|
22
|
+
static forRootAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule;
|
|
3
23
|
}
|
|
@@ -10,7 +10,30 @@ exports.GraphQLLoggerModule = void 0;
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const graphql_logger_module_definition_1 = require("./graphql-logger.module-definition");
|
|
12
12
|
const graphql_logger_plugin_1 = require("./graphql-logger.plugin");
|
|
13
|
+
/**
|
|
14
|
+
* GraphQL request logging module.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* Provides an Apollo Server plugin that logs GraphQL operations
|
|
18
|
+
* including query details, variables, and execution timing.
|
|
19
|
+
*/
|
|
13
20
|
let GraphQLLoggerModule = class GraphQLLoggerModule extends graphql_logger_module_definition_1.ConfigurableModuleClass {
|
|
21
|
+
/**
|
|
22
|
+
* Registers the GraphQLLoggerModule with the given options.
|
|
23
|
+
* @param options - Configuration options for GraphQL logging
|
|
24
|
+
* @returns Dynamic module configuration
|
|
25
|
+
*/
|
|
26
|
+
static forRoot(options) {
|
|
27
|
+
return super.forRoot(options);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Registers the GraphQLLoggerModule asynchronously with factory functions.
|
|
31
|
+
* @param options - Async configuration options
|
|
32
|
+
* @returns Dynamic module configuration
|
|
33
|
+
*/
|
|
34
|
+
static forRootAsync(options) {
|
|
35
|
+
return super.forRootAsync(options);
|
|
36
|
+
}
|
|
14
37
|
};
|
|
15
38
|
exports.GraphQLLoggerModule = GraphQLLoggerModule;
|
|
16
39
|
exports.GraphQLLoggerModule = GraphQLLoggerModule = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-logger.module.js","sourceRoot":"","sources":["../src/graphql-logger.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"graphql-logger.module.js","sourceRoot":"","sources":["../src/graphql-logger.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoE;AAEpE,yFAI4C;AAC5C,mEAA8D;AAE9D;;;;;;GAMG;AAKI,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,0DAAuB;IAC9D;;;;OAIG;IACH,MAAM,CAAU,OAAO,CAAC,OAA4B;QAClD,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAU,YAAY,CAC1B,OAAkC;QAElC,OAAO,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACF,CAAA;AApBY,kDAAmB;8BAAnB,mBAAmB;IAJ/B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,2CAAmB,CAAC;KACjC,CAAC;GACW,mBAAmB,CAoB/B"}
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { type ApolloServerPlugin, type BaseContext, type GraphQLRequestListener } from "@apollo/server";
|
|
2
2
|
import { Logger } from "@nest-boot/logger";
|
|
3
|
+
/**
|
|
4
|
+
* Apollo Server plugin that logs GraphQL operation metadata.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Adds operation ID, name, and type (query/mutation/subscription)
|
|
8
|
+
* to the structured logger on each resolved operation.
|
|
9
|
+
*/
|
|
3
10
|
export declare class GraphQLLoggerPlugin implements ApolloServerPlugin {
|
|
4
11
|
private readonly logger;
|
|
12
|
+
/** Creates a new GraphQLLoggerPlugin instance.
|
|
13
|
+
* @param logger - Structured logger for recording operation metadata
|
|
14
|
+
*/
|
|
5
15
|
constructor(logger: Logger);
|
|
16
|
+
/**
|
|
17
|
+
* Hook invoked when a GraphQL request starts processing.
|
|
18
|
+
* @returns A request listener that logs operation metadata after resolution
|
|
19
|
+
*/
|
|
6
20
|
requestDidStart(): Promise<GraphQLRequestListener<BaseContext>>;
|
|
7
21
|
}
|
|
@@ -13,10 +13,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
exports.GraphQLLoggerPlugin = void 0;
|
|
14
14
|
const logger_1 = require("@nest-boot/logger");
|
|
15
15
|
const apollo_1 = require("@nestjs/apollo");
|
|
16
|
+
/**
|
|
17
|
+
* Apollo Server plugin that logs GraphQL operation metadata.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Adds operation ID, name, and type (query/mutation/subscription)
|
|
21
|
+
* to the structured logger on each resolved operation.
|
|
22
|
+
*/
|
|
16
23
|
let GraphQLLoggerPlugin = class GraphQLLoggerPlugin {
|
|
24
|
+
/** Creates a new GraphQLLoggerPlugin instance.
|
|
25
|
+
* @param logger - Structured logger for recording operation metadata
|
|
26
|
+
*/
|
|
17
27
|
constructor(logger) {
|
|
18
28
|
this.logger = logger;
|
|
19
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Hook invoked when a GraphQL request starts processing.
|
|
32
|
+
* @returns A request listener that logs operation metadata after resolution
|
|
33
|
+
*/
|
|
20
34
|
async requestDidStart() {
|
|
21
35
|
return {
|
|
22
36
|
didResolveOperation: async (ctx) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-logger.plugin.js","sourceRoot":"","sources":["../src/graphql-logger.plugin.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;;;;;;;;;;AAOrD,8CAA2C;AAC3C,2CAAwC;
|
|
1
|
+
{"version":3,"file":"graphql-logger.plugin.js","sourceRoot":"","sources":["../src/graphql-logger.plugin.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;;;;;;;;;;AAOrD,8CAA2C;AAC3C,2CAAwC;AAExC;;;;;;GAMG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B;;OAEG;IACH,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C;;;OAGG;IACH,KAAK,CAAC,eAAe;QACnB,OAAO;YACL,mBAAmB,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;gBACjC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;oBACjB,SAAS,EAAE;wBACT,EAAE,EAAE,GAAG,CAAC,SAAS;wBACjB,IAAI,EAAE,GAAG,CAAC,aAAa;wBACvB,IAAI,EAAE,GAAG,CAAC,SAAS,EAAE,SAAS;qBAC/B;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAvBY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,eAAM,GAAE;qCAK8B,eAAM;GAJhC,mBAAmB,CAuB/B"}
|