langfuse-core
Advanced tools
Comparing version 3.27.2 to 3.28.0
@@ -394,2 +394,3 @@ 'use strict'; | ||
this.release = options?.release ?? getEnv("LANGFUSE_RELEASE") ?? getCommonReleaseEnvs() ?? undefined; | ||
this.mask = options?.mask; | ||
this._retryOptions = { | ||
@@ -723,2 +724,3 @@ retryCount: options?.fetchRetryCount ?? 3, | ||
} | ||
this.maskEventBodyInPlace(body); | ||
const finalEventBody = this.truncateEventBody(body, MAX_EVENT_SIZE); | ||
@@ -754,2 +756,20 @@ try { | ||
} | ||
maskEventBodyInPlace(body) { | ||
if (!this.mask) { | ||
return; | ||
} | ||
const maskableKeys = ["input", "output"]; | ||
for (const key of maskableKeys) { | ||
if (key in body) { | ||
try { | ||
body[key] = this.mask({ | ||
data: body[key] | ||
}); | ||
} catch (e) { | ||
this._events.emit("error", `Error masking ${key}: ${e}`); | ||
body[key] = "<fully masked due to failed mask function>"; | ||
} | ||
} | ||
} | ||
} | ||
/** | ||
@@ -756,0 +776,0 @@ * Truncates the event body if its byte size exceeds the specified maximum byte size. |
{ | ||
"name": "langfuse-core", | ||
"version": "3.27.2", | ||
"version": "3.28.0", | ||
"engines": { | ||
@@ -40,3 +40,3 @@ "node": ">=18" | ||
}, | ||
"gitHead": "dab2b42d9aec839def71ccd087f4a52ec691ccf6" | ||
"gitHead": "257b9b3d0cfa5c7831a449265ff8b1369797c227" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
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
604013
6725