@openclaw/whatsapp 2026.5.27 → 2026.5.28-beta.2

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 (62) hide show
  1. package/dist/{access-control-tKMSybhe.js → access-control-Z0fYaWrx.js} +11 -3
  2. package/dist/{action-runtime-ClWX76J7.js → action-runtime-BdhkGtaP.js} +1 -2
  3. package/dist/action-runtime-api.js +1 -1
  4. package/dist/action-runtime.runtime.js +1 -1
  5. package/dist/{active-listener-B4SDebQ6.js → active-listener-CFwkn3ho.js} +1 -1
  6. package/dist/{agent-tools-login-BDzvb3ee.js → agent-tools-login-BX7eHgDm.js} +5 -3
  7. package/dist/api.js +7 -9
  8. package/dist/{approval-handler.runtime-CnM8rqpB.js → approval-handler.runtime-C25wPeBf.js} +6 -23
  9. package/dist/{channel-DeRnX7Dx.js → channel-CeSu_mqS.js} +149 -108
  10. package/dist/channel-plugin-api.js +1 -1
  11. package/dist/{channel-react-action-Bo_hIjzN.js → channel-react-action-Cd2qkLqp.js} +2 -2
  12. package/dist/{channel.runtime-C08TFa-d.js → channel.runtime-S9MB6sub.js} +4 -4
  13. package/dist/{channel.setup-CtTHpu8o.js → channel.setup-BNqtW-u1.js} +1 -1
  14. package/dist/{connection-controller-ja6z4F_k.js → connection-controller-BZuzYCGM.js} +2 -3
  15. package/dist/contract-api.js +1 -2
  16. package/dist/light-runtime-api.js +5 -5
  17. package/dist/{login-1rs_uPW-.js → login-1yyBrXTL.js} +3 -3
  18. package/dist/{login-qr-CdhkC9Ij.js → login-qr-6DdwGlkz.js} +2 -2
  19. package/dist/login-qr-runtime.js +1 -1
  20. package/dist/{monitor-BdKlBuaK.js → monitor-CzL4sZSN.js} +9 -9
  21. package/dist/runtime-api.js +9 -9
  22. package/dist/{send-D0iPQBMX.js → send-C4LG-Cl6.js} +199 -11
  23. package/dist/{send-api-3hUuzYv1.js → send-api-C66vkRl9.js} +1 -1
  24. package/dist/{session-CDgpDc0l.js → session-D8UW2Vbn.js} +13 -10
  25. package/dist/{session-errors-BAj9D2La.js → session-errors-CbsoQqoy.js} +22 -1
  26. package/dist/{setup-core-cgB2JDjU.js → setup-core-C2os03mR.js} +2 -2
  27. package/dist/{setup-finalize-CCZdGnko.js → setup-finalize-IDTrWXtX.js} +2 -2
  28. package/dist/setup-plugin-api.js +1 -1
  29. package/dist/{setup-surface-BouY1WI8.js → setup-surface-BOhQVZqy.js} +1 -1
  30. package/npm-shrinkwrap.json +3 -26
  31. package/openclaw.plugin.json +18 -0
  32. package/package.json +4 -6
  33. package/dist/connection-controller-registry-TSX_udJp.js +0 -22
  34. package/dist/outbound-adapter-CcNeZvD_.js +0 -30
  35. package/dist/outbound-base-MHdfVWvv.js +0 -125
  36. package/dist/outbound-media-contract-B3Y-9slb.js +0 -184
  37. package/dist/outbound-payload-test-api.js +0 -2
  38. package/dist/reaction-level-BF3d5IgO.js +0 -16
  39. package/dist/runtime-group-policy-DeSRFXEV.js +0 -11
  40. package/dist/test-api.js +0 -3
  41. package/node_modules/agent-base/LICENSE +0 -22
  42. package/node_modules/agent-base/README.md +0 -69
  43. package/node_modules/agent-base/dist/helpers.d.ts +0 -10
  44. package/node_modules/agent-base/dist/helpers.d.ts.map +0 -1
  45. package/node_modules/agent-base/dist/helpers.js +0 -37
  46. package/node_modules/agent-base/dist/helpers.js.map +0 -1
  47. package/node_modules/agent-base/dist/index.d.ts +0 -37
  48. package/node_modules/agent-base/dist/index.d.ts.map +0 -1
  49. package/node_modules/agent-base/dist/index.js +0 -146
  50. package/node_modules/agent-base/dist/index.js.map +0 -1
  51. package/node_modules/agent-base/package.json +0 -46
  52. package/node_modules/https-proxy-agent/LICENSE +0 -22
  53. package/node_modules/https-proxy-agent/README.md +0 -70
  54. package/node_modules/https-proxy-agent/dist/index.d.ts +0 -43
  55. package/node_modules/https-proxy-agent/dist/index.d.ts.map +0 -1
  56. package/node_modules/https-proxy-agent/dist/index.js +0 -150
  57. package/node_modules/https-proxy-agent/dist/index.js.map +0 -1
  58. package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +0 -12
  59. package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts.map +0 -1
  60. package/node_modules/https-proxy-agent/dist/parse-proxy-response.js +0 -94
  61. package/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +0 -1
  62. package/node_modules/https-proxy-agent/package.json +0 -50
@@ -1,30 +0,0 @@
1
- import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-CcdugbDf.js";
2
- import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-B3Y-9slb.js";
3
- import { t as createWhatsAppOutboundBase } from "./outbound-base-MHdfVWvv.js";
4
- import { shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
5
- import { chunkText } from "openclaw/plugin-sdk/reply-chunking";
6
- import "openclaw/plugin-sdk/channel-send-result";
7
- //#region extensions/whatsapp/src/outbound-adapter.ts
8
- let whatsAppSendModulePromise;
9
- function loadWhatsAppSendModule() {
10
- whatsAppSendModulePromise ??= import("./send-D0iPQBMX.js").then((n) => n.a);
11
- return whatsAppSendModulePromise;
12
- }
13
- function normalizeOutboundText(text) {
14
- return normalizeWhatsAppPayloadText(text);
15
- }
16
- const whatsappOutbound = createWhatsAppOutboundBase({
17
- chunker: chunkText,
18
- sendMessageWhatsApp: async (to, text, options) => await (await loadWhatsAppSendModule()).sendMessageWhatsApp(to, normalizeOutboundText(text), { ...options }),
19
- sendPollWhatsApp: async (to, poll, options) => await (await loadWhatsAppSendModule()).sendPollWhatsApp(to, poll, options),
20
- shouldLogVerbose: () => shouldLogVerbose(),
21
- resolveTarget: ({ to, allowFrom, mode }) => resolveWhatsAppOutboundTarget({
22
- to,
23
- allowFrom,
24
- mode
25
- }),
26
- normalizeText: normalizeOutboundText,
27
- skipEmptyText: true
28
- });
29
- //#endregion
30
- export { whatsappOutbound as t };
@@ -1,125 +0,0 @@
1
- import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-B3Y-9slb.js";
2
- import { p as toWhatsappJid } from "./text-runtime-Dk37KYHj.js";
3
- import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-CveINB35.js";
4
- import { DEFAULT_ACCOUNT_ID, listCombinedAccountIds, normalizeOptionalAccountId, resolveListedDefaultAccountId } from "openclaw/plugin-sdk/account-core";
5
- import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
6
- import { createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
7
- import { sendTextMediaPayload } from "openclaw/plugin-sdk/reply-payload";
8
- //#region extensions/whatsapp/src/outbound-send-deps.ts
9
- const WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS = ["sendWhatsApp"];
10
- //#endregion
11
- //#region extensions/whatsapp/src/outbound-base.ts
12
- function resolveQuoteLookupAccountId(cfg, accountId) {
13
- const explicitAccountId = normalizeOptionalAccountId(accountId);
14
- if (explicitAccountId) return explicitAccountId;
15
- const channelCfg = cfg?.channels?.whatsapp;
16
- return resolveListedDefaultAccountId({
17
- accountIds: listCombinedAccountIds({
18
- configuredAccountIds: channelCfg?.accounts && typeof channelCfg.accounts === "object" ? Object.keys(channelCfg.accounts).filter(Boolean) : [],
19
- fallbackAccountIdWhenEmpty: DEFAULT_ACCOUNT_ID
20
- }),
21
- configuredDefaultAccountId: normalizeOptionalAccountId(channelCfg?.defaultAccount)
22
- });
23
- }
24
- function createWhatsAppOutboundBase({ chunker, sendMessageWhatsApp, sendPollWhatsApp, shouldLogVerbose, resolveTarget, normalizeText = normalizeWhatsAppPayloadText, skipEmptyText = true }) {
25
- const resolveQuotedMessageKey = (params) => {
26
- const replyToId = params.replyToId?.trim();
27
- if (!replyToId) return;
28
- const targetJid = toWhatsappJid(params.to);
29
- const cachedMeta = lookupInboundMessageMetaForTarget(params.accountId, targetJid, replyToId);
30
- return {
31
- id: replyToId,
32
- remoteJid: cachedMeta?.remoteJid ?? targetJid,
33
- fromMe: cachedMeta?.fromMe ?? false,
34
- participant: cachedMeta?.participant,
35
- messageText: cachedMeta?.body
36
- };
37
- };
38
- const outbound = {
39
- deliveryMode: "gateway",
40
- chunker,
41
- chunkerMode: "text",
42
- textChunkLimit: 4e3,
43
- sanitizeText: ({ text }) => normalizeText(text),
44
- deliveryCapabilities: { durableFinal: {
45
- text: true,
46
- replyTo: true,
47
- messageSendingHooks: true
48
- } },
49
- pollMaxOptions: 12,
50
- resolveTarget,
51
- ...createAttachedChannelResultAdapter({
52
- channel: "whatsapp",
53
- sendText: async ({ cfg, to, text, accountId, deps, gifPlayback, replyToId }) => {
54
- const normalizedText = normalizeText(text);
55
- if (skipEmptyText && !normalizedText) return { messageId: "" };
56
- const send = resolveOutboundSendDep(deps, "whatsapp", { legacyKeys: WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS }) ?? sendMessageWhatsApp;
57
- const quotedMessageKey = resolveQuotedMessageKey({
58
- accountId: resolveQuoteLookupAccountId(cfg, accountId),
59
- to,
60
- replyToId
61
- });
62
- return await send(to, normalizedText, {
63
- verbose: false,
64
- cfg,
65
- accountId: accountId ?? void 0,
66
- gifPlayback,
67
- quotedMessageKey
68
- });
69
- },
70
- sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, audioAsVoice, accountId, deps, gifPlayback, forceDocument, replyToId }) => {
71
- const send = resolveOutboundSendDep(deps, "whatsapp", { legacyKeys: WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS }) ?? sendMessageWhatsApp;
72
- const quotedMessageKey = resolveQuotedMessageKey({
73
- accountId: resolveQuoteLookupAccountId(cfg, accountId),
74
- to,
75
- replyToId
76
- });
77
- return await send(to, normalizeText(text), {
78
- verbose: false,
79
- cfg,
80
- mediaUrl,
81
- mediaAccess,
82
- mediaLocalRoots,
83
- mediaReadFile,
84
- ...audioAsVoice === void 0 ? {} : { audioAsVoice },
85
- accountId: accountId ?? void 0,
86
- gifPlayback,
87
- forceDocument,
88
- quotedMessageKey
89
- });
90
- },
91
- sendPoll: async ({ cfg, to, poll, accountId }) => await sendPollWhatsApp(to, poll, {
92
- verbose: shouldLogVerbose(),
93
- accountId: accountId ?? void 0,
94
- cfg
95
- })
96
- })
97
- };
98
- return {
99
- ...outbound,
100
- sendPayload: async (ctx) => {
101
- if (ctx.payload.isError === true) return {
102
- channel: "whatsapp",
103
- messageId: ""
104
- };
105
- const payload = normalizeWhatsAppOutboundPayload(ctx.payload, { normalizeText });
106
- if (!payload.text && !(payload.mediaUrl || payload.mediaUrls?.length)) {
107
- if (ctx.payload.interactive || ctx.payload.presentation || ctx.payload.channelData) throw new Error("WhatsApp sendPayload does not support structured-only payloads without text or media.");
108
- return {
109
- channel: "whatsapp",
110
- messageId: ""
111
- };
112
- }
113
- return await sendTextMediaPayload({
114
- channel: "whatsapp",
115
- ctx: {
116
- ...ctx,
117
- payload
118
- },
119
- adapter: outbound
120
- });
121
- }
122
- };
123
- }
124
- //#endregion
125
- export { WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS as n, createWhatsAppOutboundBase as t };
@@ -1,184 +0,0 @@
1
- import { t as formatError } from "./session-errors-BAj9D2La.js";
2
- import { a as sanitizeAssistantVisibleTextWithProfile, i as sanitizeAssistantVisibleText, o as sleep, s as stripToolCallXmlTags } from "./text-runtime-Dk37KYHj.js";
3
- import path from "node:path";
4
- import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
5
- import { sanitizeForPlainText } from "openclaw/plugin-sdk/channel-outbound";
6
- import { writeExternalFileWithinRoot } from "openclaw/plugin-sdk/security-runtime";
7
- import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
8
- import { MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS, runFfmpeg } from "openclaw/plugin-sdk/media-runtime";
9
- import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
10
- //#region extensions/whatsapp/src/document-filename.ts
11
- const WHATSAPP_DEFAULT_DOCUMENT_FILE_NAME = "file";
12
- function resolveWhatsAppDefaultDocumentFileName(mimetype) {
13
- const extension = extensionForMime(mimetype);
14
- return extension ? `${WHATSAPP_DEFAULT_DOCUMENT_FILE_NAME}${extension}` : WHATSAPP_DEFAULT_DOCUMENT_FILE_NAME;
15
- }
16
- function resolveWhatsAppDocumentFileName(params) {
17
- const fallbackName = resolveWhatsAppDefaultDocumentFileName(params.mimetype);
18
- return params.fileName?.replace(/[\x00-\x1f\x7f]/g, "").trim() || fallbackName;
19
- }
20
- //#endregion
21
- //#region extensions/whatsapp/src/outbound-media-contract.ts
22
- const WHATSAPP_VOICE_FILE_NAME = "voice.ogg";
23
- const WHATSAPP_VOICE_SAMPLE_RATE_HZ = 48e3;
24
- const WHATSAPP_VOICE_BITRATE = "64k";
25
- const WHATSAPP_VOICE_MIMETYPE = "audio/ogg; codecs=opus";
26
- function stripWhatsAppPluralToolXml(text) {
27
- return stripToolCallXmlTags(text, { stripFunctionCallsXmlPayloads: true });
28
- }
29
- function finalizeWhatsAppVisibleText(text) {
30
- return sanitizeForPlainText(stripWhatsAppPluralToolXml(text));
31
- }
32
- function normalizeWhatsAppPayloadText(text) {
33
- return finalizeWhatsAppVisibleText(sanitizeAssistantVisibleText(text ?? "")).trimStart();
34
- }
35
- function stripLeadingBlankLines(text) {
36
- return text.replace(/^(?:[ \t]*\r?\n)+/, "");
37
- }
38
- function normalizeWhatsAppPayloadTextPreservingIndentation(text) {
39
- const normalized = stripLeadingBlankLines(finalizeWhatsAppVisibleText(sanitizeAssistantVisibleTextWithProfile(stripLeadingBlankLines(text ?? ""), "history")));
40
- return normalized.trim() ? normalized : "";
41
- }
42
- function resolveWhatsAppOutboundMediaUrls(payload) {
43
- return uniqueStrings([payload.mediaUrl?.trim(), ...(payload.mediaUrls ? [...payload.mediaUrls] : []).map((entry) => entry.trim()).filter((entry) => Boolean(entry))].filter((entry) => Boolean(entry)));
44
- }
45
- function normalizeWhatsAppOutboundPayload(payload, options) {
46
- const mediaUrls = resolveWhatsAppOutboundMediaUrls(payload);
47
- const normalizeText = options?.normalizeText ?? normalizeWhatsAppPayloadText;
48
- return {
49
- ...payload,
50
- text: normalizeText(payload.text),
51
- mediaUrl: mediaUrls[0],
52
- mediaUrls: mediaUrls.length > 0 ? mediaUrls : void 0
53
- };
54
- }
55
- function inferWhatsAppMediaKind(media) {
56
- if (media.kind === "image" || media.kind === "audio" || media.kind === "video" || media.kind === "document") return media.kind;
57
- const contentType = normalizeContentType(media.contentType);
58
- if (contentType.startsWith("image/")) return "image";
59
- if (contentType.startsWith("audio/")) return "audio";
60
- if (contentType.startsWith("video/")) return "video";
61
- return "document";
62
- }
63
- function normalizeWhatsAppLoadedMedia(media, mediaUrl) {
64
- const kind = inferWhatsAppMediaKind(media);
65
- const mimetype = kind === "audio" && isWhatsAppNativeVoiceAudio({
66
- contentType: media.contentType,
67
- mediaUrl
68
- }) ? WHATSAPP_VOICE_MIMETYPE : media.contentType ?? "application/octet-stream";
69
- const fileName = kind === "document" ? resolveWhatsAppDocumentFileName({
70
- fileName: media.fileName ?? deriveWhatsAppDocumentFileName(mediaUrl),
71
- mimetype
72
- }) : media.fileName;
73
- return {
74
- buffer: media.buffer,
75
- kind,
76
- mimetype,
77
- ...fileName ? { fileName } : {}
78
- };
79
- }
80
- async function prepareWhatsAppOutboundMedia(media, mediaUrl) {
81
- const normalized = normalizeWhatsAppLoadedMedia(media, mediaUrl);
82
- if (normalized.kind !== "audio") return normalized;
83
- if (isWhatsAppNativeVoiceAudio({
84
- contentType: media.contentType,
85
- fileName: media.fileName,
86
- mediaUrl
87
- })) return normalized;
88
- return {
89
- buffer: await transcodeToWhatsAppVoiceOpus({
90
- buffer: media.buffer,
91
- fileName: media.fileName ?? deriveWhatsAppDocumentFileName(mediaUrl) ?? "audio"
92
- }),
93
- kind: "audio",
94
- mimetype: WHATSAPP_VOICE_MIMETYPE
95
- };
96
- }
97
- function normalizeContentType(value) {
98
- return value?.split(";", 1)[0]?.trim().toLowerCase() ?? "";
99
- }
100
- function isWhatsAppNativeVoiceAudio(params) {
101
- const contentType = normalizeContentType(params.contentType);
102
- if (contentType === "audio/ogg" || contentType === "audio/opus") return true;
103
- const fileName = params.fileName ?? deriveWhatsAppDocumentFileName(params.mediaUrl) ?? "";
104
- const ext = path.extname(fileName).toLowerCase();
105
- return ext === ".ogg" || ext === ".opus";
106
- }
107
- async function transcodeToWhatsAppVoiceOpus(params) {
108
- return await withTempWorkspace({
109
- rootDir: resolvePreferredOpenClawTmpDir(),
110
- prefix: "whatsapp-voice-"
111
- }, async (workspace) => {
112
- const ext = path.extname(params.fileName).toLowerCase();
113
- const inputExt = ext && ext.length <= 12 ? ext : ".audio";
114
- const inputPath = await workspace.write(`input${inputExt}`, params.buffer);
115
- await writeExternalFileWithinRoot({
116
- rootDir: workspace.dir,
117
- path: WHATSAPP_VOICE_FILE_NAME,
118
- write: async (outputPath) => {
119
- await runFfmpeg([
120
- "-hide_banner",
121
- "-loglevel",
122
- "error",
123
- "-y",
124
- "-i",
125
- inputPath,
126
- "-vn",
127
- "-sn",
128
- "-dn",
129
- "-t",
130
- String(MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS),
131
- "-ar",
132
- String(WHATSAPP_VOICE_SAMPLE_RATE_HZ),
133
- "-ac",
134
- "1",
135
- "-c:a",
136
- "libopus",
137
- "-b:a",
138
- WHATSAPP_VOICE_BITRATE,
139
- "-f",
140
- "ogg",
141
- outputPath
142
- ]);
143
- }
144
- });
145
- return await workspace.read(WHATSAPP_VOICE_FILE_NAME);
146
- });
147
- }
148
- function deriveWhatsAppDocumentFileName(mediaUrl) {
149
- if (!mediaUrl) return;
150
- try {
151
- const parsed = new URL(mediaUrl);
152
- const fileName = path.posix.basename(parsed.pathname);
153
- return fileName ? decodeURIComponent(fileName) : void 0;
154
- } catch {
155
- return (mediaUrl.split(/[?#]/, 1)[0] ?? "").split(/[\\/]/).pop() || void 0;
156
- }
157
- }
158
- function isRetryableWhatsAppOutboundError(error) {
159
- return /closed|reset|timed\s*out|disconnect/i.test(formatError(error));
160
- }
161
- async function sendWhatsAppOutboundWithRetry(params) {
162
- const maxAttempts = params.maxAttempts ?? 3;
163
- let lastError;
164
- for (let attempt = 1; attempt <= maxAttempts; attempt += 1) try {
165
- return await params.send();
166
- } catch (error) {
167
- lastError = error;
168
- const errorText = formatError(error);
169
- const isLastAttempt = attempt === maxAttempts;
170
- if (!isRetryableWhatsAppOutboundError(error) || isLastAttempt) throw error;
171
- const backoffMs = 500 * attempt;
172
- await params.onRetry?.({
173
- attempt,
174
- maxAttempts,
175
- backoffMs,
176
- error,
177
- errorText
178
- });
179
- await sleep(backoffMs);
180
- }
181
- throw lastError;
182
- }
183
- //#endregion
184
- export { resolveWhatsAppOutboundMediaUrls as a, prepareWhatsAppOutboundMedia as i, normalizeWhatsAppPayloadText as n, sendWhatsAppOutboundWithRetry as o, normalizeWhatsAppPayloadTextPreservingIndentation as r, resolveWhatsAppDocumentFileName as s, normalizeWhatsAppOutboundPayload as t };
@@ -1,2 +0,0 @@
1
- import { t as whatsappOutbound } from "./outbound-adapter-CcNeZvD_.js";
2
- export { whatsappOutbound };
@@ -1,16 +0,0 @@
1
- import { t as resolveMergedWhatsAppAccountConfig } from "./account-config-6PTOSfaI.js";
2
- import { resolveReactionLevel } from "openclaw/plugin-sdk/status-helpers";
3
- //#region extensions/whatsapp/src/reaction-level.ts
4
- /** Resolve the effective reaction level and its implications for WhatsApp. */
5
- function resolveWhatsAppReactionLevel(params) {
6
- return resolveReactionLevel({
7
- value: resolveMergedWhatsAppAccountConfig({
8
- cfg: params.cfg,
9
- accountId: params.accountId
10
- }).reactionLevel,
11
- defaultLevel: "minimal",
12
- invalidFallback: "minimal"
13
- });
14
- }
15
- //#endregion
16
- export { resolveWhatsAppReactionLevel as t };
@@ -1,11 +0,0 @@
1
- import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
2
- //#region extensions/whatsapp/src/runtime-group-policy.ts
3
- function resolveWhatsAppRuntimeGroupPolicy(params) {
4
- return resolveOpenProviderRuntimeGroupPolicy({
5
- providerConfigPresent: params.providerConfigPresent,
6
- groupPolicy: params.groupPolicy,
7
- defaultGroupPolicy: params.defaultGroupPolicy
8
- });
9
- }
10
- //#endregion
11
- export { resolveWhatsAppRuntimeGroupPolicy as t };
package/dist/test-api.js DELETED
@@ -1,3 +0,0 @@
1
- import { t as resolveWhatsAppRuntimeGroupPolicy } from "./runtime-group-policy-DeSRFXEV.js";
2
- import { t as whatsappOutbound } from "./outbound-adapter-CcNeZvD_.js";
3
- export { resolveWhatsAppRuntimeGroupPolicy, whatsappOutbound };
@@ -1,22 +0,0 @@
1
- (The MIT License)
2
-
3
- Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- 'Software'), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,69 +0,0 @@
1
- agent-base
2
- ==========
3
- ### Turn a function into an [`http.Agent`][http.Agent] instance
4
-
5
- This module is a thin wrapper around the base `http.Agent` class.
6
-
7
- It provides an abstract class that must define a `connect()` function,
8
- which is responsible for creating the underlying socket that the HTTP
9
- client requests will use.
10
-
11
- The `connect()` function may return an arbitrary `Duplex` stream, or
12
- another `http.Agent` instance to delegate the request to, and may be
13
- asynchronous (by defining an `async` function).
14
-
15
- Instances of this agent can be used with the `http` and `https`
16
- modules. To differentiate, the options parameter in the `connect()`
17
- function includes a `secureEndpoint` property, which can be checked
18
- to determine what type of socket should be returned.
19
-
20
- #### Some subclasses:
21
-
22
- Here are some more interesting uses of `agent-base`.
23
- Send a pull request to list yours!
24
-
25
- * [`http-proxy-agent`][http-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTP endpoints
26
- * [`https-proxy-agent`][https-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTPS endpoints
27
- * [`pac-proxy-agent`][pac-proxy-agent]: A PAC file proxy `http.Agent` implementation for HTTP and HTTPS
28
- * [`socks-proxy-agent`][socks-proxy-agent]: A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS
29
-
30
- Example
31
- -------
32
-
33
- Here's a minimal example that creates a new `net.Socket` or `tls.Socket`
34
- based on the `secureEndpoint` property. This agent can be used with both
35
- the `http` and `https` modules.
36
-
37
- ```ts
38
- import * as net from 'net';
39
- import * as tls from 'tls';
40
- import * as http from 'http';
41
- import { Agent } from 'agent-base';
42
-
43
- class MyAgent extends Agent {
44
- connect(req, opts) {
45
- // `secureEndpoint` is true when using the "https" module
46
- if (opts.secureEndpoint) {
47
- return tls.connect(opts);
48
- } else {
49
- return net.connect(opts);
50
- }
51
- }
52
- });
53
-
54
- // Keep alive enabled means that `connect()` will only be
55
- // invoked when a new connection needs to be created
56
- const agent = new MyAgent({ keepAlive: true });
57
-
58
- // Pass the `agent` option when creating the HTTP request
59
- http.get('http://nodejs.org/api/', { agent }, (res) => {
60
- console.log('"response" event!', res.headers);
61
- res.pipe(process.stdout);
62
- });
63
- ```
64
-
65
- [http-proxy-agent]: ../http-proxy-agent
66
- [https-proxy-agent]: ../https-proxy-agent
67
- [pac-proxy-agent]: ../pac-proxy-agent
68
- [socks-proxy-agent]: ../socks-proxy-agent
69
- [http.Agent]: https://nodejs.org/api/http.html#http_class_http_agent
@@ -1,10 +0,0 @@
1
- import * as http from 'http';
2
- import * as https from 'https';
3
- import type { Readable } from 'stream';
4
- export type ThenableRequest = http.ClientRequest & {
5
- then: Promise<http.IncomingMessage>['then'];
6
- };
7
- export declare function toBuffer(stream: Readable): Promise<Buffer>;
8
- export declare function json(stream: Readable): Promise<any>;
9
- export declare function req(url: string | URL, opts?: https.RequestOptions): ThenableRequest;
10
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,GAAG;IAClD,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;CAC5C,CAAC;AAEF,wBAAsB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAQhE;AAGD,wBAAsB,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAUzD;AAED,wBAAgB,GAAG,CAClB,GAAG,EAAE,MAAM,GAAG,GAAG,EACjB,IAAI,GAAE,KAAK,CAAC,cAAmB,GAC7B,eAAe,CAcjB"}
@@ -1,37 +0,0 @@
1
- import * as http from 'http';
2
- import * as https from 'https';
3
- export async function toBuffer(stream) {
4
- let length = 0;
5
- const chunks = [];
6
- for await (const chunk of stream) {
7
- length += chunk.length;
8
- chunks.push(chunk);
9
- }
10
- return Buffer.concat(chunks, length);
11
- }
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
- export async function json(stream) {
14
- const buf = await toBuffer(stream);
15
- const str = buf.toString('utf8');
16
- try {
17
- return JSON.parse(str);
18
- }
19
- catch (_err) {
20
- const err = _err;
21
- err.message += ` (input: ${str})`;
22
- throw err;
23
- }
24
- }
25
- export function req(url, opts = {}) {
26
- const href = typeof url === 'string' ? url : url.href;
27
- const req = (href.startsWith('https:') ? https : http).request(url, opts);
28
- const promise = new Promise((resolve, reject) => {
29
- req
30
- .once('response', resolve)
31
- .once('error', reject)
32
- .end();
33
- });
34
- req.then = promise.then.bind(promise);
35
- return req;
36
- }
37
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,MAAgB;IAC9C,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC;QACvB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACtC,CAAC;AAED,8DAA8D;AAC9D,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,MAAgB;IAC1C,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAAC,OAAO,IAAa,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,IAAa,CAAC;QAC1B,GAAG,CAAC,OAAO,IAAI,YAAY,GAAG,GAAG,CAAC;QAClC,MAAM,GAAG,CAAC;IACX,CAAC;AACF,CAAC;AAED,MAAM,UAAU,GAAG,CAClB,GAAiB,EACjB,OAA6B,EAAE;IAE/B,MAAM,IAAI,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;IACtD,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAC7D,GAAG,EACH,IAAI,CACe,CAAC;IACrB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrE,GAAG;aACD,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC;aACzB,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;aACrB,GAAG,EAAqB,CAAC;IAC5B,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtC,OAAO,GAAG,CAAC;AACZ,CAAC"}
@@ -1,37 +0,0 @@
1
- import * as net from 'net';
2
- import * as tls from 'tls';
3
- import * as http from 'http';
4
- import type { Duplex } from 'stream';
5
- export * from './helpers.js';
6
- interface HttpConnectOpts extends net.TcpNetConnectOpts {
7
- secureEndpoint: false;
8
- protocol?: string;
9
- }
10
- interface HttpsConnectOpts extends tls.ConnectionOptions {
11
- secureEndpoint: true;
12
- protocol?: string;
13
- port: number;
14
- }
15
- export type AgentConnectOpts = HttpConnectOpts | HttpsConnectOpts;
16
- declare const INTERNAL: unique symbol;
17
- export declare abstract class Agent extends http.Agent {
18
- private [INTERNAL];
19
- options: Partial<net.TcpNetConnectOpts & tls.ConnectionOptions>;
20
- keepAlive: boolean;
21
- constructor(opts?: http.AgentOptions);
22
- abstract connect(req: http.ClientRequest, options: AgentConnectOpts): Promise<Duplex | http.Agent> | Duplex | http.Agent;
23
- /**
24
- * Determine whether this is an `http` or `https` request.
25
- */
26
- isSecureEndpoint(options?: AgentConnectOpts): boolean;
27
- private incrementSockets;
28
- private decrementSockets;
29
- getName(options?: AgentConnectOpts): string;
30
- createSocket(req: http.ClientRequest, options: AgentConnectOpts, cb: (err: Error | null, s?: Duplex) => void): void;
31
- createConnection(): Duplex;
32
- get defaultPort(): number;
33
- set defaultPort(v: number);
34
- get protocol(): string;
35
- set protocol(v: string);
36
- }
37
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,cAAc,cAAc,CAAC;AAE7B,UAAU,eAAgB,SAAQ,GAAG,CAAC,iBAAiB;IACtD,cAAc,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,gBAAiB,SAAQ,GAAG,CAAC,iBAAiB;IACvD,cAAc,EAAE,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,gBAAgB,CAAC;AAElE,QAAA,MAAM,QAAQ,eAAmC,CAAC;AAQlD,8BAAsB,KAAM,SAAQ,IAAI,CAAC,KAAK;IAC7C,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAgB;IAGlC,OAAO,EAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACjE,SAAS,EAAG,OAAO,CAAC;gBAER,IAAI,CAAC,EAAE,IAAI,CAAC,YAAY;IAKpC,QAAQ,CAAC,OAAO,CACf,GAAG,EAAE,IAAI,CAAC,aAAa,EACvB,OAAO,EAAE,gBAAgB,GACvB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC,KAAK;IAErD;;OAEG;IACH,gBAAgB,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO;IAqCrD,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,gBAAgB;IAmBxB,OAAO,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,MAAM;IAQ3C,YAAY,CACX,GAAG,EAAE,IAAI,CAAC,aAAa,EACvB,OAAO,EAAE,gBAAgB,EACzB,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;IAuC5C,gBAAgB,IAAI,MAAM;IAW1B,IAAI,WAAW,IAAI,MAAM,CAKxB;IAED,IAAI,WAAW,CAAC,CAAC,EAAE,MAAM,EAIxB;IAED,IAAI,QAAQ,IAAI,MAAM,CAKrB;IAED,IAAI,QAAQ,CAAC,CAAC,EAAE,MAAM,EAIrB;CACD"}