v2.2.1
This commit is contained in:
parent
f518b537cd
commit
94c564d063
2
dist/lib/index.d.ts
vendored
2
dist/lib/index.d.ts
vendored
@ -1,3 +1,3 @@
|
||||
export { LoggedRoute, LoggedFunction, LoggedController, LoggedInjectable, } from "./logged";
|
||||
export { ScopedLogger } from "./logger";
|
||||
export { InjectLogger, LoggedParam, LoggedHeaders, LoggedBody, LoggedQuery, Returns } from "./reflected";
|
||||
export { InjectLogger, LoggedParam, LoggedHeaders, LoggedBody, LoggedQuery, Logged, Returns } from "./reflected";
|
||||
|
3
dist/lib/index.js
vendored
3
dist/lib/index.js
vendored
@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Returns = exports.LoggedQuery = exports.LoggedBody = exports.LoggedHeaders = exports.LoggedParam = exports.InjectLogger = exports.ScopedLogger = exports.LoggedInjectable = exports.LoggedController = exports.LoggedFunction = exports.LoggedRoute = void 0;
|
||||
exports.Returns = exports.Logged = exports.LoggedQuery = exports.LoggedBody = exports.LoggedHeaders = exports.LoggedParam = exports.InjectLogger = exports.ScopedLogger = exports.LoggedInjectable = exports.LoggedController = exports.LoggedFunction = exports.LoggedRoute = void 0;
|
||||
var logged_1 = require("./logged");
|
||||
Object.defineProperty(exports, "LoggedRoute", { enumerable: true, get: function () { return logged_1.LoggedRoute; } });
|
||||
Object.defineProperty(exports, "LoggedFunction", { enumerable: true, get: function () { return logged_1.LoggedFunction; } });
|
||||
@ -14,4 +14,5 @@ Object.defineProperty(exports, "LoggedParam", { enumerable: true, get: function
|
||||
Object.defineProperty(exports, "LoggedHeaders", { enumerable: true, get: function () { return reflected_1.LoggedHeaders; } });
|
||||
Object.defineProperty(exports, "LoggedBody", { enumerable: true, get: function () { return reflected_1.LoggedBody; } });
|
||||
Object.defineProperty(exports, "LoggedQuery", { enumerable: true, get: function () { return reflected_1.LoggedQuery; } });
|
||||
Object.defineProperty(exports, "Logged", { enumerable: true, get: function () { return reflected_1.Logged; } });
|
||||
Object.defineProperty(exports, "Returns", { enumerable: true, get: function () { return reflected_1.Returns; } });
|
||||
|
12
dist/lib/logged.js
vendored
12
dist/lib/logged.js
vendored
@ -107,11 +107,13 @@ function overrideBuild(originalFunction, baseLogger, metadatas, key, returnsData
|
||||
.filter((v) => v.length > 0)
|
||||
.join(", ")
|
||||
: ""
|
||||
: returnsData
|
||||
? typeof r === "object"
|
||||
? "WITH " + JSON.stringify(r)
|
||||
: "WITH " + r
|
||||
: "";
|
||||
: typeof returnsData === 'string'
|
||||
? "WITH " + returnsData + "=" + typeof r === "object" ? JSON.stringify(r) : r
|
||||
: returnsData
|
||||
? typeof r === "object"
|
||||
? "WITH " + JSON.stringify(r)
|
||||
: "WITH " + r
|
||||
: "";
|
||||
injectedLogger.log(route
|
||||
? `RETURNED HTTP ${route.fullRoute} (${key}) ${resultLogged}`
|
||||
: `RETURNED ${key} ${resultLogged}`);
|
||||
|
2
dist/lib/reflected.d.ts
vendored
2
dist/lib/reflected.d.ts
vendored
@ -42,5 +42,5 @@ export declare function LoggedBody(property: string, ...pipes: Pipe[]): LoggedPa
|
||||
export declare function LoggedHeaders(property?: string): LoggedParamReturns;
|
||||
export declare function Returns<F extends Array<any>, R>(namePaths?: {
|
||||
[name: string]: string;
|
||||
}): (_target: any, _key: string | symbol, descriptor: TypedPropertyDescriptor<(...args: F) => Promise<R>>) => void;
|
||||
} | string): (_target: any, _key: string | symbol, descriptor: TypedPropertyDescriptor<(...args: F) => Promise<R> | R>) => void;
|
||||
export {};
|
||||
|
4
dist/lib/reflected.js
vendored
4
dist/lib/reflected.js
vendored
@ -84,7 +84,9 @@ exports.LoggedHeaders = LoggedHeaders;
|
||||
function Returns(namePaths) {
|
||||
return (_target, _key, descriptor) => {
|
||||
Reflect.defineMetadata(exports.returns, namePaths
|
||||
? Object.entries(namePaths).reduce((prev, curr) => [...prev, { name: curr[0], path: curr[1] }], [])
|
||||
? typeof namePaths === 'string'
|
||||
? namePaths
|
||||
: Object.entries(namePaths).reduce((prev, curr) => [...prev, { name: curr[0], path: curr[1] }], [])
|
||||
: true, descriptor.value);
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user