@badzz88/baileys 8.5.7 → 8.5.9

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.
Files changed (142) hide show
  1. package/README.md +337 -1055
  2. package/WAProto/WAProto.proto +284 -264
  3. package/WAProto/index.js +5 -5
  4. package/engine-requirements.js +7 -15
  5. package/lib/Defaults/index.js +130 -187
  6. package/lib/Signal/Group/ciphertext-message.js +11 -14
  7. package/lib/Signal/Group/group-session-builder.js +29 -91
  8. package/lib/Signal/Group/group_cipher.js +81 -88
  9. package/lib/Signal/Group/index.js +12 -136
  10. package/lib/Signal/Group/keyhelper.js +15 -70
  11. package/lib/Signal/Group/sender-chain-key.js +25 -31
  12. package/lib/Signal/Group/sender-key-distribution-message.js +62 -65
  13. package/lib/Signal/Group/sender-key-message.js +65 -68
  14. package/lib/Signal/Group/sender-key-name.js +41 -43
  15. package/lib/Signal/Group/sender-key-record.js +40 -43
  16. package/lib/Signal/Group/sender-key-state.js +83 -96
  17. package/lib/Signal/Group/sender-message-key.js +25 -29
  18. package/lib/Signal/libsignal.js +425 -453
  19. package/lib/Signal/lid-mapping.js +276 -259
  20. package/lib/Socket/Client/index.js +3 -30
  21. package/lib/Socket/Client/types.js +10 -12
  22. package/lib/Socket/Client/websocket.js +53 -61
  23. package/lib/Socket/business.js +379 -422
  24. package/lib/Socket/chats.js +1193 -1816
  25. package/lib/Socket/communities.js +431 -549
  26. package/lib/Socket/graphql.js +672 -612
  27. package/lib/Socket/groups.js +374 -764
  28. package/lib/Socket/index.js +17 -38
  29. package/lib/Socket/interop.js +417 -503
  30. package/lib/Socket/messages-recv.js +1915 -2441
  31. package/lib/Socket/messages-send.js +1213 -1630
  32. package/lib/Socket/mex.js +9 -15
  33. package/lib/Socket/newsletter.js +746 -808
  34. package/lib/Socket/privacy.js +310 -441
  35. package/lib/Socket/socket.js +1025 -1022
  36. package/lib/Socket/username.js +8 -15
  37. package/lib/Store/index.js +10 -36
  38. package/lib/Store/make-cache-manager-store.js +80 -85
  39. package/lib/Store/make-in-memory-store.js +231 -591
  40. package/lib/Store/make-ordered-dictionary.js +72 -78
  41. package/lib/Store/object-repository.js +28 -25
  42. package/lib/Types/Auth.js +2 -38
  43. package/lib/Types/Bussines.js +2 -2
  44. package/lib/Types/Call.js +2 -2
  45. package/lib/Types/Chat.js +8 -4
  46. package/lib/Types/Contact.js +2 -2
  47. package/lib/Types/Events.js +2 -2
  48. package/lib/Types/GroupMetadata.js +2 -2
  49. package/lib/Types/Label.js +24 -26
  50. package/lib/Types/LabelAssociation.js +6 -8
  51. package/lib/Types/Message.js +11 -95
  52. package/lib/Types/Mex.js +111 -112
  53. package/lib/Types/Product.js +2 -2
  54. package/lib/Types/Signal.js +2 -2
  55. package/lib/Types/Socket.js +3 -2
  56. package/lib/Types/State.js +56 -70
  57. package/lib/Types/USync.js +2 -2
  58. package/lib/Types/index.js +26 -55
  59. package/lib/Utils/auth-utils.js +288 -292
  60. package/lib/Utils/browser-utils.js +47 -113
  61. package/lib/Utils/business.js +224 -240
  62. package/lib/Utils/chat-utils.js +869 -1205
  63. package/lib/Utils/companion-reg-client-utils.js +34 -41
  64. package/lib/Utils/crypto.js +107 -144
  65. package/lib/Utils/decode-wa-message.js +308 -518
  66. package/lib/Utils/event-buffer.js +611 -596
  67. package/lib/Utils/generics.js +355 -515
  68. package/lib/Utils/history.js +134 -244
  69. package/lib/Utils/identity-change-handler.js +49 -51
  70. package/lib/Utils/index.js +23 -57
  71. package/lib/Utils/link-preview.js +77 -135
  72. package/lib/Utils/logger.js +3 -9
  73. package/lib/Utils/lt-hash.js +6 -37
  74. package/lib/Utils/make-mutex.js +33 -36
  75. package/lib/Utils/message-composer.js +233 -439
  76. package/lib/Utils/message-retry-manager.js +260 -265
  77. package/lib/Utils/messages-media.js +829 -855
  78. package/lib/Utils/messages.js +961 -2528
  79. package/lib/Utils/noise-handler.js +200 -195
  80. package/lib/Utils/offline-node-processor.js +33 -35
  81. package/lib/Utils/pre-key-manager.js +102 -103
  82. package/lib/Utils/process-message.js +560 -978
  83. package/lib/Utils/reporting-utils.js +253 -257
  84. package/lib/Utils/signal.js +195 -218
  85. package/lib/Utils/stanza-ack.js +29 -31
  86. package/lib/Utils/sticker.js +109 -144
  87. package/lib/Utils/sync-action-utils.js +45 -50
  88. package/lib/Utils/tc-token-utils.js +139 -137
  89. package/lib/Utils/use-multi-file-auth-state.js +109 -109
  90. package/lib/Utils/validate-connection.js +202 -218
  91. package/lib/WABinary/constants.js +1299 -1302
  92. package/lib/WABinary/decode.js +262 -343
  93. package/lib/WABinary/encode.js +4 -12
  94. package/lib/WABinary/generic-utils.js +187 -223
  95. package/lib/WABinary/index.js +6 -33
  96. package/lib/WABinary/jid-utils.js +88 -351
  97. package/lib/WABinary/types.js +2 -2
  98. package/lib/WAM/BinaryInfo.js +9 -12
  99. package/lib/WAM/constants.js +22853 -39486
  100. package/lib/WAM/encode.js +140 -132
  101. package/lib/WAM/index.js +4 -31
  102. package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +21 -23
  103. package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +9 -9
  104. package/lib/WAUSync/Protocols/USyncContactProtocol.js +7 -7
  105. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +10 -10
  106. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +7 -7
  107. package/lib/WAUSync/Protocols/USyncFeatureProtocol.js +11 -12
  108. package/lib/WAUSync/Protocols/USyncLIDProtocol.js +4 -5
  109. package/lib/WAUSync/Protocols/USyncPictureProtocol.js +7 -7
  110. package/lib/WAUSync/Protocols/USyncSidelistProtocol.js +7 -8
  111. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +7 -7
  112. package/lib/WAUSync/Protocols/USyncTextStatusProtocol.js +8 -8
  113. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +7 -7
  114. package/lib/WAUSync/Protocols/index.js +12 -39
  115. package/lib/WAUSync/USyncQuery.js +67 -49
  116. package/lib/WAUSync/USyncUser.js +11 -5
  117. package/lib/WAUSync/index.js +3 -31
  118. package/lib/index.js +15 -48
  119. package/package.json +129 -99
  120. package/LICENSE +0 -21
  121. package/lib/Defaults/phonenumber-mcc.json +0 -223
  122. package/lib/Socket/aigroups.js +0 -240
  123. package/lib/Socket/interactive-handler.js +0 -522
  124. package/lib/Socket/managed-account.js +0 -183
  125. package/lib/Socket/registration.js +0 -427
  126. package/lib/Socket/text-router.js +0 -83
  127. package/lib/Types/Newsletter.js +0 -121
  128. package/lib/Utils/command-loader.d.ts +0 -31
  129. package/lib/Utils/command-loader.js +0 -100
  130. package/lib/Utils/consumer-application.js +0 -107
  131. package/lib/Utils/curve25519-js.js +0 -275
  132. package/lib/Utils/group-history.js +0 -60
  133. package/lib/Utils/jid-display-normalization.js +0 -218
  134. package/lib/Utils/meta-ai-msmsg.js +0 -262
  135. package/lib/Utils/native-bridge.js +0 -82
  136. package/lib/Utils/session-pool.d.ts +0 -16
  137. package/lib/Utils/session-pool.js +0 -94
  138. package/lib/Utils/sticker.d.ts +0 -17
  139. package/lib/Utils/view-once-cache.d.ts +0 -9
  140. package/lib/Utils/view-once-cache.js +0 -79
  141. package/lib/Utils/voip-rekey.js +0 -22
  142. package/lib/antiban.js +0 -4637
@@ -1,240 +1,204 @@
1
- 'use strict'
2
- Object.defineProperty(exports, '__esModule', { value: true })
3
- exports.getBinaryNodeMessages =
4
- exports.reduceBinaryNodeToDictionary =
5
- exports.assertNodeErrorFree =
6
- exports.getBinaryNodeChildUInt =
7
- exports.getBinaryNodeChildString =
8
- exports.getBinaryNodeChildBuffer =
9
- exports.getAllBinaryNodeChildren =
10
- exports.getBinaryNodeChild =
11
- exports.getBinaryNodeChildren =
12
- void 0
13
- exports.binaryNodeToString = binaryNodeToString
14
- const boom_1 = require('@hapi/boom')
15
- const index_js_1 = require('../../WAProto/index.js')
1
+ import { Boom } from '@hapi/boom'
2
+ import { proto } from '../../WAProto/index.js'
3
+ import { unixTimestampSeconds } from '../Utils/generics.js'
4
+
16
5
  // some extra useful utilities
17
- const indexCache = new WeakMap()
18
- const getBinaryNodeChildren = (node, childTag) => {
19
- if (!node || !Array.isArray(node.content)) return []
20
- let index = indexCache.get(node)
21
- // Build the index once per node
22
- if (!index) {
23
- index = new Map()
24
- for (const child of node.content) {
25
- let arr = index.get(child.tag)
26
- if (!arr) index.set(child.tag, (arr = []))
27
- arr.push(child)
28
- }
29
- indexCache.set(node, index)
30
- }
31
- // Return first matching child
32
- return index.get(childTag) || []
33
- }
34
- exports.getBinaryNodeChildren = getBinaryNodeChildren
35
- const getBinaryNodeChild = (node, childTag) => {
36
- return (0, exports.getBinaryNodeChildren)(node, childTag)[0]
37
- }
38
- exports.getBinaryNodeChild = getBinaryNodeChild
39
- const getAllBinaryNodeChildren = ({ content }) => {
40
- if (Array.isArray(content)) {
41
- return content
42
- }
43
- return []
6
+ export const getBinaryNodeChildren = (node, childTag) => {
7
+ if (Array.isArray(node?.content)) {
8
+ return node.content.filter(item => item.tag === childTag)
9
+ }
10
+ return []
44
11
  }
45
- exports.getAllBinaryNodeChildren = getAllBinaryNodeChildren
46
- const getBinaryNodeChildBuffer = (node, childTag) => {
47
- const child = (0, exports.getBinaryNodeChild)(node, childTag)?.content
48
- if (Buffer.isBuffer(child) || child instanceof Uint8Array) {
49
- return child
50
- }
12
+
13
+ export const getAllBinaryNodeChildren = ({ content }) => {
14
+ if (Array.isArray(content)) {
15
+ return content
16
+ }
17
+ return []
51
18
  }
52
- exports.getBinaryNodeChildBuffer = getBinaryNodeChildBuffer
53
- const getBinaryNodeChildString = (node, childTag) => {
54
- const child = (0, exports.getBinaryNodeChild)(node, childTag)?.content
55
- if (Buffer.isBuffer(child) || child instanceof Uint8Array) {
56
- return Buffer.from(child).toString('utf-8')
57
- } else if (typeof child === 'string') {
58
- return child
59
- }
19
+
20
+ export const getBinaryNodeChild = (node, childTag) => {
21
+ if (Array.isArray(node?.content)) {
22
+ return node?.content.find(item => item.tag === childTag)
23
+ }
60
24
  }
61
- exports.getBinaryNodeChildString = getBinaryNodeChildString
62
- const getBinaryNodeChildUInt = (node, childTag, length) => {
63
- const buff = (0, exports.getBinaryNodeChildBuffer)(node, childTag)
64
- if (buff) {
65
- return bufferToUInt(buff, length)
66
- }
25
+
26
+ export const getBinaryNodeChildBuffer = (node, childTag) => {
27
+ const child = getBinaryNodeChild(node, childTag)?.content
28
+ if (Buffer.isBuffer(child) || child instanceof Uint8Array) {
29
+ return child
30
+ }
67
31
  }
68
- exports.getBinaryNodeChildUInt = getBinaryNodeChildUInt
69
- const assertNodeErrorFree = node => {
70
- const errNode = (0, exports.getBinaryNodeChild)(node, 'error')
71
- if (errNode) {
72
- throw new boom_1.Boom(errNode.attrs.text || 'Unknown error', { data: +errNode.attrs.code })
73
- }
32
+
33
+ export const getBinaryNodeChildString = (node, childTag) => {
34
+ const child = getBinaryNodeChild(node, childTag)?.content
35
+ if (Buffer.isBuffer(child) || child instanceof Uint8Array) {
36
+ return Buffer.from(child).toString('utf-8')
37
+ }
38
+ else if (typeof child === 'string') {
39
+ return child
40
+ }
74
41
  }
75
- exports.assertNodeErrorFree = assertNodeErrorFree
76
- const reduceBinaryNodeToDictionary = (node, tag) => {
77
- const nodes = (0, exports.getBinaryNodeChildren)(node, tag)
78
- const dict = nodes.reduce((dict, { attrs }) => {
79
- if (typeof attrs.name === 'string') {
80
- dict[attrs.name] = attrs.value || attrs.config_value
81
- } else {
82
- dict[attrs.config_code] = attrs.value || attrs.config_value
83
- }
84
- return dict
85
- }, {})
86
- return dict
42
+
43
+ export const getBinaryNodeChildUInt = (node, childTag, length) => {
44
+ const buff = getBinaryNodeChildBuffer(node, childTag)
45
+ if (buff) {
46
+ return bufferToUInt(buff, length)
47
+ }
87
48
  }
88
- exports.reduceBinaryNodeToDictionary = reduceBinaryNodeToDictionary
89
- const getBinaryNodeMessages = ({ content }) => {
90
- const msgs = []
91
- if (Array.isArray(content)) {
92
- for (const item of content) {
93
- if (item.tag === 'message') {
94
- msgs.push(index_js_1.proto.WebMessageInfo.decode(item.content).toJSON())
95
- }
96
- }
97
- }
98
- return msgs
49
+
50
+ export const assertNodeErrorFree = (node) => {
51
+ const errNode = getBinaryNodeChild(node, 'error')
52
+ if (errNode) {
53
+ throw new Boom(errNode.attrs.text || 'Unknown error', { data: +errNode.attrs.code })
54
+ }
99
55
  }
100
- exports.getBinaryNodeMessages = getBinaryNodeMessages
101
56
 
102
- const getBinaryFilteredButtons = nodeContent => {
103
- if (!Array.isArray(nodeContent)) return false
57
+ export const reduceBinaryNodeToDictionary = (node, tag) => {
58
+ const nodes = getBinaryNodeChildren(node, tag)
59
+ const dict = nodes.reduce((dict, { attrs }) => {
60
+ dict[attrs.name || attrs.config_code] = attrs.value || attrs.config_value
61
+ return dict
62
+ }, {})
63
+ return dict
64
+ }
104
65
 
105
- return nodeContent.some(
106
- a =>
107
- ['native_flow'].includes(a?.content?.[0]?.content?.[0]?.tag) ||
108
- ['interactive', 'buttons', 'list'].includes(a?.content?.[0]?.tag) ||
109
- ['hsm', 'biz'].includes(a?.tag)
110
- )
66
+ export const getBinaryNodeMessages = ({ content }) => {
67
+ const msgs = []
68
+ if (Array.isArray(content)) {
69
+ for (const item of content) {
70
+ if (item.tag === 'message') {
71
+ msgs.push(proto.WebMessageInfo.decode(item.content))
72
+ }
73
+ }
74
+ }
75
+ return msgs
111
76
  }
112
- exports.getBinaryFilteredButtons = getBinaryFilteredButtons
113
- const getBinaryFilteredBizBot = nodeContent => {
114
- if (!Array.isArray(nodeContent)) return false
115
77
 
116
- return nodeContent.some(b => ['bot'].includes(b?.tag) && b?.attrs?.biz_bot === '1')
78
+ function bufferToUInt(e, t) {
79
+ let a = 0;
80
+ for (let i = 0; i < t; i++) {
81
+ a = 256 * a + e[i];
82
+ }
83
+ return a;
117
84
  }
118
- exports.getBinaryFilteredBizBot = getBinaryFilteredBizBot
119
-
120
- const getAdditionalNode = name => {
121
- if (name) name = name.toLowerCase()
122
- const ts = Math.floor(Date.now() / 1000) - 77980457
123
- const order_response_name = {
124
- review_and_pay: 'order_details',
125
- review_order: 'order_status',
126
- order_status: 'order_status',
127
- payment_info: 'payment_info',
128
- payment_status: 'payment_status',
129
- payment_method: 'payment_method',
130
- catalog_message: 'catalog_message'
131
- }
132
- const flow_name = {
133
- cta_catalog: 'cta_catalog',
134
- mpm: 'mpm',
135
- call_request: 'call_permission_request',
136
- view_catalog: 'automated_greeting_message_view_catalog',
137
- wa_pay_detail: 'wa_payment_transaction_details',
138
- send_location: 'send_location',
139
- payment_key_info: 'payment_key_info'
140
- }
141
- if (order_response_name[name]) {
142
- return [
143
- {
144
- tag: 'biz',
145
- attrs: {
146
- native_flow_name: order_response_name[name]
147
- },
148
- content: []
149
- }
150
- ]
151
- } else if (flow_name[name] || name === 'interactive' || name === 'buttons') {
152
- return [
153
- {
154
- tag: 'biz',
155
- attrs: {
156
- actual_actors: '2',
157
- host_storage: '2',
158
- privacy_mode_ts: `${ts}`
159
- },
160
- content: [
161
- {
162
- tag: 'engagement',
163
- attrs: {
164
- customer_service_state: 'open',
165
- conversation_state: 'open'
166
- }
167
- },
168
- {
169
- tag: 'interactive',
170
- attrs: {
171
- type: 'native_flow',
172
- v: '1'
173
- },
174
- content: [
175
- {
176
- tag: 'native_flow',
177
- attrs: {
178
- v: '9',
179
- name: flow_name[name] ?? 'mixed'
180
- },
181
- content: []
182
- }
183
- ]
184
- }
185
- ]
186
- }
187
- ]
188
- } else {
189
- return [
190
- {
191
- tag: 'biz',
192
- attrs: {
193
- actual_actors: '2',
194
- host_storage: '2',
195
- privacy_mode_ts: `${ts}`
196
- },
197
- content: [
198
- {
199
- tag: 'engagement',
200
- attrs: {
201
- customer_service_state: 'open',
202
- conversation_state: 'open'
203
- }
204
- }
205
- ]
206
- }
207
- ]
208
- }
85
+
86
+ const tabs = (n) => '\t'.repeat(n)
87
+
88
+ export function binaryNodeToString(node, i = 0) {
89
+ if (!node) {
90
+ return node;
91
+ }
92
+ if (typeof node === 'string') {
93
+ return tabs(i) + node;
94
+ }
95
+ if (node instanceof Uint8Array) {
96
+ return tabs(i) + Buffer.from(node).toString('hex');
97
+ }
98
+ if (Array.isArray(node)) {
99
+ return node.map((x) => tabs(i + 1) + binaryNodeToString(x, i + 1)).join('\n');
100
+ }
101
+ const children = binaryNodeToString(node.content, i + 1);
102
+ const tag = `<${node.tag} ${Object.entries(node.attrs || {})
103
+ .filter(([, v]) => v!== undefined)
104
+ .map(([k, v]) => `${k}='${v}'`)
105
+ .join(' ')}`;
106
+ const content = children? `>\n${children}\n${tabs(i)}</${node.tag}>` : '/>';
107
+ return tag + content;
209
108
  }
210
- exports.getAdditionalNode = getAdditionalNode
211
109
 
212
- function bufferToUInt(e, t) {
213
- let a = 0
214
- for (let i = 0; i < t; i++) {
215
- a = 256 * a + e[i]
216
- }
217
- return a
110
+ export const getBinaryNodeFilter = (node) => {
111
+ if (!Array.isArray(node)) return false
112
+
113
+ return node.some(item =>
114
+ ['native_flow'].includes(item?.content?.[0]?.content?.[0]?.tag) ||
115
+ ['interactive', 'buttons', 'list'].includes(item?.content?.[0]?.tag) ||
116
+ ['hsm', 'biz'].includes(item?.tag) ||
117
+ ['bot'].includes(item?.tag) && item?.attrs?.biz_bot === '1'
118
+ )
218
119
  }
219
- const tabs = n => '\t'.repeat(n)
220
- function binaryNodeToString(node, i = 0) {
221
- if (!node) {
222
- return node
223
- }
224
- if (typeof node === 'string') {
225
- return tabs(i) + node
226
- }
227
- if (node instanceof Uint8Array) {
228
- return tabs(i) + Buffer.from(node).toString('hex')
229
- }
230
- if (Array.isArray(node)) {
231
- return node.map(x => tabs(i + 1) + binaryNodeToString(x, i + 1)).join('\n')
232
- }
233
- const children = binaryNodeToString(node.content, i + 1)
234
- const tag = `<${node.tag} ${Object.entries(node.attrs || {})
235
- .filter(([, v]) => v !== undefined)
236
- .map(([k, v]) => `${k}='${v}'`)
237
- .join(' ')}`
238
- const content = children ? `>\n${children}\n${tabs(i)}</${node.tag}>` : '/>'
239
- return tag + content
120
+
121
+ export const getAdditionalNode = (name) => {
122
+ if (name) name = name.toLowerCase()
123
+ const ts = unixTimestampSeconds(new Date()) - 77980457
124
+
125
+ const order_response_name = {
126
+ review_and_pay: 'order_details',
127
+ review_order: 'order_status',
128
+ order_status: 'order_status',
129
+ payment_info: 'payment_info',
130
+ payment_status: 'payment_status',
131
+ payment_method: 'payment_method',
132
+ catalog_message: 'catalog_message',
133
+ }
134
+
135
+ const flow_name = {
136
+ cta_catalog: 'cta_catalog',
137
+ mpm: 'mpm',
138
+ call_request: 'call_permission_request',
139
+ view_catalog: 'automated_greeting_message_view_catalog',
140
+ wa_pay_detail: 'wa_payment_transaction_details',
141
+ send_location: 'send_location',
142
+ payment_key_info: 'payment_key_info'
143
+ }
144
+
145
+ if(order_response_name[name]) {
146
+ return [{
147
+ tag: 'biz',
148
+ attrs: {
149
+ native_flow_name: order_response_name[name]
150
+ },
151
+ content: []
152
+ }]
153
+ } else if (flow_name[name] || name === 'interactive' || name === 'buttons') {
154
+ return [{
155
+ tag: 'biz',
156
+ attrs: {
157
+ actual_actors: '2',
158
+ host_storage: '2',
159
+ privacy_mode_ts: `${ts}`
160
+ },
161
+ content: [{
162
+ tag: 'engagement',
163
+ attrs: {
164
+ customer_service_state: 'open',
165
+ conversation_state: 'open'
166
+ }
167
+ }, {
168
+ tag: 'interactive',
169
+ attrs: {
170
+ type: 'native_flow',
171
+ v: '1'
172
+ },
173
+ content: [{
174
+ tag: 'native_flow',
175
+ attrs: {
176
+ v: '9',
177
+ name: flow_name[name]?? 'mixed',
178
+ },
179
+ content: []
180
+ }]
181
+ }]
182
+ }]
183
+ } else {
184
+ return [{
185
+ tag: 'biz',
186
+ attrs: {
187
+ actual_actors: '2',
188
+ host_storage: '2',
189
+ privacy_mode_ts: `${ts}`
190
+ },
191
+ content: [{
192
+ tag: 'engagement',
193
+ attrs: {
194
+ customer_service_state: 'open',
195
+ conversation_state: 'open'
196
+ }
197
+ }]
198
+ }]
199
+ }
240
200
  }
201
+ export const getBinaryFilteredBizBot = nodeContent => {
202
+ if (!Array.isArray(nodeContent)) return false
203
+ return nodeContent.some(b => ['bot'].includes(b?.tag) && b?.attrs?.biz_bot === '1')
204
+ }
@@ -1,33 +1,6 @@
1
- 'use strict'
2
- var __createBinding =
3
- (this && this.__createBinding) ||
4
- (Object.create
5
- ? function (o, m, k, k2) {
6
- if (k2 === undefined) k2 = k
7
- var desc = Object.getOwnPropertyDescriptor(m, k)
8
- if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = {
10
- enumerable: true,
11
- get: function () {
12
- return m[k]
13
- }
14
- }
15
- }
16
- Object.defineProperty(o, k2, desc)
17
- }
18
- : function (o, m, k, k2) {
19
- if (k2 === undefined) k2 = k
20
- o[k2] = m[k]
21
- })
22
- var __exportStar =
23
- (this && this.__exportStar) ||
24
- function (m, exports) {
25
- for (var p in m)
26
- if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p)
27
- }
28
- Object.defineProperty(exports, '__esModule', { value: true })
29
- __exportStar(require('./encode'), exports)
30
- __exportStar(require('./decode'), exports)
31
- __exportStar(require('./generic-utils'), exports)
32
- __exportStar(require('./jid-utils'), exports)
33
- __exportStar(require('./types'), exports)
1
+ export * from './encode.js';
2
+ export * from './decode.js';
3
+ export * from './generic-utils.js';
4
+ export * from './jid-utils.js';
5
+ export * from './types.js';
6
+ //# sourceMappingURL=index.js.map