@aerogear/apollo-voyager-audit
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -1,2 +0,1 @@ | ||
import { GraphQLResolveInfo } from 'graphql'; | ||
export declare function auditLog(success: boolean, request: any, info: GraphQLResolveInfo, parent: any, args: any, msg: string): void; | ||
export { auditLog } from './auditLog'; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const apollo_voyager_tools_1 = require("@aerogear/apollo-voyager-tools"); | ||
const pino_1 = __importDefault(require("pino")); | ||
const log = pino_1.default(); | ||
const auditLogger = log.child({ tag: 'AUDIT' }); | ||
function auditLog(success, request, info, parent, args, msg) { | ||
auditLogger.info({ | ||
msg: msg || '', | ||
requestId: request ? request.id : '', | ||
operationType: info.operation.operation, | ||
fieldName: info.fieldName, | ||
parentTypeName: info.parentType.name, | ||
path: apollo_voyager_tools_1.buildPath(info.path), | ||
success, | ||
parent, | ||
arguments: args | ||
}); | ||
} | ||
exports.auditLog = auditLog; | ||
var auditLog_1 = require("./auditLog"); | ||
exports.auditLog = auditLog_1.auditLog; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@aerogear/apollo-voyager-audit", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Adds audit logging capabilities to Apollo Voyager Server.", | ||
@@ -24,3 +24,3 @@ "author": "AeroGear Team<aerogear@googlegroups.com>", | ||
"dependencies": { | ||
"@aerogear/apollo-voyager-tools": "^0.1.2", | ||
"@aerogear/apollo-voyager-tools": "^0.1.3", | ||
"graphql-tools": "^4.0.3", | ||
@@ -43,4 +43,3 @@ "pino": "^5.9.0" | ||
] | ||
}, | ||
"gitHead": "35968e3f449ce3b95aaf86f9f4a43a75269ca594" | ||
} | ||
} |
@@ -1,34 +0,1 @@ | ||
import { buildPath } from '@aerogear/apollo-voyager-tools' | ||
import { GraphQLResolveInfo } from 'graphql' | ||
import pino from 'pino' | ||
interface AuditLogger { | ||
info (log: { | ||
msg: string | ||
requestId: string | ||
operationType: string | ||
fieldName: string | ||
parentTypeName: string | ||
path: string | ||
success: boolean | ||
parent: any | ||
arguments: any | ||
}): void | ||
} | ||
const log = pino() | ||
const auditLogger: AuditLogger = log.child({tag: 'AUDIT'}) | ||
export function auditLog (success: boolean, request: any, info: GraphQLResolveInfo, parent: any, args: any, msg: string) { | ||
auditLogger.info({ | ||
msg: msg || '', | ||
requestId: request ? request.id : '', | ||
operationType: info.operation.operation, | ||
fieldName: info.fieldName, | ||
parentTypeName: info.parentType.name, | ||
path: buildPath(info.path), | ||
success, | ||
parent, | ||
arguments: args | ||
}) | ||
} | ||
export { auditLog } from './auditLog' |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15
88
5744
1