@itznomo/baileys 0.0.0-stage → 0.0.3
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/BUTTONS.md +153 -0
- package/Example/call-bot.mjs +38 -0
- package/Example/example.mjs +36 -0
- package/Example/full-bot-commands.mjs +319 -0
- package/Example/full-bot.mjs +77 -0
- package/LICENSE +21 -0
- package/README.md +543 -2
- package/WAProto/@dnuzi +1 -0
- package/WAProto/index.d.ts +15932 -0
- package/WAProto/index.js +113300 -0
- package/assets/banner.svg +17 -0
- package/assets/devider.svg +1 -0
- package/assets/features.svg +21 -0
- package/docs/CALLS.md +106 -0
- package/docs/FEATURES.md +1152 -0
- package/engine-requirements.js +19 -0
- package/index.d.ts +815 -0
- package/package.json +51 -4
- package/src/binary/wa-binary-constants.js +1300 -0
- package/src/binary/wa-binary.js +627 -0
- package/src/constants.js +147 -0
- package/src/defaults.js +106 -0
- package/src/foundation/ai-rich.js +654 -0
- package/src/foundation/audio-duration.js +470 -0
- package/src/foundation/audio-samples.js +250 -0
- package/src/foundation/boom.js +39 -0
- package/src/foundation/builders.js +851 -0
- package/src/foundation/cache.js +134 -0
- package/src/foundation/concurrency.js +69 -0
- package/src/foundation/curve25519.js +189 -0
- package/src/foundation/image-thumb.js +65 -0
- package/src/foundation/link-preview.js +278 -0
- package/src/foundation/logger.js +78 -0
- package/src/foundation/long.js +130 -0
- package/src/foundation/performance.js +385 -0
- package/src/foundation/protobuf-minimal.js +587 -0
- package/src/foundation/qrcode-terminal.js +273 -0
- package/src/foundation/sql-database.js +716 -0
- package/src/foundation/wa-crypto.js +47 -0
- package/src/foundation/zip.js +108 -0
- package/src/index.js +67 -0
- package/src/signal/libsignal.js +996 -0
- package/src/signal/signal-group.js +455 -0
- package/src/signal/signal-repository.js +635 -0
- package/src/socket/business-communities.js +811 -0
- package/src/socket/chats.js +702 -0
- package/src/socket/groups-newsletter.js +524 -0
- package/src/socket/messages-recv.js +1815 -0
- package/src/socket/messages-send.js +1526 -0
- package/src/socket/socket-builder.js +131 -0
- package/src/socket/socket-core.js +913 -0
- package/src/socket/usync.js +287 -0
- package/src/socket-client/native-websocket.js +344 -0
- package/src/socket-client/websocket-client.js +170 -0
- package/src/utils/auth-state-core.js +731 -0
- package/src/utils/auth-state-storage.js +594 -0
- package/src/utils/chat-sync.js +1046 -0
- package/src/utils/check-status.js +159 -0
- package/src/utils/cstoken.js +17 -0
- package/src/utils/media.js +807 -0
- package/src/utils/message-compose.js +1747 -0
- package/src/utils/message-processing.js +912 -0
- package/src/utils/modern-messages.js +435 -0
- package/src/utils/nomo-buttons.js +138 -0
- package/src/utils/nomo-commands.js +168 -0
- package/src/utils/spam-report-utils.js +136 -0
- package/src/utils/use-keyv-auth-state.js +307 -0
- package/src/utils/username.js +19 -0
- package/src/utils/wa-protocol-core.js +1227 -0
- package/src/voip/WaVoipCoordinator.js +158 -0
- package/src/voip/app-data/WaAppDataStream.js +193 -0
- package/src/voip/app-data/protocol.js +172 -0
- package/src/voip/auto.js +139 -0
- package/src/voip/bytes.js +63 -0
- package/src/voip/call/WaCallManager.js +442 -0
- package/src/voip/call/WaCallMediaSession.js +1727 -0
- package/src/voip/call/call-state.js +203 -0
- package/src/voip/crypto/encryption.js +13 -0
- package/src/voip/crypto/primitives.js +21 -0
- package/src/voip/crypto/rtcp.js +66 -0
- package/src/voip/crypto/srtp.js +180 -0
- package/src/voip/crypto/ssrc.js +15 -0
- package/src/voip/index.js +730 -0
- package/src/voip/media/WaAudioEngine.js +486 -0
- package/src/voip/media/WaVideoEngine.js +275 -0
- package/src/voip/media/audio-codec.js +0 -0
- package/src/voip/media/audio-reorder.js +107 -0
- package/src/voip/media/h264.js +246 -0
- package/src/voip/media/mlow-codec.js +465 -0
- package/src/voip/media/rtcp.js +68 -0
- package/src/voip/media/rtp.js +242 -0
- package/src/voip/protobuf.js +30 -0
- package/src/voip/relay/WaManualRelay.js +609 -0
- package/src/voip/relay/datachannel/pre-negotiated.js +25 -0
- package/src/voip/relay/dtls/aead.js +46 -0
- package/src/voip/relay/dtls/cert-builder.js +102 -0
- package/src/voip/relay/dtls/der.js +98 -0
- package/src/voip/relay/dtls/ecdhe.js +37 -0
- package/src/voip/relay/dtls/handshake-framing.js +100 -0
- package/src/voip/relay/dtls/handshake-messages.js +158 -0
- package/src/voip/relay/dtls/handshake.js +582 -0
- package/src/voip/relay/dtls/prf.js +39 -0
- package/src/voip/relay/dtls/record.js +56 -0
- package/src/voip/relay/relay-ack.js +141 -0
- package/src/voip/relay/sctp/association.js +434 -0
- package/src/voip/relay/sctp/crc32c.js +21 -0
- package/src/voip/relay/sctp/wire.js +226 -0
- package/src/voip/relay/stun.js +463 -0
- package/src/voip/shim/baileys-resolve.js +7 -0
- package/src/voip/shim/core.js +66 -0
- package/src/voip/shim/crypto.js +6 -0
- package/src/voip/shim/proto.js +10 -0
- package/src/voip/shim/protocol.js +130 -0
- package/src/voip/shim/transport.js +82 -0
- package/src/voip/shim/util.js +207 -0
- package/src/voip/signaling/bridge.js +102 -0
- package/src/voip/signaling/screen-share.js +60 -0
- package/src/voip/signaling/signaling.js +491 -0
- package/src/voip/types.js +69 -0
- package/src/voip/voip-deps.js +243 -0
- package/src/voip/voipClient.js +314 -0
- package/src/wam/wam-constants.js +22852 -0
- package/src/wam/wam.js +146 -0
- package/voip.d.ts +144 -0
package/src/constants.js
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { proto } from '../WAProto/index.js'
|
|
2
|
+
|
|
3
|
+
export { proto as WAProto }
|
|
4
|
+
|
|
5
|
+
export const ALL_WA_PATCH_NAMES = ['critical_block', 'critical_unblock_low', 'regular_high', 'regular_low', 'regular']
|
|
6
|
+
|
|
7
|
+
export const AssociationType = proto.MessageAssociation.AssociationType
|
|
8
|
+
export const ButtonHeaderType = proto.Message.ButtonsMessage.HeaderType
|
|
9
|
+
export const ButtonType = proto.Message.ButtonsMessage.Button.Type
|
|
10
|
+
export const CarouselCardType = proto.Message.InteractiveMessage.CarouselMessage.CarouselCardType
|
|
11
|
+
export const ListType = proto.Message.ListMessage.ListType
|
|
12
|
+
export const ProtocolType = proto.Message.ProtocolMessage.Type
|
|
13
|
+
export const WAMessageStubType = proto.WebMessageInfo.StubType
|
|
14
|
+
export const WAMessageStatus = proto.WebMessageInfo.Status
|
|
15
|
+
|
|
16
|
+
export const WAMessageAddressingMode = { PN: 'pn', LID: 'lid' }
|
|
17
|
+
|
|
18
|
+
export const LabelColor = Object.freeze(
|
|
19
|
+
Object.fromEntries(Array.from({ length: 20 }, (_, i) => [`Color${i + 1}`, i]))
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
export const LabelAssociationType = { Chat: 'label_jid', Message: 'label_message' }
|
|
23
|
+
|
|
24
|
+
export const XWAPaths = {
|
|
25
|
+
xwa2_newsletter_create: 'xwa2_newsletter_create',
|
|
26
|
+
xwa2_newsletter_followers: 'xwa2_newsletter_followers',
|
|
27
|
+
xwa2_newsletter_admin_insights: 'xwa2_newsletter_admin_insights',
|
|
28
|
+
xwa2_newsletter_subscribed: 'xwa2_newsletter_subscribed',
|
|
29
|
+
xwa2_newsletter_view: 'xwa2_newsletter_view',
|
|
30
|
+
xwa2_newsletter_metadata: 'xwa2_newsletter',
|
|
31
|
+
xwa2_newsletter_admin_count: 'xwa2_newsletter_admin',
|
|
32
|
+
xwa2_newsletter_mute_v2: 'xwa2_newsletter_mute_v2',
|
|
33
|
+
xwa2_newsletter_unmute_v2: 'xwa2_newsletter_unmute_v2',
|
|
34
|
+
xwa2_newsletter_follow: 'xwa2_newsletter_follow',
|
|
35
|
+
xwa2_newsletter_unfollow: 'xwa2_newsletter_unfollow',
|
|
36
|
+
xwa2_newsletter_join_v2: 'xwa2_newsletter_join_v2',
|
|
37
|
+
xwa2_newsletter_leave_v2: 'xwa2_newsletter_leave_v2',
|
|
38
|
+
xwa2_newsletter_change_owner: 'xwa2_newsletter_change_owner',
|
|
39
|
+
xwa2_newsletter_demote: 'xwa2_newsletter_demote',
|
|
40
|
+
xwa2_newsletter_delete_v2: 'xwa2_newsletter_delete_v2',
|
|
41
|
+
xwa2_fetch_account_reachout_timelock: 'xwa2_fetch_account_reachout_timelock',
|
|
42
|
+
xwa2_message_capping_info: 'xwa2_message_capping_info'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const QueryIds = {
|
|
46
|
+
CREATE: '8823471724422422',
|
|
47
|
+
UPDATE_METADATA: '24250201037901610',
|
|
48
|
+
METADATA: '6563316087068696',
|
|
49
|
+
PENDING_ADMIN_INVITES: '9783111038412085',
|
|
50
|
+
FOLLOWERS: '27472091235714801',
|
|
51
|
+
INSIGHTS: '9853618868050977',
|
|
52
|
+
ADMIN_INFO: '26278439461859188',
|
|
53
|
+
SUBSCRIBED: '6388546374527196',
|
|
54
|
+
FOLLOW: '24404358912487870',
|
|
55
|
+
UNFOLLOW: '9767147403369991',
|
|
56
|
+
MUTE: '29766401636284406',
|
|
57
|
+
UNMUTE: '9864994326891137',
|
|
58
|
+
ADMIN_COUNT: '26278439461859188',
|
|
59
|
+
CHANGE_OWNER: '9546742745432473',
|
|
60
|
+
DEMOTE: '9880997548630971',
|
|
61
|
+
DELETE: '30062808666639665',
|
|
62
|
+
PROMOTE: '9801384413216421',
|
|
63
|
+
CREATE_ADMIN_INVITE: '9387141988078609',
|
|
64
|
+
REVOKE_ADMIN_INVITE: '9656078347839416',
|
|
65
|
+
ACCEPT_ADMIN_INVITE: '9580828702035549',
|
|
66
|
+
CHANNEL_REPORTS: '35936238352686172',
|
|
67
|
+
CREATE_REPORT_APPEAL: '27103316329328467',
|
|
68
|
+
UPDATE_USER_SETTING: '31938993655691868',
|
|
69
|
+
RECOMMENDED: '25806748772361516',
|
|
70
|
+
SIMILAR: '26217043484590756',
|
|
71
|
+
DIRECTORY_LIST: '26125047313831973',
|
|
72
|
+
DIRECTORY_SEARCH: '26301059626252132',
|
|
73
|
+
DIRECTORY_CATEGORIES: '35266481849605779',
|
|
74
|
+
REACHOUT_TIMELOCK: '23983697327930364',
|
|
75
|
+
MESSAGE_CAPPING_INFO: '24503548349331633'
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const CodeHighlightType = { DEFAULT: 0, KEYWORD: 1, METHOD: 2, STRING: 3, NUMBER: 4, COMMENT: 5 }
|
|
79
|
+
|
|
80
|
+
export const RichSubMessageType = {
|
|
81
|
+
UNKNOWN: 0,
|
|
82
|
+
GRID_IMAGE: 1,
|
|
83
|
+
TEXT: 2,
|
|
84
|
+
INLINE_IMAGE: 3,
|
|
85
|
+
TABLE: 4,
|
|
86
|
+
CODE: 5,
|
|
87
|
+
DYNAMIC: 6,
|
|
88
|
+
MAP: 7,
|
|
89
|
+
LATEX: 8,
|
|
90
|
+
CONTENT_ITEMS: 9
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export const SyncState = { Connecting: 0, AwaitingInitialSync: 1, Syncing: 2, Online: 3 }
|
|
94
|
+
|
|
95
|
+
export const ReachoutTimelockEnforcementType = {
|
|
96
|
+
BIZ_COMMERCE_VIOLATION_ALCOHOL: 'BIZ_COMMERCE_VIOLATION_ALCOHOL',
|
|
97
|
+
BIZ_COMMERCE_VIOLATION_ADULT: 'BIZ_COMMERCE_VIOLATION_ADULT',
|
|
98
|
+
BIZ_COMMERCE_VIOLATION_ANIMALS: 'BIZ_COMMERCE_VIOLATION_ANIMALS',
|
|
99
|
+
BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS: 'BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS',
|
|
100
|
+
BIZ_COMMERCE_VIOLATION_DATING: 'BIZ_COMMERCE_VIOLATION_DATING',
|
|
101
|
+
BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS: 'BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS',
|
|
102
|
+
BIZ_COMMERCE_VIOLATION_DRUGS: 'BIZ_COMMERCE_VIOLATION_DRUGS',
|
|
103
|
+
BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC: 'BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC',
|
|
104
|
+
BIZ_COMMERCE_VIOLATION_GAMBLING: 'BIZ_COMMERCE_VIOLATION_GAMBLING',
|
|
105
|
+
BIZ_COMMERCE_VIOLATION_HEALTHCARE: 'BIZ_COMMERCE_VIOLATION_HEALTHCARE',
|
|
106
|
+
BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY: 'BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY',
|
|
107
|
+
BIZ_COMMERCE_VIOLATION_SUPPLEMENTS: 'BIZ_COMMERCE_VIOLATION_SUPPLEMENTS',
|
|
108
|
+
BIZ_COMMERCE_VIOLATION_TOBACCO: 'BIZ_COMMERCE_VIOLATION_TOBACCO',
|
|
109
|
+
BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT: 'BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT',
|
|
110
|
+
BIZ_COMMERCE_VIOLATION_WEAPONS: 'BIZ_COMMERCE_VIOLATION_WEAPONS',
|
|
111
|
+
BIZ_QUALITY: 'BIZ_QUALITY',
|
|
112
|
+
|
|
113
|
+
DEFAULT: 'DEFAULT',
|
|
114
|
+
WEB_COMPANION_ONLY: 'WEB_COMPANION_ONLY'
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const NewChatMessageCappingStatusType = { NONE: 'NONE', FIRST_WARNING: 'FIRST_WARNING', SECOND_WARNING: 'SECOND_WARNING', CAPPED: 'CAPPED' }
|
|
118
|
+
|
|
119
|
+
export const NewChatMessageCappingMVStatusType = {
|
|
120
|
+
NOT_ELIGIBLE: 'NOT_ELIGIBLE',
|
|
121
|
+
NOT_ACTIVE: 'NOT_ACTIVE',
|
|
122
|
+
ACTIVE: 'ACTIVE',
|
|
123
|
+
ACTIVE_UPGRADE_AVAILABLE: 'ACTIVE_UPGRADE_AVAILABLE'
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export const NewChatMessageCappingOTEStatusType = {
|
|
127
|
+
NOT_ELIGIBLE: 'NOT_ELIGIBLE',
|
|
128
|
+
ELIGIBLE: 'ELIGIBLE',
|
|
129
|
+
ACTIVE_IN_CURRENT_CYCLE: 'ACTIVE_IN_CURRENT_CYCLE',
|
|
130
|
+
EXHAUSTED: 'EXHAUSTED'
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export const DisconnectReason = {}
|
|
134
|
+
for (const [name, code] of [
|
|
135
|
+
['connectionClosed', 428],
|
|
136
|
+
['connectionLost', 408],
|
|
137
|
+
['connectionReplaced', 440],
|
|
138
|
+
['timedOut', 408],
|
|
139
|
+
['loggedOut', 401],
|
|
140
|
+
['badSession', 500],
|
|
141
|
+
['restartRequired', 515],
|
|
142
|
+
['multideviceMismatch', 411],
|
|
143
|
+
['forbidden', 403],
|
|
144
|
+
['unavailableService', 503]
|
|
145
|
+
]) {
|
|
146
|
+
DisconnectReason[(DisconnectReason[name] = code)] = name
|
|
147
|
+
}
|
package/src/defaults.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { proto } from '../WAProto/index.js'
|
|
2
|
+
import { makeLibSignalRepository } from './signal/signal-repository.js'
|
|
3
|
+
import { Browsers, KEY_BUNDLE_TYPE } from './utils/wa-protocol-core.js'
|
|
4
|
+
import { createLogger } from './foundation/logger.js'
|
|
5
|
+
|
|
6
|
+
const logger = createLogger()
|
|
7
|
+
|
|
8
|
+
const version = [2, 3000, 1047970367]
|
|
9
|
+
|
|
10
|
+
export const UNAUTHORIZED_CODES = [401, 403, 419]
|
|
11
|
+
export const BIZ_BOT_SUPPORT_PAYLOAD =
|
|
12
|
+
'{"version":1,"is_ai_message":true,"should_upload_client_logs":false,"should_show_system_message":false,"ticket_id":"7004947587700716","citation_items":[],"ticket_locale":"us"}'
|
|
13
|
+
export const DEFAULT_ORIGIN = 'https://web.whatsapp.com'
|
|
14
|
+
export const CALL_VIDEO_PREFIX = 'https://call.whatsapp.com/video/'
|
|
15
|
+
export const CALL_AUDIO_PREFIX = 'https://call.whatsapp.com/voice/'
|
|
16
|
+
export const LIBRARY_NAME = 'Baileys'
|
|
17
|
+
export const DEF_CALLBACK_PREFIX = 'CB:'
|
|
18
|
+
export const DEF_TAG_PREFIX = 'TAG:'
|
|
19
|
+
export const PHONE_CONNECTION_CB = 'CB:Pong'
|
|
20
|
+
export const WA_ADV_ACCOUNT_SIG_PREFIX = Buffer.from([6, 0])
|
|
21
|
+
export const WA_ADV_DEVICE_SIG_PREFIX = Buffer.from([6, 1])
|
|
22
|
+
export const WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX = Buffer.from([6, 5])
|
|
23
|
+
export const WA_ADV_HOSTED_DEVICE_SIG_PREFIX = Buffer.from([6, 6])
|
|
24
|
+
export const WA_DEFAULT_EPHEMERAL = 7 * 24 * 60 * 60
|
|
25
|
+
export const STATUS_EXPIRY_SECONDS = 24 * 60 * 60
|
|
26
|
+
export const PLACEHOLDER_MAX_AGE_SECONDS = 14 * 24 * 60 * 60
|
|
27
|
+
export const NOISE_MODE = 'Noise_XX_25519_AESGCM_SHA256\0\0\0\0'
|
|
28
|
+
export const DICT_VERSION = 3
|
|
29
|
+
|
|
30
|
+
export { KEY_BUNDLE_TYPE }
|
|
31
|
+
export const NOISE_WA_HEADER = Buffer.from([87, 65, 6, DICT_VERSION])
|
|
32
|
+
|
|
33
|
+
export const WA_CERT_DETAILS = {
|
|
34
|
+
SERIAL: 0,
|
|
35
|
+
ISSUER: 'WhatsAppLongTerm1',
|
|
36
|
+
PUBLIC_KEY: Buffer.from('142375574d0a587166aae71ebe516437c4a28b73e3695c6ce1f7f9545da8ee6b', 'hex')
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const PROCESSABLE_HISTORY_TYPES = [
|
|
40
|
+
proto.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP,
|
|
41
|
+
proto.HistorySync.HistorySyncType.PUSH_NAME,
|
|
42
|
+
proto.HistorySync.HistorySyncType.RECENT,
|
|
43
|
+
proto.HistorySync.HistorySyncType.FULL,
|
|
44
|
+
proto.HistorySync.HistorySyncType.ON_DEMAND,
|
|
45
|
+
proto.HistorySync.HistorySyncType.NON_BLOCKING_DATA,
|
|
46
|
+
proto.HistorySync.HistorySyncType.INITIAL_STATUS_V3
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
export const DEFAULT_CACHE_TTLS = {
|
|
50
|
+
SIGNAL_STORE: 5 * 60,
|
|
51
|
+
MSG_RETRY: 60 * 60,
|
|
52
|
+
CALL_OFFER: 5 * 60,
|
|
53
|
+
USER_DEVICES: 5 * 60
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const DEFAULT_CONNECTION_CONFIG = {
|
|
57
|
+
version,
|
|
58
|
+
browser: Browsers.macOS('Chrome'),
|
|
59
|
+
waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',
|
|
60
|
+
connectTimeoutMs: 20000,
|
|
61
|
+
keepAliveIntervalMs: 30000,
|
|
62
|
+
logger: logger.child({ class: 'baileys' }),
|
|
63
|
+
emitOwnEvents: true,
|
|
64
|
+
defaultQueryTimeoutMs: 60000,
|
|
65
|
+
customUploadHosts: [],
|
|
66
|
+
retryRequestDelayMs: 250,
|
|
67
|
+
maxMsgRetryCount: 5,
|
|
68
|
+
fireInitQueries: true,
|
|
69
|
+
disableStickyRouting: false,
|
|
70
|
+
auth: undefined,
|
|
71
|
+
markOnlineOnConnect: true,
|
|
72
|
+
syncFullHistory: true,
|
|
73
|
+
patchMessageBeforeSending: msg => msg,
|
|
74
|
+
shouldSyncHistoryMessage: ({ syncType }) => syncType !== proto.HistorySync.HistorySyncType.FULL,
|
|
75
|
+
shouldIgnoreJid: () => false,
|
|
76
|
+
linkPreviewImageThumbnailWidth: 192,
|
|
77
|
+
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 },
|
|
78
|
+
generateHighQualityLinkPreview: false,
|
|
79
|
+
enableAutoSessionRecreation: true,
|
|
80
|
+
enableRecentMessageCache: true,
|
|
81
|
+
options: {},
|
|
82
|
+
appStateMacVerification: { patch: false, snapshot: false },
|
|
83
|
+
countryCode: 'US',
|
|
84
|
+
getMessage: async () => undefined,
|
|
85
|
+
cachedGroupMetadata: async () => undefined,
|
|
86
|
+
makeSignalRepository: makeLibSignalRepository,
|
|
87
|
+
/**
|
|
88
|
+
* Performance mode preset.
|
|
89
|
+
* - 'balanced' (default) – safe, backward-compatible, moderate caching
|
|
90
|
+
* - 'high' – aggressive caching & coalescing, still RAM-bounded
|
|
91
|
+
* - 'low-memory' – small caches, frequent eviction
|
|
92
|
+
*/
|
|
93
|
+
performanceMode: 'balanced'
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const HISTORY_SYNC_PAUSED_TIMEOUT_MS = 120000
|
|
97
|
+
export const MIN_PREKEY_COUNT = 5
|
|
98
|
+
export const INITIAL_PREKEY_COUNT = 812
|
|
99
|
+
export const UPLOAD_TIMEOUT = 30000
|
|
100
|
+
|
|
101
|
+
export const TimeMs = {
|
|
102
|
+
Minute: 60 * 1000,
|
|
103
|
+
Hour: 60 * 60 * 1000,
|
|
104
|
+
Day: 24 * 60 * 60 * 1000,
|
|
105
|
+
Week: 7 * 24 * 60 * 60 * 1000
|
|
106
|
+
}
|