@gamastudio/sendwave-provider 0.0.22 → 0.0.23

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.
@@ -9,6 +9,7 @@ export interface ParsedMessage {
9
9
  caption?: string;
10
10
  remoteJid: string;
11
11
  messageId?: string;
12
+ sessionId?: string;
12
13
  originalPayload: {
13
14
  key: any;
14
15
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamastudio/sendwave-provider",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "Librería para interactuar con Sendwave usando configuración dinámica.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -22,13 +22,13 @@
22
22
  "author": "Ameth Galarcio <amethgm@gmail.com>",
23
23
  "license": "ISC",
24
24
  "dependencies": {
25
- "@builderbot/bot": "^1.2.9",
25
+ "@builderbot/bot": "^1.3.15",
26
26
  "@gamastudio/colorslog": "^0.1.8",
27
27
  "@types/mime-types": "^3.0.1",
28
28
  "axios": "^1.13.2",
29
- "body-parser": "^2.2.1",
29
+ "body-parser": "^2.2.2",
30
30
  "cors": "^2.8.5",
31
- "file-type": "^21.1.1",
31
+ "file-type": "^21.3.0",
32
32
  "mime-types": "^3.0.2",
33
33
  "queue-promise": "^2.2.1",
34
34
  "sirv": "^3.0.2"
@@ -37,7 +37,7 @@
37
37
  "@types/axios": "^0.14.4",
38
38
  "@types/body-parser": "^1.19.6",
39
39
  "@types/cors": "^2.8.19",
40
- "@types/node": "^24.10.1",
40
+ "@types/node": "^24.10.9",
41
41
  "copyfiles": "^2.4.1",
42
42
  "ts-node": "^10.9.2",
43
43
  "ts-node-dev": "^2.0.0",
@@ -45,4 +45,4 @@
45
45
  "tsconfig-paths": "^4.2.0",
46
46
  "typescript": "^5.9.3"
47
47
  }
48
- }
48
+ }
@@ -30,13 +30,11 @@ class SendWaveCore extends node_events_1.EventEmitter {
30
30
  var _a, _b;
31
31
  try {
32
32
  const { body } = req;
33
- if (!["messages.upsert", "send.message"].includes(body.event)) {
34
- return res.end("Message queued");
35
- }
36
33
  const data = (0, parserMsg_1.parseIncomingMsg)(body);
37
34
  if (!data)
38
35
  return res.end("Message queued");
39
36
  this.flowMessage(data);
37
+ // console.log(data);
40
38
  if (!(data === null || data === void 0 ? void 0 : data.fromMe)) {
41
39
  // Emit message event for queue flow system integration
42
40
  this.emit("user-message", data);
@@ -118,17 +118,6 @@ class SendWaveProvider extends bot_1.ProviderClass {
118
118
  }
119
119
  return this.vendor.indexError(req, res);
120
120
  })
121
- // .get("/health", async (_: any, res: any) => {
122
- // res.setHeader("Content-Type", "application/json");
123
- // res.end(
124
- // JSON.stringify({
125
- // connected: this.instanceConnected,
126
- // state: this.state,
127
- // port: this.globalVendorArgs.port,
128
- // uptime: process.uptime(),
129
- // })
130
- // );
131
- // })
132
121
  .post("/webhook", this.vendor.incomingMsg);
133
122
  };
134
123
  this.busEvents = () => [
@@ -469,8 +458,8 @@ class SendWaveProvider extends bot_1.ProviderClass {
469
458
  sendText(data) {
470
459
  return this.sender.sendText(data);
471
460
  }
472
- sendList(data) {
473
- return this.sender.sendList(data);
461
+ async sendList(data) {
462
+ return await this.sender.sendList(data);
474
463
  }
475
464
  sendImage(data) {
476
465
  return this.sender.sendImage(data);
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseIncomingMsg = parseIncomingMsg;
4
4
  function parseIncomingMsg(payload) {
5
5
  try {
6
- const msg = payload.data;
7
- if (msg.messageType === "reactionMessage")
6
+ const msg = payload;
7
+ if (msg.type === "reactionMessage")
8
8
  return null;
9
9
  if (!msg) {
10
10
  return null;
@@ -15,7 +15,7 @@ function parseIncomingMsg(payload) {
15
15
  const remoteJid = msg.remoteJid || "";
16
16
  const from = msg.from;
17
17
  // const from = (msg?.remoteJid || "")
18
- const to = payload.instance || "";
18
+ const to = payload.inputs.instanceName || "";
19
19
  const name = msg.name;
20
20
  const body = msg.body;
21
21
  const type = msg.type;
@@ -32,7 +32,8 @@ function parseIncomingMsg(payload) {
32
32
  type,
33
33
  media,
34
34
  caption,
35
- originalPayload: payload.data,
35
+ sessionId: payload.inputs.sessionId,
36
+ originalPayload: payload.originalPayload,
36
37
  };
37
38
  }
38
39
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamastudio/sendwave-provider",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "Librería para interactuar con Sendwave usando configuración dinámica.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -22,13 +22,13 @@
22
22
  "author": "Ameth Galarcio <amethgm@gmail.com>",
23
23
  "license": "ISC",
24
24
  "dependencies": {
25
- "@builderbot/bot": "^1.2.9",
25
+ "@builderbot/bot": "^1.3.15",
26
26
  "@gamastudio/colorslog": "^0.1.8",
27
27
  "@types/mime-types": "^3.0.1",
28
28
  "axios": "^1.13.2",
29
- "body-parser": "^2.2.1",
29
+ "body-parser": "^2.2.2",
30
30
  "cors": "^2.8.5",
31
- "file-type": "^21.1.1",
31
+ "file-type": "^21.3.0",
32
32
  "mime-types": "^3.0.2",
33
33
  "queue-promise": "^2.2.1",
34
34
  "sirv": "^3.0.2"
@@ -37,7 +37,7 @@
37
37
  "@types/axios": "^0.14.4",
38
38
  "@types/body-parser": "^1.19.6",
39
39
  "@types/cors": "^2.8.19",
40
- "@types/node": "^24.10.1",
40
+ "@types/node": "^24.10.9",
41
41
  "copyfiles": "^2.4.1",
42
42
  "ts-node": "^10.9.2",
43
43
  "ts-node-dev": "^2.0.0",
@@ -45,4 +45,4 @@
45
45
  "tsconfig-paths": "^4.2.0",
46
46
  "typescript": "^5.9.3"
47
47
  }
48
- }
48
+ }