@openclaw/whatsapp 2026.8.1 → 2026.8.33
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/dist/{accounts-CeKQbu_s.js → .setup/accounts-u_tUoK19.mjs} +2 -2
- package/dist/{action-runtime-YA_Yvunu.js → .setup/action-runtime-BVUf4f89.mjs} +3 -3
- package/dist/{active-listener-BEjWsCNM.js → .setup/active-listener-CDjoX9QR.mjs} +2 -2
- package/dist/{agent-tools-login-B-2qZPzc.js → .setup/agent-tools-login-B6MAs75N.mjs} +2 -2
- package/dist/{approval-handler.runtime-C7jZ8rsD.js → .setup/approval-handler.runtime-CgvhxI9D.mjs} +7 -7
- package/dist/{approval-reactions-rpaNVHzZ.js → .setup/approval-reactions-C9Nq1Mee.mjs} +9 -7
- package/dist/{auth-store-CtpBqH5S.js → .setup/auth-store-BLlwNwk9.mjs} +8 -6
- package/dist/{channel-Dx09AAmX.js → .setup/channel-Dhl5A0do.mjs} +31 -27
- package/dist/{channel-react-action-n9a8Hk5i.js → .setup/channel-react-action-N47OoLaS.mjs} +5 -5
- package/dist/{channel.runtime-D_PjmeMT.js → .setup/channel.runtime-y-t7P-gt.mjs} +6 -6
- package/dist/{channel.setup-CRJQiWbh.js → .setup/channel.setup-DWNu3iNB.mjs} +1 -1
- package/dist/{config-schema-BQP5YCeK.js → .setup/config-schema-BYA6e_Ii.mjs} +6 -4
- package/dist/{connection-controller-CIYuBJrs.js → .setup/connection-controller-DdJ3ZYk3.mjs} +5 -5
- package/dist/{connection-controller-runtime-context-DG0tuYuw.js → .setup/connection-controller-runtime-context-hgLJoRc8.mjs} +1 -1
- package/dist/{constants-HU41RHGI.js → .setup/constants-C7m81BNe.mjs} +1 -1
- package/dist/{directory-config-Ci8Jjsw4.js → .setup/directory-config-CyZpW0t5.mjs} +8 -8
- package/dist/{group-session-key-CH9jJIVQ.js → .setup/group-session-key-Bx_RT7LG.mjs} +6 -6
- package/dist/.setup/legacy-session-surface-api-B2szjq4r.mjs +2 -0
- package/dist/{login-1u5WcfTn.js → .setup/login-B6mR1G7c.mjs} +7 -6
- package/dist/{login-qr-B_1sr0hk.js → .setup/login-qr-y11oWl3Y.mjs} +11 -9
- package/dist/{monitor-CySzv38g.js → .setup/monitor-CZx0S7kj.mjs} +88 -72
- package/dist/.setup/normalize-B1wBftQ7.mjs +2 -0
- package/dist/{question-reactions-B9D6MHXZ.js → .setup/question-reactions-CP6JdAfC.mjs} +2 -2
- package/dist/{resolve-outbound-target-1GqbT1uX.js → .setup/resolve-outbound-target-CHYl534S.mjs} +1 -1
- package/dist/{send-C3S-NqyO.js → .setup/send-DhVkeVOL.mjs} +57 -32
- package/dist/{send-api-C-FFC1p_.js → .setup/send-api-BkGtYGVg.mjs} +44 -42
- package/dist/{session.runtime-Nsqaehbd.js → .setup/session.runtime-DcJuO42v.mjs} +1 -1
- package/dist/{setup-finalize-CRzMpx84.js → .setup/setup-finalize-CQGl6GiM.mjs} +9 -8
- package/dist/.setup/setup-plugin-api-CNoGyXrL.mjs +3 -0
- package/dist/{setup-surface-ym4doiv3.js → .setup/setup-surface-B51IvfDU.mjs} +4 -4
- package/dist/{shared-D3B14d45.js → .setup/shared-BGXdIKoz.mjs} +14 -13
- package/dist/{socket-close-2T0_jZTN.js → .setup/socket-close-Ci2nLeBQ.mjs} +12 -9
- package/dist/{targets-runtime-TMk0lGuy.js → .setup/targets-runtime-RBjx3pg_.mjs} +1 -2
- package/dist/{text-runtime-CaKLhowd.js → .setup/text-runtime-CHl0iPYe.mjs} +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/action-runtime.runtime.js +1 -1
- package/dist/agent-tools-api.js +5 -5
- package/dist/api.js +15 -15
- package/dist/auth-presence.js +1 -1
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +5 -5
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +2 -2
- package/dist/legacy-session-surface-api.js +1 -1
- package/dist/light-runtime-api.js +4 -4
- package/dist/login-qr-runtime.js +1 -1
- package/dist/runtime-api.js +13 -13
- package/dist/runtime-setter-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/setup-entry.js +3 -2
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/baileys/node_modules/process-warning/.github/dependabot.yml +42 -2
- package/node_modules/baileys/node_modules/process-warning/.github/workflows/ci.yml +12 -1
- package/node_modules/baileys/node_modules/process-warning/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/baileys/node_modules/process-warning/LICENSE +1 -1
- package/node_modules/baileys/node_modules/process-warning/README.md +41 -2
- package/node_modules/baileys/node_modules/process-warning/index.js +85 -17
- package/node_modules/baileys/node_modules/process-warning/package.json +6 -7
- package/node_modules/baileys/node_modules/process-warning/test/emit-once-only.test.js +3 -3
- package/node_modules/baileys/node_modules/process-warning/test/emit-reset.test.js +4 -4
- package/node_modules/baileys/node_modules/process-warning/test/emit-unlimited.test.js +2 -2
- package/node_modules/baileys/node_modules/process-warning/test/spy-warning.test.js +143 -0
- package/node_modules/baileys/node_modules/process-warning/types/index.d.ts +15 -1
- package/node_modules/baileys/node_modules/process-warning/types/index.tst.ts +48 -0
- package/node_modules/baileys/node_modules/ws/lib/permessage-deflate.js +3 -1
- package/node_modules/baileys/node_modules/ws/package.json +1 -1
- package/node_modules/typebox/build/format/email.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/node_modules/typebox/package.json +1 -1
- package/package.json +5 -5
- package/dist/normalize-C7Hkc_vE.js +0 -2
- package/node_modules/baileys/node_modules/process-warning/types/index.test-d.ts +0 -36
- /package/dist/{account-ids-CB5SOWjc.js → .setup/account-ids-CB5SOWjc.mjs} +0 -0
- /package/dist/{audio-preflight.runtime-C_glQhZY.js → .setup/audio-preflight.runtime-C_glQhZY.mjs} +0 -0
- /package/dist/{command-policy-BIOSHySD.js → .setup/command-policy-BIOSHySD.mjs} +0 -0
- /package/dist/{creds-files-W6B3EMZ8.js → .setup/creds-files-W6B3EMZ8.mjs} +0 -0
- /package/dist/{doctor-CwzVXKoE.js → .setup/doctor-CwzVXKoE.mjs} +0 -0
- /package/dist/{group-config-path-BGyzT9Lg.js → .setup/group-config-path-BGyzT9Lg.mjs} +0 -0
- /package/dist/{group-session-contract-DDnZSsJ1.js → .setup/group-session-contract-DDnZSsJ1.mjs} +0 -0
- /package/dist/{normalize-target-CugRyONv.js → .setup/normalize-target-CugRyONv.mjs} +0 -0
- /package/dist/{reply-resolver.runtime-Ded8D58Y.js → .setup/reply-resolver.runtime-Ded8D58Y.mjs} +0 -0
- /package/dist/{rolldown-runtime-D7D4PA-g.js → .setup/rolldown-runtime-D7D4PA-g.mjs} +0 -0
- /package/dist/{runtime-BLlToOi6.js → .setup/runtime-BLlToOi6.mjs} +0 -0
- /package/dist/{runtime-group-policy-DeSRFXEV.js → .setup/runtime-group-policy-DeSRFXEV.mjs} +0 -0
- /package/dist/{security-contract-nAzD945y.js → .setup/security-contract-nAzD945y.mjs} +0 -0
- /package/dist/{session-contract-DMTm6Q_L.js → .setup/session-contract-DMTm6Q_L.mjs} +0 -0
- /package/dist/{session-errors-JuazczrA.js → .setup/session-errors-JuazczrA.mjs} +0 -0
|
@@ -17,6 +17,7 @@ const { format } = require('node:util')
|
|
|
17
17
|
* @property {string} message - The warning message.
|
|
18
18
|
* @property {boolean} emitted - Indicates if the warning has been emitted.
|
|
19
19
|
* @property {function} format - Formats the warning message.
|
|
20
|
+
* @returns {boolean} emit - Indicates if the warning has been emitted by this call.
|
|
20
21
|
*/
|
|
21
22
|
|
|
22
23
|
/**
|
|
@@ -33,8 +34,69 @@ const { format } = require('node:util')
|
|
|
33
34
|
* @typedef {Object} ProcessWarning
|
|
34
35
|
* @property {function} createWarning - Creates a warning item.
|
|
35
36
|
* @property {function} createDeprecation - Creates a deprecation warning item.
|
|
37
|
+
* @property {function} spyWarning - Spy a warning item.
|
|
36
38
|
*/
|
|
37
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Represents the spy data.
|
|
42
|
+
* @typedef {Object} WarningSpyData
|
|
43
|
+
* @property {object} calls - Arguments of WarningItem calls with.
|
|
44
|
+
* @property {function} callCount - Number of counts called the WarningItem.
|
|
45
|
+
* @property {function} reset - Reset the calls data and state of WarningItem.
|
|
46
|
+
* @property {function} restore - Remove spy from WarningItem.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
const kWarningFn = Symbol('process-warning.fn')
|
|
50
|
+
const kWarningSpyData = Symbol('process-warning.spyData')
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Spy a warning item.
|
|
54
|
+
* @function
|
|
55
|
+
* @memberof processWarning
|
|
56
|
+
* @param {WarningItem} warning - The warning item to spy.
|
|
57
|
+
* @returns {WarningSpyData} The created spy data.
|
|
58
|
+
*/
|
|
59
|
+
function spyWarning (warning) {
|
|
60
|
+
// Do not double spy the same warning
|
|
61
|
+
if (warning[kWarningSpyData] === null) {
|
|
62
|
+
const warningFn = warning[kWarningFn]
|
|
63
|
+
warning[kWarningFn] = function (a, b, c) {
|
|
64
|
+
const args = []
|
|
65
|
+
// since warning always call by fn(a, b, c)
|
|
66
|
+
// it need to remove the trailing undefined arguments
|
|
67
|
+
if (c) {
|
|
68
|
+
args.push(a, b, c)
|
|
69
|
+
} else if (b) {
|
|
70
|
+
args.push(a, b)
|
|
71
|
+
} else if (a) {
|
|
72
|
+
args.push(a)
|
|
73
|
+
}
|
|
74
|
+
warning[kWarningSpyData].calls.push({
|
|
75
|
+
arguments: args,
|
|
76
|
+
result: warningFn(a, b, c)
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
const spyData = {
|
|
80
|
+
calls: [],
|
|
81
|
+
callCount () {
|
|
82
|
+
return spyData.calls.length
|
|
83
|
+
},
|
|
84
|
+
reset () {
|
|
85
|
+
warning.emitted = false
|
|
86
|
+
spyData.calls.length = 0
|
|
87
|
+
},
|
|
88
|
+
restore () {
|
|
89
|
+
spyData.reset()
|
|
90
|
+
warning[kWarningFn] = warningFn
|
|
91
|
+
warning[kWarningSpyData] = null
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
warning[kWarningSpyData] = spyData
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return warning[kWarningSpyData]
|
|
98
|
+
}
|
|
99
|
+
|
|
38
100
|
/**
|
|
39
101
|
* Creates a deprecation warning item.
|
|
40
102
|
* @function
|
|
@@ -62,21 +124,24 @@ function createWarning ({ name, code, message, unlimited = false } = {}) {
|
|
|
62
124
|
|
|
63
125
|
code = code.toUpperCase()
|
|
64
126
|
|
|
65
|
-
|
|
66
|
-
|
|
127
|
+
const warningFn = unlimited === true
|
|
128
|
+
? function (a, b, c) {
|
|
129
|
+
warning.emitted = true
|
|
130
|
+
process.emitWarning(warning.format(a, b, c), warning.name, warning.code)
|
|
131
|
+
return true
|
|
132
|
+
}
|
|
133
|
+
: function (a, b, c) {
|
|
67
134
|
if (warning.emitted === true && warning.unlimited !== true) {
|
|
68
|
-
return
|
|
135
|
+
return false
|
|
69
136
|
}
|
|
70
137
|
warning.emitted = true
|
|
71
138
|
process.emitWarning(warning.format(a, b, c), warning.name, warning.code)
|
|
139
|
+
return true
|
|
72
140
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
[
|
|
77
|
-
warning.emitted = true
|
|
78
|
-
process.emitWarning(warning.format(a, b, c), warning.name, warning.code)
|
|
79
|
-
}
|
|
141
|
+
|
|
142
|
+
const warningContainer = {
|
|
143
|
+
[name]: function (a, b, c) {
|
|
144
|
+
return warning[kWarningFn](a, b, c)
|
|
80
145
|
}
|
|
81
146
|
}
|
|
82
147
|
|
|
@@ -86,14 +151,16 @@ function createWarning ({ name, code, message, unlimited = false } = {}) {
|
|
|
86
151
|
warning.message = message
|
|
87
152
|
warning.unlimited = unlimited
|
|
88
153
|
warning.code = code
|
|
154
|
+
warning[kWarningFn] = warningFn
|
|
155
|
+
warning[kWarningSpyData] = null
|
|
89
156
|
|
|
90
157
|
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
158
|
+
* Formats the warning message.
|
|
159
|
+
* @param {*} [a] Possible message interpolation value.
|
|
160
|
+
* @param {*} [b] Possible message interpolation value.
|
|
161
|
+
* @param {*} [c] Possible message interpolation value.
|
|
162
|
+
* @returns {string} The formatted warning message.
|
|
163
|
+
*/
|
|
97
164
|
warning.format = function (a, b, c) {
|
|
98
165
|
let formatted
|
|
99
166
|
if (a && b && c) {
|
|
@@ -116,9 +183,10 @@ function createWarning ({ name, code, message, unlimited = false } = {}) {
|
|
|
116
183
|
* @namespace
|
|
117
184
|
* @property {function} createWarning - Creates a warning item.
|
|
118
185
|
* @property {function} createDeprecation - Creates a deprecation warning item.
|
|
186
|
+
* @property {function} spyWarning - Spy a warning item.
|
|
119
187
|
* @property {ProcessWarning} processWarning - Represents the process warning functionality.
|
|
120
188
|
*/
|
|
121
|
-
const out = { createWarning, createDeprecation }
|
|
189
|
+
const out = { createWarning, createDeprecation, spyWarning }
|
|
122
190
|
module.exports = out
|
|
123
191
|
module.exports.default = out
|
|
124
192
|
module.exports.processWarning = out
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "process-warning",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "A small utility for creating warnings and emitting them.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"test": "npm run test:unit && npm run test:jest && npm run test:typescript",
|
|
12
12
|
"test:jest": "jest jest.test.js",
|
|
13
13
|
"test:unit": "c8 --100 node --test",
|
|
14
|
-
"test:typescript": "
|
|
14
|
+
"test:typescript": "tstyche"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
@@ -62,12 +62,11 @@
|
|
|
62
62
|
}
|
|
63
63
|
],
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@fastify/pre-commit": "^2.1.0",
|
|
66
65
|
"benchmark": "^2.1.4",
|
|
67
|
-
"c8": "^
|
|
66
|
+
"c8": "^12.0.0",
|
|
68
67
|
"eslint": "^9.17.0",
|
|
69
|
-
"jest": "^
|
|
70
|
-
"neostandard": "^0.
|
|
71
|
-
"
|
|
68
|
+
"jest": "^30.0.3",
|
|
69
|
+
"neostandard": "^0.13.0",
|
|
70
|
+
"tstyche": "^7.0.0"
|
|
72
71
|
}
|
|
73
72
|
}
|
|
@@ -5,7 +5,7 @@ const { createWarning } = require('..')
|
|
|
5
5
|
const { withResolvers } = require('./promise')
|
|
6
6
|
|
|
7
7
|
test('emit should emit a given code only once', t => {
|
|
8
|
-
t.plan(
|
|
8
|
+
t.plan(6)
|
|
9
9
|
|
|
10
10
|
const { promise, resolve } = withResolvers()
|
|
11
11
|
|
|
@@ -22,8 +22,8 @@ test('emit should emit a given code only once', t => {
|
|
|
22
22
|
code: 'CODE',
|
|
23
23
|
message: 'Hello world'
|
|
24
24
|
})
|
|
25
|
-
warn()
|
|
26
|
-
warn()
|
|
25
|
+
t.assert.strictEqual(warn(), true)
|
|
26
|
+
t.assert.strictEqual(warn(), false)
|
|
27
27
|
setImmediate(() => {
|
|
28
28
|
process.removeListener('warning', onWarning)
|
|
29
29
|
resolve()
|
|
@@ -5,7 +5,7 @@ const { createWarning } = require('../')
|
|
|
5
5
|
const { withResolvers } = require('./promise')
|
|
6
6
|
|
|
7
7
|
test('a limited warning can be re-set', t => {
|
|
8
|
-
t.plan(
|
|
8
|
+
t.plan(7)
|
|
9
9
|
|
|
10
10
|
const { promise, resolve } = withResolvers()
|
|
11
11
|
let count = 0
|
|
@@ -20,14 +20,14 @@ test('a limited warning can be re-set', t => {
|
|
|
20
20
|
message: 'Hello world'
|
|
21
21
|
})
|
|
22
22
|
|
|
23
|
-
warn()
|
|
23
|
+
t.assert.strictEqual(warn(), true)
|
|
24
24
|
t.assert.ok(warn.emitted)
|
|
25
25
|
|
|
26
|
-
warn()
|
|
26
|
+
t.assert.strictEqual(warn(), false)
|
|
27
27
|
t.assert.ok(warn.emitted)
|
|
28
28
|
|
|
29
29
|
warn.emitted = false
|
|
30
|
-
warn()
|
|
30
|
+
t.assert.strictEqual(warn(), true)
|
|
31
31
|
t.assert.ok(warn.emitted)
|
|
32
32
|
|
|
33
33
|
setImmediate(() => {
|
|
@@ -5,7 +5,7 @@ const { createWarning } = require('..')
|
|
|
5
5
|
const { withResolvers } = require('./promise')
|
|
6
6
|
|
|
7
7
|
test('emit should emit a given code unlimited times', t => {
|
|
8
|
-
t.plan(
|
|
8
|
+
t.plan(60)
|
|
9
9
|
|
|
10
10
|
let runs = 0
|
|
11
11
|
const expectedRun = []
|
|
@@ -31,7 +31,7 @@ test('emit should emit a given code unlimited times', t => {
|
|
|
31
31
|
|
|
32
32
|
for (let i = 0; i < times; i++) {
|
|
33
33
|
expectedRun.push(i)
|
|
34
|
-
warn()
|
|
34
|
+
t.assert.strictEqual(warn(), true)
|
|
35
35
|
}
|
|
36
36
|
setImmediate(() => {
|
|
37
37
|
process.removeListener('warning', onWarning)
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const { test } = require('node:test')
|
|
4
|
+
const { createWarning } = require('..')
|
|
5
|
+
const { spyWarning } = require('..')
|
|
6
|
+
|
|
7
|
+
test('Spy ProcessWarning - unlimited: false', t => {
|
|
8
|
+
const warning = createWarning({
|
|
9
|
+
name: 'Warning',
|
|
10
|
+
code: 'WRN',
|
|
11
|
+
message: 'Hello %s'
|
|
12
|
+
})
|
|
13
|
+
const spyData = spyWarning(warning)
|
|
14
|
+
|
|
15
|
+
t.assert.strictEqual(warning.emitted, false)
|
|
16
|
+
t.assert.deepStrictEqual(spyData.calls, [])
|
|
17
|
+
t.assert.strictEqual(spyData.callCount(), 0)
|
|
18
|
+
|
|
19
|
+
warning('World')
|
|
20
|
+
t.assert.strictEqual(warning.emitted, true)
|
|
21
|
+
t.assert.deepStrictEqual(spyData.calls[0].arguments, ['World'])
|
|
22
|
+
t.assert.strictEqual(spyData.calls[0].result, true)
|
|
23
|
+
t.assert.strictEqual(spyData.callCount(), 1)
|
|
24
|
+
|
|
25
|
+
warning('World')
|
|
26
|
+
t.assert.strictEqual(warning.emitted, true)
|
|
27
|
+
t.assert.deepStrictEqual(spyData.calls[0].arguments, ['World'])
|
|
28
|
+
t.assert.strictEqual(spyData.calls[0].result, true)
|
|
29
|
+
t.assert.deepStrictEqual(spyData.calls[1].arguments, ['World'])
|
|
30
|
+
t.assert.strictEqual(spyData.calls[1].result, false)
|
|
31
|
+
t.assert.strictEqual(spyData.callCount(), 2)
|
|
32
|
+
|
|
33
|
+
spyData.reset()
|
|
34
|
+
t.assert.strictEqual(warning.emitted, false)
|
|
35
|
+
t.assert.deepStrictEqual(spyData.calls, [])
|
|
36
|
+
t.assert.strictEqual(spyData.callCount(), 0)
|
|
37
|
+
|
|
38
|
+
warning('World')
|
|
39
|
+
t.assert.strictEqual(warning.emitted, true)
|
|
40
|
+
t.assert.deepStrictEqual(spyData.calls[0].arguments, ['World'])
|
|
41
|
+
t.assert.strictEqual(spyData.calls[0].result, true)
|
|
42
|
+
t.assert.strictEqual(spyData.callCount(), 1)
|
|
43
|
+
|
|
44
|
+
spyData.restore()
|
|
45
|
+
t.assert.strictEqual(warning.emitted, false)
|
|
46
|
+
t.assert.deepStrictEqual(spyData.calls, [])
|
|
47
|
+
t.assert.strictEqual(spyData.callCount(), 0)
|
|
48
|
+
|
|
49
|
+
warning('World')
|
|
50
|
+
t.assert.strictEqual(warning.emitted, true)
|
|
51
|
+
t.assert.deepStrictEqual(spyData.calls, [])
|
|
52
|
+
t.assert.strictEqual(spyData.callCount(), 0)
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
test('Spy ProcessWarning - unlimited: true', t => {
|
|
56
|
+
const warning = createWarning({
|
|
57
|
+
name: 'Warning',
|
|
58
|
+
code: 'WRN',
|
|
59
|
+
message: 'Hello %s',
|
|
60
|
+
unlimited: true
|
|
61
|
+
})
|
|
62
|
+
const spyData = spyWarning(warning)
|
|
63
|
+
|
|
64
|
+
t.assert.strictEqual(warning.emitted, false)
|
|
65
|
+
t.assert.deepStrictEqual(spyData.calls, [])
|
|
66
|
+
t.assert.strictEqual(spyData.callCount(), 0)
|
|
67
|
+
|
|
68
|
+
warning('World')
|
|
69
|
+
t.assert.strictEqual(warning.emitted, true)
|
|
70
|
+
t.assert.deepStrictEqual(spyData.calls[0].arguments, ['World'])
|
|
71
|
+
t.assert.strictEqual(spyData.calls[0].result, true)
|
|
72
|
+
t.assert.strictEqual(spyData.callCount(), 1)
|
|
73
|
+
|
|
74
|
+
warning('World')
|
|
75
|
+
t.assert.strictEqual(warning.emitted, true)
|
|
76
|
+
t.assert.deepStrictEqual(spyData.calls[0].arguments, ['World'])
|
|
77
|
+
t.assert.strictEqual(spyData.calls[0].result, true)
|
|
78
|
+
t.assert.deepStrictEqual(spyData.calls[1].arguments, ['World'])
|
|
79
|
+
t.assert.strictEqual(spyData.calls[1].result, true)
|
|
80
|
+
t.assert.strictEqual(spyData.callCount(), 2)
|
|
81
|
+
|
|
82
|
+
spyData.reset()
|
|
83
|
+
t.assert.strictEqual(warning.emitted, false)
|
|
84
|
+
t.assert.deepStrictEqual(spyData.calls, [])
|
|
85
|
+
t.assert.strictEqual(spyData.callCount(), 0)
|
|
86
|
+
|
|
87
|
+
warning('World')
|
|
88
|
+
t.assert.strictEqual(warning.emitted, true)
|
|
89
|
+
t.assert.deepStrictEqual(spyData.calls[0].arguments, ['World'])
|
|
90
|
+
t.assert.strictEqual(spyData.calls[0].result, true)
|
|
91
|
+
t.assert.strictEqual(spyData.callCount(), 1)
|
|
92
|
+
|
|
93
|
+
spyData.restore()
|
|
94
|
+
t.assert.strictEqual(warning.emitted, false)
|
|
95
|
+
t.assert.deepStrictEqual(spyData.calls, [])
|
|
96
|
+
t.assert.strictEqual(spyData.callCount(), 0)
|
|
97
|
+
|
|
98
|
+
warning('World')
|
|
99
|
+
t.assert.strictEqual(warning.emitted, true)
|
|
100
|
+
t.assert.deepStrictEqual(spyData.calls, [])
|
|
101
|
+
t.assert.strictEqual(spyData.callCount(), 0)
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
test('Spy ProcessWarning - calls[].arguments', t => {
|
|
105
|
+
const warning = createWarning({
|
|
106
|
+
name: 'Warning',
|
|
107
|
+
code: 'WRN',
|
|
108
|
+
message: 'Hello %s'
|
|
109
|
+
})
|
|
110
|
+
const spyData = spyWarning(warning)
|
|
111
|
+
|
|
112
|
+
warning(undefined)
|
|
113
|
+
t.assert.deepStrictEqual(spyData.calls[0].arguments, [])
|
|
114
|
+
spyData.reset()
|
|
115
|
+
|
|
116
|
+
warning()
|
|
117
|
+
t.assert.deepStrictEqual(spyData.calls[0].arguments, [])
|
|
118
|
+
spyData.reset()
|
|
119
|
+
|
|
120
|
+
warning('World')
|
|
121
|
+
t.assert.deepStrictEqual(spyData.calls[0].arguments, ['World'])
|
|
122
|
+
spyData.reset()
|
|
123
|
+
|
|
124
|
+
warning('World', 'Hello')
|
|
125
|
+
t.assert.deepStrictEqual(spyData.calls[0].arguments, ['World', 'Hello'])
|
|
126
|
+
spyData.reset()
|
|
127
|
+
|
|
128
|
+
warning(undefined, 'Hello')
|
|
129
|
+
t.assert.deepStrictEqual(spyData.calls[0].arguments, [undefined, 'Hello'])
|
|
130
|
+
spyData.reset()
|
|
131
|
+
|
|
132
|
+
warning('World', 'Hello', 'World')
|
|
133
|
+
t.assert.deepStrictEqual(spyData.calls[0].arguments, ['World', 'Hello', 'World'])
|
|
134
|
+
spyData.reset()
|
|
135
|
+
|
|
136
|
+
warning('World', undefined, 'World')
|
|
137
|
+
t.assert.deepStrictEqual(spyData.calls[0].arguments, ['World', undefined, 'World'])
|
|
138
|
+
spyData.reset()
|
|
139
|
+
|
|
140
|
+
warning(undefined, 'Hello', 'World')
|
|
141
|
+
t.assert.deepStrictEqual(spyData.calls[0].arguments, [undefined, 'Hello', 'World'])
|
|
142
|
+
spyData.reset()
|
|
143
|
+
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare namespace processWarning {
|
|
2
2
|
export interface WarningItem {
|
|
3
|
-
(a?: any, b?: any, c?: any):
|
|
3
|
+
(a?: any, b?: any, c?: any): boolean;
|
|
4
4
|
name: string;
|
|
5
5
|
code: string;
|
|
6
6
|
message: string;
|
|
@@ -22,13 +22,27 @@ declare namespace processWarning {
|
|
|
22
22
|
unlimited?: boolean;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
export type WarningSpyData = {
|
|
26
|
+
calls: WarningCallData[],
|
|
27
|
+
callCount(): number
|
|
28
|
+
reset(): void
|
|
29
|
+
restore(): void
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type WarningCallData = {
|
|
33
|
+
arguments: unknown[]
|
|
34
|
+
result: boolean
|
|
35
|
+
}
|
|
36
|
+
|
|
25
37
|
export type ProcessWarning = {
|
|
26
38
|
createWarning(params: WarningOptions): WarningItem;
|
|
27
39
|
createDeprecation(params: DeprecationOptions): WarningItem;
|
|
40
|
+
spyWarning(warning: WarningItem): WarningSpyData
|
|
28
41
|
}
|
|
29
42
|
|
|
30
43
|
export function createWarning (params: WarningOptions): WarningItem
|
|
31
44
|
export function createDeprecation (params: DeprecationOptions): WarningItem
|
|
45
|
+
export function spyWarning (warning: WarningItem): WarningSpyData
|
|
32
46
|
|
|
33
47
|
const processWarning: ProcessWarning
|
|
34
48
|
export { processWarning as default }
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { expect } from 'tstyche'
|
|
2
|
+
import { createDeprecation, createWarning, spyWarning, WarningCallData, WarningSpyData } from '..'
|
|
3
|
+
|
|
4
|
+
const WarnInstance = createWarning({
|
|
5
|
+
name: 'TypeScriptWarning',
|
|
6
|
+
code: 'CODE',
|
|
7
|
+
message: 'message'
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
expect(WarnInstance.code).type.toBe<string>()
|
|
11
|
+
expect(WarnInstance.message).type.toBe<string>()
|
|
12
|
+
expect(WarnInstance.name).type.toBe<string>()
|
|
13
|
+
expect(WarnInstance.emitted).type.toBe<boolean>()
|
|
14
|
+
expect(WarnInstance.unlimited).type.toBe<boolean>()
|
|
15
|
+
|
|
16
|
+
expect(WarnInstance()).type.toBe<boolean>()
|
|
17
|
+
expect(WarnInstance('foo')).type.toBe<boolean>()
|
|
18
|
+
expect(WarnInstance('foo', 'bar')).type.toBe<boolean>()
|
|
19
|
+
|
|
20
|
+
const buildWarnUnlimited = createWarning({
|
|
21
|
+
name: 'TypeScriptWarning',
|
|
22
|
+
code: 'CODE',
|
|
23
|
+
message: 'message',
|
|
24
|
+
unlimited: true
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
expect(buildWarnUnlimited.unlimited).type.toBe<boolean>()
|
|
28
|
+
|
|
29
|
+
const DeprecationInstance = createDeprecation({
|
|
30
|
+
code: 'CODE',
|
|
31
|
+
message: 'message'
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
expect(DeprecationInstance.code).type.toBe<string>()
|
|
35
|
+
|
|
36
|
+
expect(DeprecationInstance()).type.toBe<boolean>()
|
|
37
|
+
expect(DeprecationInstance('foo')).type.toBe<boolean>()
|
|
38
|
+
expect(DeprecationInstance('foo', 'bar')).type.toBe<boolean>()
|
|
39
|
+
|
|
40
|
+
const spyData = spyWarning(WarnInstance)
|
|
41
|
+
expect(spyData).type.toBe<WarningSpyData>()
|
|
42
|
+
expect(spyData.calls).type.toBe<WarningCallData[]>()
|
|
43
|
+
expect(spyData.callCount).type.toBe<(() => number)>()
|
|
44
|
+
expect(spyData.callCount()).type.toBe<number>()
|
|
45
|
+
expect(spyData.reset).type.toBe<(() => void)>()
|
|
46
|
+
expect(spyData.reset()).type.toBe<void>()
|
|
47
|
+
expect(spyData.restore).type.toBe<(() => void)>()
|
|
48
|
+
expect(spyData.restore()).type.toBe<void>()
|
|
@@ -167,7 +167,9 @@ class PerMessageDeflate {
|
|
|
167
167
|
(typeof opts.serverMaxWindowBits === 'number' &&
|
|
168
168
|
opts.serverMaxWindowBits > params.server_max_window_bits))) ||
|
|
169
169
|
(typeof opts.clientMaxWindowBits === 'number' &&
|
|
170
|
-
|
|
170
|
+
(typeof params.client_max_window_bits === 'number'
|
|
171
|
+
? opts.clientMaxWindowBits > params.client_max_window_bits
|
|
172
|
+
: !params.client_max_window_bits))
|
|
171
173
|
) {
|
|
172
174
|
return false;
|
|
173
175
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const Email = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]
|
|
1
|
+
const Email = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is an Email
|
|
4
4
|
* @specification https://datatracker.ietf.org/doc/html/rfc5322
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as FormatBidi from './format/bidi.mjs';
|
|
2
2
|
import * as LabelUnicode from './label/unicode.mjs';
|
|
3
3
|
import * as LabelPuny from './label/puny.mjs';
|
|
4
|
+
// ------------------------------------------------------------------
|
|
5
|
+
// IsLabel
|
|
6
|
+
// ------------------------------------------------------------------
|
|
4
7
|
function IsValidLabelLength(value) {
|
|
5
8
|
return value.length > 0 && value.length <= 63;
|
|
6
9
|
}
|
|
@@ -8,9 +11,24 @@ function IsLabel(value) {
|
|
|
8
11
|
return IsValidLabelLength(value) && (LabelPuny.IsPunyLabel(value) ||
|
|
9
12
|
LabelUnicode.IsUnicodeLabel(value));
|
|
10
13
|
}
|
|
14
|
+
// ------------------------------------------------------------------
|
|
15
|
+
// NormalizeHostname
|
|
16
|
+
//
|
|
17
|
+
// Normalizes a hostname for label validation. Normalizes for NFC
|
|
18
|
+
// such that equivalent codepoint sequences can be uniformly
|
|
19
|
+
// compared. It also removes codepoints that IDNA mapping ignores,
|
|
20
|
+
// and converts full stop variants to ASCII '.' so the hostname can
|
|
21
|
+
// be split into labels.
|
|
22
|
+
// ------------------------------------------------------------------
|
|
11
23
|
function NormalizeHostname(value) {
|
|
12
|
-
return value
|
|
24
|
+
return value
|
|
25
|
+
.normalize('NFC')
|
|
26
|
+
.replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu, '') // RE_IGNORED_MAPPING
|
|
27
|
+
.replace(/[\u002E\u3002\uFF0E\uFF61]/g, '.'); // RE_FULL_STOP_MAPPING
|
|
13
28
|
}
|
|
29
|
+
// ------------------------------------------------------------------
|
|
30
|
+
// IsIdnHostname
|
|
31
|
+
// ------------------------------------------------------------------
|
|
14
32
|
export function IsIdnHostname(value) {
|
|
15
33
|
if (value.length === 0 || value.includes(' '))
|
|
16
34
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/whatsapp",
|
|
3
|
-
"version": "2026.8.
|
|
3
|
+
"version": "2026.8.33",
|
|
4
4
|
"description": "OpenClaw WhatsApp channel plugin for WhatsApp Web chats.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"audio-decode": "2.2.3",
|
|
12
12
|
"baileys": "7.0.0-rc14",
|
|
13
|
-
"typebox": "1.3.
|
|
13
|
+
"typebox": "1.3.17"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"openclaw": ">=2026.8.
|
|
16
|
+
"openclaw": ">=2026.8.33"
|
|
17
17
|
},
|
|
18
18
|
"peerDependenciesMeta": {
|
|
19
19
|
"openclaw": {
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"minHostVersion": ">=2026.4.25"
|
|
66
66
|
},
|
|
67
67
|
"compat": {
|
|
68
|
-
"pluginApi": ">=2026.8.
|
|
68
|
+
"pluginApi": ">=2026.8.33"
|
|
69
69
|
},
|
|
70
70
|
"build": {
|
|
71
|
-
"openclawVersion": "2026.8.
|
|
71
|
+
"openclawVersion": "2026.8.33"
|
|
72
72
|
},
|
|
73
73
|
"release": {
|
|
74
74
|
"publishToClawHub": true,
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { expectType } from 'tsd'
|
|
2
|
-
import { createWarning, createDeprecation } from '..'
|
|
3
|
-
|
|
4
|
-
const WarnInstance = createWarning({
|
|
5
|
-
name: 'TypeScriptWarning',
|
|
6
|
-
code: 'CODE',
|
|
7
|
-
message: 'message'
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
expectType<string>(WarnInstance.code)
|
|
11
|
-
expectType<string>(WarnInstance.message)
|
|
12
|
-
expectType<string>(WarnInstance.name)
|
|
13
|
-
expectType<boolean>(WarnInstance.emitted)
|
|
14
|
-
expectType<boolean>(WarnInstance.unlimited)
|
|
15
|
-
|
|
16
|
-
expectType<void>(WarnInstance())
|
|
17
|
-
expectType<void>(WarnInstance('foo'))
|
|
18
|
-
expectType<void>(WarnInstance('foo', 'bar'))
|
|
19
|
-
|
|
20
|
-
const buildWarnUnlimited = createWarning({
|
|
21
|
-
name: 'TypeScriptWarning',
|
|
22
|
-
code: 'CODE',
|
|
23
|
-
message: 'message',
|
|
24
|
-
unlimited: true
|
|
25
|
-
})
|
|
26
|
-
expectType<boolean>(buildWarnUnlimited.unlimited)
|
|
27
|
-
|
|
28
|
-
const DeprecationInstance = createDeprecation({
|
|
29
|
-
code: 'CODE',
|
|
30
|
-
message: 'message'
|
|
31
|
-
})
|
|
32
|
-
expectType<string>(DeprecationInstance.code)
|
|
33
|
-
|
|
34
|
-
DeprecationInstance()
|
|
35
|
-
DeprecationInstance('foo')
|
|
36
|
-
DeprecationInstance('foo', 'bar')
|
|
File without changes
|
/package/dist/{audio-preflight.runtime-C_glQhZY.js → .setup/audio-preflight.runtime-C_glQhZY.mjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{group-session-contract-DDnZSsJ1.js → .setup/group-session-contract-DDnZSsJ1.mjs}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/{reply-resolver.runtime-Ded8D58Y.js → .setup/reply-resolver.runtime-Ded8D58Y.mjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|