@open-wa/wa-automate 4.33.2 → 4.33.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/dist/api/Client.d.ts
CHANGED
@@ -20,6 +20,7 @@ import { NextFunction, Request, Response } from 'express';
|
|
20
20
|
import { Call } from './model/call';
|
21
21
|
import { Button, Section } from './model/button';
|
22
22
|
import { JsonObject } from 'type-fest';
|
23
|
+
import { ReactionEvent } from './model/reactions';
|
23
24
|
export declare enum namespace {
|
24
25
|
Chat = "Chat",
|
25
26
|
Msg = "Msg",
|
@@ -231,6 +232,16 @@ export declare class Client {
|
|
231
232
|
* Listens to new orders. Only works on business accounts
|
232
233
|
*/
|
233
234
|
onNewProduct(fn: (product: Product) => void): Promise<Listener | boolean>;
|
235
|
+
/**
|
236
|
+
* [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
|
237
|
+
*
|
238
|
+
* Listens to reaction add and change events
|
239
|
+
*
|
240
|
+
* @event
|
241
|
+
* @param fn callback
|
242
|
+
* @fires [[ReactionEvent]]
|
243
|
+
*/
|
244
|
+
onReaction(fn: (reactionEvent: ReactionEvent) => void): Promise<Listener | boolean>;
|
234
245
|
/**
|
235
246
|
* [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
|
236
247
|
*
|
package/dist/api/Client.js
CHANGED
@@ -810,6 +810,20 @@ class Client {
|
|
810
810
|
return this.registerListener(events_2.SimpleListener.NewProduct, fn);
|
811
811
|
});
|
812
812
|
}
|
813
|
+
/**
|
814
|
+
* [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
|
815
|
+
*
|
816
|
+
* Listens to reaction add and change events
|
817
|
+
*
|
818
|
+
* @event
|
819
|
+
* @param fn callback
|
820
|
+
* @fires [[ReactionEvent]]
|
821
|
+
*/
|
822
|
+
onReaction(fn) {
|
823
|
+
return __awaiter(this, void 0, void 0, function* () {
|
824
|
+
return this.registerListener(events_2.SimpleListener.Reaction, fn);
|
825
|
+
});
|
826
|
+
}
|
813
827
|
/**
|
814
828
|
* [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
|
815
829
|
*
|
@@ -86,5 +86,10 @@ export declare enum SimpleListener {
|
|
86
86
|
* Requires licence
|
87
87
|
* Represents [[onNewProduct]]
|
88
88
|
*/
|
89
|
-
NewProduct = "onNewProduct"
|
89
|
+
NewProduct = "onNewProduct",
|
90
|
+
/**
|
91
|
+
* Requires licence
|
92
|
+
* Represents [[onReaction]]
|
93
|
+
*/
|
94
|
+
Reaction = "onReaction"
|
90
95
|
}
|
package/dist/api/model/events.js
CHANGED
@@ -94,4 +94,9 @@ var SimpleListener;
|
|
94
94
|
* Represents [[onNewProduct]]
|
95
95
|
*/
|
96
96
|
SimpleListener["NewProduct"] = "onNewProduct";
|
97
|
+
/**
|
98
|
+
* Requires licence
|
99
|
+
* Represents [[onReaction]]
|
100
|
+
*/
|
101
|
+
SimpleListener["Reaction"] = "onReaction";
|
97
102
|
})(SimpleListener = exports.SimpleListener || (exports.SimpleListener = {}));
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import { ContactId } from "./aliases";
|
2
|
+
import { Message, MessageAck } from "./message";
|
3
|
+
/**
|
4
|
+
* A reaction is identified the specific emoji.
|
5
|
+
*/
|
6
|
+
export declare type Reaction = {
|
7
|
+
/**
|
8
|
+
* The aggregate emoji used for the reaction.
|
9
|
+
*/
|
10
|
+
aggregateEmoji: string;
|
11
|
+
/**
|
12
|
+
* The identifier of the reaction
|
13
|
+
*/
|
14
|
+
id: string;
|
15
|
+
/**
|
16
|
+
* If the reaction is also sent by the host account
|
17
|
+
*/
|
18
|
+
hasReactionByMe: boolean;
|
19
|
+
/**
|
20
|
+
* The senders of this spefcific reaction
|
21
|
+
*/
|
22
|
+
senders: ReactionRecord[];
|
23
|
+
};
|
24
|
+
/**
|
25
|
+
* The specific reaction by a user
|
26
|
+
*/
|
27
|
+
export declare type ReactionRecord = {
|
28
|
+
/**
|
29
|
+
* The acknowledgement of the reaction
|
30
|
+
*/
|
31
|
+
ack: MessageAck;
|
32
|
+
/**
|
33
|
+
* The ID of the reaction
|
34
|
+
*/
|
35
|
+
id: string;
|
36
|
+
msgKey: string;
|
37
|
+
parentMsgKey: string;
|
38
|
+
orphan: number;
|
39
|
+
/**
|
40
|
+
* The text of the reaction
|
41
|
+
*/
|
42
|
+
reactionText: string;
|
43
|
+
/**
|
44
|
+
* If the reaction has been read
|
45
|
+
*/
|
46
|
+
read: boolean;
|
47
|
+
/**
|
48
|
+
* The ID of the reaction sender
|
49
|
+
*/
|
50
|
+
senderUserJid: ContactId;
|
51
|
+
/**
|
52
|
+
* The timestamp of the reaction
|
53
|
+
*/
|
54
|
+
timestamp: number;
|
55
|
+
};
|
56
|
+
/**
|
57
|
+
* Emitted by onReaction
|
58
|
+
*/
|
59
|
+
export declare type ReactionEvent = {
|
60
|
+
/**
|
61
|
+
* The message being reacted to
|
62
|
+
*/
|
63
|
+
message: Message;
|
64
|
+
/**
|
65
|
+
* The reaction sent by the host account
|
66
|
+
*/
|
67
|
+
reactionByMe: Reaction;
|
68
|
+
/**
|
69
|
+
* An array of all reactions
|
70
|
+
*/
|
71
|
+
reactions: Reaction[];
|
72
|
+
/**
|
73
|
+
* The type of the reaction event.
|
74
|
+
*/
|
75
|
+
type: 'add' | 'change';
|
76
|
+
};
|
package/package.json
CHANGED