@open-wa/wa-automate 4.67.0 → 4.70.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -47,6 +47,26 @@ const sensitiveKeys = [
47
47
  /token/i,
48
48
  /api[-._]?key/i,
49
49
  ];
50
+ const getCircularReplacer = () => {
51
+ const seen = new WeakSet();
52
+ return (_key, value) => {
53
+ if (typeof value === "object" && value !== null) {
54
+ if (seen.has(value)) {
55
+ return "[Circular]";
56
+ }
57
+ seen.add(value);
58
+ }
59
+ return value;
60
+ };
61
+ };
62
+ const k = (obj) => {
63
+ try {
64
+ return (0, full_1.klona)(obj);
65
+ }
66
+ catch (error) {
67
+ return (0, full_1.klona)(JSON.parse(JSON.stringify(obj, getCircularReplacer())));
68
+ }
69
+ };
50
70
  function isSensitiveKey(keyStr) {
51
71
  if (keyStr && typeof keyStr == "string") {
52
72
  return sensitiveKeys.some(regex => regex.test(keyStr));
@@ -63,7 +83,7 @@ function redactObject(obj) {
63
83
  });
64
84
  }
65
85
  function redact(obj) {
66
- const copy = (0, full_1.klona)(obj); // Making a deep copy to prevent side effects
86
+ const copy = k(obj); // Making a deep copy to prevent side effects
67
87
  redactObject(copy);
68
88
  const splat = copy[Symbol.for("splat")];
69
89
  redactObject(splat); // Specifically redact splat Symbol
@@ -74,7 +94,7 @@ function truncate(str, n) {
74
94
  }
75
95
  const formatRedact = winston.format(redact);
76
96
  const stringSaver = winston.format((info) => {
77
- const copy = (0, full_1.klona)(info);
97
+ const copy = k(info);
78
98
  const splat = copy[Symbol.for("splat")];
79
99
  if (splat) {
80
100
  copy.message = `${copy.message} ${splat.filter((x) => typeof x !== 'object').join(' ')}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate",
3
- "version": "4.67.0",
3
+ "version": "4.70.0",
4
4
  "licenseCheckUrl": "https://funcs.openwa.dev/license-check",
5
5
  "brokenMethodReportUrl": "https://funcs.openwa.dev/report-bm",
6
6
  "patches": "https://cdn.openwa.dev/patches.json",
@@ -72,7 +72,6 @@
72
72
  "@types/express": "^4.17.11",
73
73
  "@types/fs-extra": "^9.0.11",
74
74
  "@types/line-reader": "0.0.34",
75
- "@types/localtunnel": "^2.0.1",
76
75
  "@types/marked": "^4.0.2",
77
76
  "@types/mime": "^3.0.1",
78
77
  "@types/node": "^18.7.6",
@@ -106,7 +105,7 @@
106
105
  "dependencies": {
107
106
  "@brillout/import": "^0.2.1",
108
107
  "@discordjs/collection": "0.8.0",
109
- "@open-wa/wa-automate-socket-client": "*",
108
+ "@open-wa/wa-automate-socket-client": "^3.3.0",
110
109
  "@open-wa/wa-decrypt": "^4.3.1",
111
110
  "atob": "^2.1.2",
112
111
  "aws4": "^1.11.0",
@@ -116,6 +115,7 @@
116
115
  "change-case": "^4.1.2",
117
116
  "chokidar": "^3.5.3",
118
117
  "chrome-launcher": "^0.15.0",
118
+ "cloudflared": "^0.5.1",
119
119
  "command-exists": "^1.2.9",
120
120
  "command-line-usage": "^6.1.1",
121
121
  "cors": "^2.8.5",
@@ -138,7 +138,6 @@
138
138
  "is-url-superb": "^5.0.0",
139
139
  "json5": "^2.2.0",
140
140
  "klona": "^2.0.5",
141
- "localtunnel": "^2.0.2",
142
141
  "lodash.uniq": "^4.5.0",
143
142
  "meow": "^9.0.0",
144
143
  "mime": "^3.0.0",