mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:50:42 +00:00
refactor: narrow whatsapp runtime api barrel
This commit is contained in:
@@ -1,12 +1,86 @@
|
||||
export * from "./src/active-listener.js";
|
||||
export * from "./src/action-runtime.js";
|
||||
export * from "./src/agent-tools-login.js";
|
||||
export * from "./src/auth-store.js";
|
||||
export * from "./src/auto-reply.js";
|
||||
export * from "./src/inbound.js";
|
||||
export * from "./src/login.js";
|
||||
export * from "./src/media.js";
|
||||
export * from "./src/send.js";
|
||||
export * from "./src/session.js";
|
||||
export {
|
||||
getActiveWebListener,
|
||||
resolveWebAccountId,
|
||||
type ActiveWebListener,
|
||||
type ActiveWebSendOptions,
|
||||
} from "./src/active-listener.js";
|
||||
export { handleWhatsAppAction, whatsAppActionRuntime } from "./src/action-runtime.js";
|
||||
export { createWhatsAppLoginTool } from "./src/agent-tools-login.js";
|
||||
export {
|
||||
formatWhatsAppWebAuthStatusState,
|
||||
getWebAuthAgeMs,
|
||||
hasWebCredsSync,
|
||||
logWebSelfId,
|
||||
logoutWeb,
|
||||
pickWebChannel,
|
||||
readCredsJsonRaw,
|
||||
readWebAuthExistsBestEffort,
|
||||
readWebAuthExistsForDecision,
|
||||
readWebAuthSnapshot,
|
||||
readWebAuthSnapshotBestEffort,
|
||||
readWebAuthState,
|
||||
readWebSelfId,
|
||||
readWebSelfIdentity,
|
||||
readWebSelfIdentityForDecision,
|
||||
resolveDefaultWebAuthDir,
|
||||
resolveWebCredsBackupPath,
|
||||
resolveWebCredsPath,
|
||||
restoreCredsFromBackupIfNeeded,
|
||||
WA_WEB_AUTH_DIR,
|
||||
webAuthExists,
|
||||
WHATSAPP_AUTH_UNSTABLE_CODE,
|
||||
WhatsAppAuthUnstableError,
|
||||
type WhatsAppWebAuthState,
|
||||
} from "./src/auth-store.js";
|
||||
export {
|
||||
DEFAULT_WEB_MEDIA_BYTES,
|
||||
HEARTBEAT_PROMPT,
|
||||
HEARTBEAT_TOKEN,
|
||||
monitorWebChannel,
|
||||
resolveHeartbeatRecipients,
|
||||
runWebHeartbeatOnce,
|
||||
SILENT_REPLY_TOKEN,
|
||||
stripHeartbeatToken,
|
||||
type WebChannelStatus,
|
||||
type WebMonitorTuning,
|
||||
} from "./src/auto-reply.js";
|
||||
export {
|
||||
extractContactContext,
|
||||
extractLocationData,
|
||||
extractMediaPlaceholder,
|
||||
extractText,
|
||||
monitorWebInbox,
|
||||
resetWebInboundDedupe,
|
||||
type WebInboundMessage,
|
||||
type WebListenerCloseReason,
|
||||
} from "./src/inbound.js";
|
||||
export { loginWeb } from "./src/login.js";
|
||||
export {
|
||||
getDefaultLocalRoots,
|
||||
loadWebMedia,
|
||||
loadWebMediaRaw,
|
||||
LocalMediaAccessError,
|
||||
optimizeImageToJpeg,
|
||||
optimizeImageToPng,
|
||||
type LocalMediaAccessErrorCode,
|
||||
type WebMediaResult,
|
||||
} from "./src/media.js";
|
||||
export {
|
||||
sendMessageWhatsApp,
|
||||
sendPollWhatsApp,
|
||||
sendReactionWhatsApp,
|
||||
sendTypingWhatsApp,
|
||||
} from "./src/send.js";
|
||||
export {
|
||||
createWaSocket,
|
||||
formatError,
|
||||
getStatusCode,
|
||||
newConnectionId,
|
||||
waitForCredsSaveQueue,
|
||||
waitForCredsSaveQueueWithTimeout,
|
||||
waitForWaConnection,
|
||||
writeCredsJsonAtomically,
|
||||
type CredsQueueWaitResult,
|
||||
} from "./src/session.js";
|
||||
export { setWhatsAppRuntime } from "./src/runtime.js";
|
||||
export { startWebLoginWithQr, waitForWebLogin } from "./login-qr-runtime.js";
|
||||
|
||||
@@ -233,16 +233,16 @@ const RUNTIME_API_EXPORT_GUARDS: Record<string, readonly string[]> = {
|
||||
],
|
||||
[bundledPluginFile({ rootDir: ROOT_DIR, pluginId: "whatsapp", relativePath: "runtime-api.ts" })]:
|
||||
[
|
||||
'export * from "./src/active-listener.js";',
|
||||
'export * from "./src/action-runtime.js";',
|
||||
'export * from "./src/agent-tools-login.js";',
|
||||
'export * from "./src/auth-store.js";',
|
||||
'export * from "./src/auto-reply.js";',
|
||||
'export * from "./src/inbound.js";',
|
||||
'export * from "./src/login.js";',
|
||||
'export * from "./src/media.js";',
|
||||
'export * from "./src/send.js";',
|
||||
'export * from "./src/session.js";',
|
||||
'export { getActiveWebListener, resolveWebAccountId, type ActiveWebListener, type ActiveWebSendOptions } from "./src/active-listener.js";',
|
||||
'export { handleWhatsAppAction, whatsAppActionRuntime } from "./src/action-runtime.js";',
|
||||
'export { createWhatsAppLoginTool } from "./src/agent-tools-login.js";',
|
||||
'export { formatWhatsAppWebAuthStatusState, getWebAuthAgeMs, hasWebCredsSync, logWebSelfId, logoutWeb, pickWebChannel, readCredsJsonRaw, readWebAuthExistsBestEffort, readWebAuthExistsForDecision, readWebAuthSnapshot, readWebAuthSnapshotBestEffort, readWebAuthState, readWebSelfId, readWebSelfIdentity, readWebSelfIdentityForDecision, resolveDefaultWebAuthDir, resolveWebCredsBackupPath, resolveWebCredsPath, restoreCredsFromBackupIfNeeded, WA_WEB_AUTH_DIR, webAuthExists, WHATSAPP_AUTH_UNSTABLE_CODE, WhatsAppAuthUnstableError, type WhatsAppWebAuthState } from "./src/auth-store.js";',
|
||||
'export { DEFAULT_WEB_MEDIA_BYTES, HEARTBEAT_PROMPT, HEARTBEAT_TOKEN, monitorWebChannel, resolveHeartbeatRecipients, runWebHeartbeatOnce, SILENT_REPLY_TOKEN, stripHeartbeatToken, type WebChannelStatus, type WebMonitorTuning } from "./src/auto-reply.js";',
|
||||
'export { extractContactContext, extractLocationData, extractMediaPlaceholder, extractText, monitorWebInbox, resetWebInboundDedupe, type WebInboundMessage, type WebListenerCloseReason } from "./src/inbound.js";',
|
||||
'export { loginWeb } from "./src/login.js";',
|
||||
'export { getDefaultLocalRoots, loadWebMedia, loadWebMediaRaw, LocalMediaAccessError, optimizeImageToJpeg, optimizeImageToPng, type LocalMediaAccessErrorCode, type WebMediaResult } from "./src/media.js";',
|
||||
'export { sendMessageWhatsApp, sendPollWhatsApp, sendReactionWhatsApp, sendTypingWhatsApp } from "./src/send.js";',
|
||||
'export { createWaSocket, formatError, getStatusCode, newConnectionId, waitForCredsSaveQueue, waitForCredsSaveQueueWithTimeout, waitForWaConnection, writeCredsJsonAtomically, type CredsQueueWaitResult } from "./src/session.js";',
|
||||
'export { setWhatsAppRuntime } from "./src/runtime.js";',
|
||||
'export { startWebLoginWithQr, waitForWebLogin } from "./login-qr-runtime.js";',
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user