@laburen/openclaw-plugin-whatsapp-api 0.3.1 → 0.4.0

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 (2) hide show
  1. package/index.js +17 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -97,9 +97,12 @@ const MIME_BY_EXT = {
97
97
  ".m4a": "audio/mp4",
98
98
  ".pdf": "application/pdf",
99
99
  ".txt": "text/plain",
100
+ ".md": "text/markdown",
100
101
  ".csv": "text/csv",
101
102
  ".json": "application/json",
102
- ".zip": "application/zip"
103
+ ".zip": "application/zip",
104
+ ".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
105
+ ".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
103
106
  };
104
107
  function normalizeMime(value) {
105
108
  const trimmed = value?.trim();
@@ -1262,6 +1265,19 @@ function createWhatsAppApiChannel(api) {
1262
1265
  account: resolveAccount(cfg, accountId ?? null)
1263
1266
  })
1264
1267
  };
1268
+ },
1269
+ sendMedia: async ({ to, mediaUrl, text, cfg, accountId }) => {
1270
+ const account = resolveAccount(cfg, accountId ?? null);
1271
+ return {
1272
+ channel: CHANNEL_ID,
1273
+ chatId: to,
1274
+ messageId: await sendWhatsAppApiMedia({
1275
+ to,
1276
+ mediaUrl,
1277
+ text: text || void 0,
1278
+ account
1279
+ })
1280
+ };
1265
1281
  }
1266
1282
  },
1267
1283
  gateway: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laburen/openclaw-plugin-whatsapp-api",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "WhatsApp API channel plugin for OpenClaw",
6
6
  "main": "index.js",