@transcommerce/cwm-shared 1.1.82 → 1.1.83
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.
|
@@ -15,6 +15,21 @@ export declare class Utilities {
|
|
|
15
15
|
hasItem: (sKey: string | number | boolean) => boolean;
|
|
16
16
|
keys: () => string[];
|
|
17
17
|
};
|
|
18
|
+
/** Scrubs sensitive information from logs, such as email addresses, JWTs, tokens, GUIDs, credit card numbers, SSNs, phone numbers, and common password/username patterns.
|
|
19
|
+
* This helps prevent accidental exposure of sensitive data in logs while still allowing useful information to be retained for debugging purposes.
|
|
20
|
+
*
|
|
21
|
+
* @param input The input string or object to be scrubbed for logging. If an object is provided, it will be stringified before scrubbing.
|
|
22
|
+
* @returns A scrubbed string with sensitive information redacted.
|
|
23
|
+
* @remarks The method uses regular expressions to identify and redact various types of sensitive information. It is designed to be robust and will return a placeholder if any errors occur during the scrubbing process.
|
|
24
|
+
* @example
|
|
25
|
+
* const userData = {
|
|
26
|
+
* email: 'user@example.com',
|
|
27
|
+
* password: 'supersecret'
|
|
28
|
+
* };
|
|
29
|
+
* const scrubbedData = Utilities.scrubForLog(userData);
|
|
30
|
+
* console.log(scrubbedData);
|
|
31
|
+
*/
|
|
32
|
+
static scrubForLog(input: any): string;
|
|
18
33
|
static getHttpResponseMessages(data: HttpResponseBase): string[];
|
|
19
34
|
static getHttpResponseMessage(data: HttpResponseBase | any): string;
|
|
20
35
|
static findHttpResponseMessage(messageToFind: string, data: HttpResponse<any> | any, searchInCaptionOnly?: boolean, includeCaptionInResult?: boolean): any;
|