@visulima/pail 1.2.2 → 1.3.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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## @visulima/pail [1.3.0](https://github.com/visulima/visulima/compare/@visulima/pail@1.2.2...@visulima/pail@1.3.0) (2024-06-14)
2
+
3
+ ### Features
4
+
5
+ * **pail:** added new redact processor ([#423](https://github.com/visulima/visulima/issues/423)) ([0614067](https://github.com/visulima/visulima/commit/0614067bec83a46ffe92abfb8a715b2c385b1d7d))
6
+
1
7
  ## @visulima/pail [1.2.2](https://github.com/visulima/visulima/compare/@visulima/pail@1.2.1...@visulima/pail@1.2.2) (2024-06-14)
2
8
 
3
9
  ### Bug Fixes
package/README.md CHANGED
@@ -42,7 +42,7 @@
42
42
  - Custom pluggable processors and reporters
43
43
  - TypeScript support
44
44
  - Interactive and regular modes
45
- - Secrets & sensitive information filtering (soon)
45
+ - Secrets & sensitive information filtering
46
46
  - Filename, date and timestamp support
47
47
  - Scoped loggers and timers
48
48
  - Scaled logging levels mechanism
@@ -121,7 +121,9 @@ A processor can be added to a logger directly (and is subsequently applied to lo
121
121
 
122
122
  - `CallerProcessor` - adds the caller information to the log message
123
123
  - The Meta Object is extended with a file name, line number and column number
124
- - `RedactProcessor` - redacts sensitive information from the log message (Soon)
124
+ - `RedactProcessor` - redacts sensitive information from the log message
125
+ > The redact processor needs the "@visulima/redact" package to work.
126
+ > Use `npm install @visulima/redact`, `pnpm add @visulima/redact` or `yarn add @visulima/redact` to install it.
125
127
  - `MessageFormatterProcessor` - formats the log message (Util.format-like unescaped string formatting utility) [@visulima/fmt][fmt]
126
128
  - `ErrorProcessor` - serializes the error with cause object to a std error object that can be serialized.
127
129
 
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/pail.B85Cx0UJ.cjs");exports.MessageFormatterProcessor=e.g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/pail.B85Cx0UJ.cjs"),r=require("./shared/pail.zsOZqsvh.cjs");exports.MessageFormatterProcessor=e.g;exports.RedactProcessor=r.n;
@@ -1,5 +1,6 @@
1
1
  import { FormatterFunction } from '@visulima/fmt';
2
- import { j as StringifyAwareProcessor, M as Meta } from './shared/pail.DFxpsgpn.cjs';
2
+ import { j as StringifyAwareProcessor, M as Meta, P as Processor } from './shared/pail.DFxpsgpn.cjs';
3
+ import { Rules, RedactOptions } from '@visulima/redact';
3
4
  import '@visulima/colorize';
4
5
 
5
6
  declare class MessageFormatterProcessor<L extends string = string> implements StringifyAwareProcessor<L> {
@@ -12,4 +13,10 @@ declare class MessageFormatterProcessor<L extends string = string> implements St
12
13
  private _format;
13
14
  }
14
15
 
15
- export { MessageFormatterProcessor };
16
+ declare class RedactProcessor<L extends string = string> implements Processor<L> {
17
+ #private;
18
+ constructor(rules?: Rules, options?: RedactOptions);
19
+ process(meta: Meta<L>): Meta<L>;
20
+ }
21
+
22
+ export { MessageFormatterProcessor, RedactProcessor };
@@ -1,5 +1,6 @@
1
1
  import { FormatterFunction } from '@visulima/fmt';
2
- import { j as StringifyAwareProcessor, M as Meta } from './shared/pail.DFxpsgpn.mjs';
2
+ import { j as StringifyAwareProcessor, M as Meta, P as Processor } from './shared/pail.DFxpsgpn.mjs';
3
+ import { Rules, RedactOptions } from '@visulima/redact';
3
4
  import '@visulima/colorize';
4
5
 
5
6
  declare class MessageFormatterProcessor<L extends string = string> implements StringifyAwareProcessor<L> {
@@ -12,4 +13,10 @@ declare class MessageFormatterProcessor<L extends string = string> implements St
12
13
  private _format;
13
14
  }
14
15
 
15
- export { MessageFormatterProcessor };
16
+ declare class RedactProcessor<L extends string = string> implements Processor<L> {
17
+ #private;
18
+ constructor(rules?: Rules, options?: RedactOptions);
19
+ process(meta: Meta<L>): Meta<L>;
20
+ }
21
+
22
+ export { MessageFormatterProcessor, RedactProcessor };
@@ -1,5 +1,6 @@
1
1
  import { FormatterFunction } from '@visulima/fmt';
2
- import { j as StringifyAwareProcessor, M as Meta } from './shared/pail.DFxpsgpn.js';
2
+ import { j as StringifyAwareProcessor, M as Meta, P as Processor } from './shared/pail.DFxpsgpn.js';
3
+ import { Rules, RedactOptions } from '@visulima/redact';
3
4
  import '@visulima/colorize';
4
5
 
5
6
  declare class MessageFormatterProcessor<L extends string = string> implements StringifyAwareProcessor<L> {
@@ -12,4 +13,10 @@ declare class MessageFormatterProcessor<L extends string = string> implements St
12
13
  private _format;
13
14
  }
14
15
 
15
- export { MessageFormatterProcessor };
16
+ declare class RedactProcessor<L extends string = string> implements Processor<L> {
17
+ #private;
18
+ constructor(rules?: Rules, options?: RedactOptions);
19
+ process(meta: Meta<L>): Meta<L>;
20
+ }
21
+
22
+ export { MessageFormatterProcessor, RedactProcessor };
@@ -1 +1 @@
1
- import{g as o}from"./shared/pail.nEbRCLhY.mjs";export{o as MessageFormatterProcessor};
1
+ import{g as e}from"./shared/pail.nEbRCLhY.mjs";import{n as a}from"./shared/pail._czpAR0Z.mjs";export{e as MessageFormatterProcessor,a as RedactProcessor};
@@ -1 +1 @@
1
- "use strict";var i=Object.defineProperty;var t=(o,e)=>i(o,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./shared/pail.C0epjAht.cjs"),c=require("./shared/pail.B85Cx0UJ.cjs");var m=Object.defineProperty,u=t((o,e)=>m(o,"name",{value:e,configurable:!0}),"u");const N=u(()=>{const o=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(l,r)=>{const s=r.slice(1);return e=s,s},new Error().stack;const a=e.reduce((l,r)=>(r.isNative()||r.getFileName()?.includes("pail/dist")||l.push({columnNumber:r.getColumnNumber(),fileName:r.getFileName(),lineNumber:r.getLineNumber()}),l),[])[0];return a?{columnNumber:a.columnNumber??void 0,fileName:a.fileName,lineNumber:a.lineNumber??void 0}:{fileName:"anonymous",lineNumber:void 0}}finally{Error.prepareStackTrace=o}},"getCallerFilename");var b=Object.defineProperty,f=t((o,e)=>b(o,"name",{value:e,configurable:!0}),"r");class g{static{t(this,"a")}static{f(this,"CallerProcessor")}process(e){const{columnNumber:a,fileName:l,lineNumber:r}=N();return e.file={column:a,line:r,name:l},e}}const p=g;exports.ErrorProcessor=n.L;exports.MessageFormatterProcessor=c.g;exports.CallerProcessor=p;
1
+ "use strict";var l=Object.defineProperty;var t=(o,e)=>l(o,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./shared/pail.C0epjAht.cjs"),i=require("./shared/pail.B85Cx0UJ.cjs"),m=require("./shared/pail.zsOZqsvh.cjs");var u=Object.defineProperty,N=t((o,e)=>u(o,"name",{value:e,configurable:!0}),"u");const b=N(()=>{const o=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(s,r)=>{const c=r.slice(1);return e=c,c},new Error().stack;const a=e.reduce((s,r)=>(r.isNative()||r.getFileName()?.includes("pail/dist")||s.push({columnNumber:r.getColumnNumber(),fileName:r.getFileName(),lineNumber:r.getLineNumber()}),s),[])[0];return a?{columnNumber:a.columnNumber??void 0,fileName:a.fileName,lineNumber:a.lineNumber??void 0}:{fileName:"anonymous",lineNumber:void 0}}finally{Error.prepareStackTrace=o}},"getCallerFilename");var d=Object.defineProperty,f=t((o,e)=>d(o,"name",{value:e,configurable:!0}),"r");class g{static{t(this,"a")}static{f(this,"CallerProcessor")}process(e){const{columnNumber:a,fileName:s,lineNumber:r}=b();return e.file={column:a,line:r,name:s},e}}const p=g;exports.ErrorProcessor=n.L;exports.MessageFormatterProcessor=i.g;exports.RedactProcessor=m.n;exports.CallerProcessor=p;
@@ -1,7 +1,8 @@
1
1
  import { P as Processor, M as Meta } from './shared/pail.DFxpsgpn.cjs';
2
- export { MessageFormatterProcessor } from './processor.browser.cjs';
2
+ export { MessageFormatterProcessor, RedactProcessor } from './processor.browser.cjs';
3
3
  import '@visulima/colorize';
4
4
  import '@visulima/fmt';
5
+ import '@visulima/redact';
5
6
 
6
7
  declare global {
7
8
  namespace VisulimaPail {
@@ -1,7 +1,8 @@
1
1
  import { P as Processor, M as Meta } from './shared/pail.DFxpsgpn.mjs';
2
- export { MessageFormatterProcessor } from './processor.browser.mjs';
2
+ export { MessageFormatterProcessor, RedactProcessor } from './processor.browser.mjs';
3
3
  import '@visulima/colorize';
4
4
  import '@visulima/fmt';
5
+ import '@visulima/redact';
5
6
 
6
7
  declare global {
7
8
  namespace VisulimaPail {
@@ -1,7 +1,8 @@
1
1
  import { P as Processor, M as Meta } from './shared/pail.DFxpsgpn.js';
2
- export { MessageFormatterProcessor } from './processor.browser.js';
2
+ export { MessageFormatterProcessor, RedactProcessor } from './processor.browser.js';
3
3
  import '@visulima/colorize';
4
4
  import '@visulima/fmt';
5
+ import '@visulima/redact';
5
6
 
6
7
  declare global {
7
8
  namespace VisulimaPail {
@@ -1 +1 @@
1
- var i=Object.defineProperty;var n=(a,e)=>i(a,"name",{value:e,configurable:!0});import{L as d}from"./shared/pail.CNxJnpWG.mjs";import{g as y}from"./shared/pail.nEbRCLhY.mjs";var m=Object.defineProperty,s=n((a,e)=>m(a,"name",{value:e,configurable:!0}),"u");const c=s(()=>{const a=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(l,r)=>{const t=r.slice(1);return e=t,t},new Error().stack;const o=e.reduce((l,r)=>(r.isNative()||r.getFileName()?.includes("pail/dist")||l.push({columnNumber:r.getColumnNumber(),fileName:r.getFileName(),lineNumber:r.getLineNumber()}),l),[])[0];return o?{columnNumber:o.columnNumber??void 0,fileName:o.fileName,lineNumber:o.lineNumber??void 0}:{fileName:"anonymous",lineNumber:void 0}}finally{Error.prepareStackTrace=a}},"getCallerFilename");var u=Object.defineProperty,N=n((a,e)=>u(a,"name",{value:e,configurable:!0}),"r");class b{static{n(this,"a")}static{N(this,"CallerProcessor")}process(e){const{columnNumber:o,fileName:l,lineNumber:r}=c();return e.file={column:o,line:r,name:l},e}}const f=b;export{f as CallerProcessor,d as ErrorProcessor,y as MessageFormatterProcessor};
1
+ var s=Object.defineProperty;var t=(a,e)=>s(a,"name",{value:e,configurable:!0});import{L as g}from"./shared/pail.CNxJnpWG.mjs";import{g as y}from"./shared/pail.nEbRCLhY.mjs";import{n as k}from"./shared/pail._czpAR0Z.mjs";var m=Object.defineProperty,c=t((a,e)=>m(a,"name",{value:e,configurable:!0}),"u");const i=c(()=>{const a=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(l,r)=>{const n=r.slice(1);return e=n,n},new Error().stack;const o=e.reduce((l,r)=>(r.isNative()||r.getFileName()?.includes("pail/dist")||l.push({columnNumber:r.getColumnNumber(),fileName:r.getFileName(),lineNumber:r.getLineNumber()}),l),[])[0];return o?{columnNumber:o.columnNumber??void 0,fileName:o.fileName,lineNumber:o.lineNumber??void 0}:{fileName:"anonymous",lineNumber:void 0}}finally{Error.prepareStackTrace=a}},"getCallerFilename");var u=Object.defineProperty,N=t((a,e)=>u(a,"name",{value:e,configurable:!0}),"r");class b{static{t(this,"a")}static{N(this,"CallerProcessor")}process(e){const{columnNumber:o,fileName:l,lineNumber:r}=i();return e.file={column:o,line:r,name:l},e}}const f=b;export{f as CallerProcessor,g as ErrorProcessor,y as MessageFormatterProcessor,k as RedactProcessor};
@@ -0,0 +1,9 @@
1
+
2
+ // -- pack CommonJS Shims --
3
+ import __cjs_url__ from "node:url";
4
+ import __cjs_path__ from "node:path";
5
+ import __cjs_mod__ from "node:module";
6
+ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
7
+ const __dirname = __cjs_path__.dirname(__filename);
8
+ const require = __cjs_mod__.createRequire(import.meta.url);
9
+ var i=Object.defineProperty;var s=(t,r)=>i(t,"name",{value:r,configurable:!0});var n=Object.defineProperty,h=s((t,r)=>n(t,"name",{value:r,configurable:!0}),"r");class u{static{s(this,"n")}static{h(this,"RedactProcessor")}#r;constructor(r,e){try{const{redact:a,standardRules:c}=require("@visulima/redact");this.#r=o=>a(o,r||c,e)}catch{throw new Error("The '@visulima/redact' package is missing. Make sure to install the '@visulima/redact' package.")}}process(r){return r.message=this.#r(r.message),r.context=this.#r(r.context),r.error=this.#r(r.error),r}}const d=u;export{d as n};
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var s=(t,r)=>o(t,"name",{value:r,configurable:!0});var n=Object.defineProperty,u=s((t,r)=>n(t,"name",{value:r,configurable:!0}),"r");class h{static{s(this,"n")}static{u(this,"RedactProcessor")}#r;constructor(r,e){try{const{redact:a,standardRules:c}=require("@visulima/redact");this.#r=i=>a(i,r||c,e)}catch{throw new Error("The '@visulima/redact' package is missing. Make sure to install the '@visulima/redact' package.")}}process(r){return r.message=this.#r(r.message),r.context=this.#r(r.context),r.error=this.#r(r.error),r}}const l=h;exports.n=l;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/pail",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "Find a file or directory by walking up parent directories.",
5
5
  "keywords": [
6
6
  "ansi",
@@ -203,6 +203,7 @@
203
203
  "@total-typescript/ts-reset": "^0.5.1",
204
204
  "@types/node": "18.19.15",
205
205
  "@visulima/packem": "^1.0.0-alpha.41",
206
+ "@visulima/redact": "1.0.2",
206
207
  "@vitest/coverage-v8": "^1.6.0",
207
208
  "@vitest/ui": "^1.6.0",
208
209
  "conventional-changelog-conventionalcommits": "8.0.0",
@@ -217,20 +218,24 @@
217
218
  "eslint-plugin-vitest-globals": "^1.5.0",
218
219
  "prettier": "^3.3.2",
219
220
  "rimraf": "^5.0.7",
220
- "type-fest": "^4.20.0",
221
221
  "rotating-file-stream": "^3.2.3",
222
222
  "secretlint": "8.2.4",
223
223
  "semantic-release": "24.0.0",
224
224
  "string-length": "^6.0.0",
225
225
  "terminal-size": "^4.0.0",
226
+ "type-fest": "^4.20.0",
226
227
  "typescript": "^5.4.5",
227
228
  "vitest": "^1.6.0",
228
229
  "wrap-ansi": "^9.0.0"
229
230
  },
230
231
  "peerDependencies": {
232
+ "@visulima/redact": "1.0.2",
231
233
  "rotating-file-stream": "^3.1.1"
232
234
  },
233
235
  "peerDependenciesMeta": {
236
+ "@visulima/redact": {
237
+ "optional": true
238
+ },
234
239
  "rotating-file-stream": {
235
240
  "optional": true
236
241
  }