@open-wa/wa-automate 4.36.6 → 4.37.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,8 @@ import { ConfigObject, STATE, LicenseType, Webhook, EventPayload } from './model
9
9
  import PQueue, { DefaultAddOptions, Options } from 'p-queue';
10
10
  import { HealthCheck, SessionInfo } from './model/sessionInfo';
11
11
  import { ChatId, GroupChatId, Content, Base64, MessageId, ContactId, DataURL, FilePath } from './model/aliases';
12
- import { CustomProduct, Label, Order, Product } from './model/product';
12
+ import { CustomProduct, Order, Product } from './model/product';
13
+ import { Label } from './model/label';
13
14
  import { Mp4StickerConversionProcessOptions, StickerMetadata } from './model/media';
14
15
  import { SimpleListener } from './model/events';
15
16
  import { AwaitMessagesOptions, Collection, CollectorFilter, CollectorOptions } from '../structures/Collector';
@@ -221,6 +222,14 @@ export declare class Client {
221
222
  * @returns Observable stream of call request objects
222
223
  */
223
224
  onIncomingCall(fn: (call: Call) => void): Promise<Listener | boolean>;
225
+ /**
226
+ * Listens to label change events
227
+ *
228
+ * @event
229
+ * @param fn callback
230
+ * @fires [[Label]]
231
+ */
232
+ onLabel(fn: (label: Label) => void): Promise<Listener | boolean>;
224
233
  /**
225
234
  *[REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
226
235
  *
@@ -807,6 +807,18 @@ class Client {
807
807
  return this.registerListener(events_2.SimpleListener.IncomingCall, fn);
808
808
  });
809
809
  }
810
+ /**
811
+ * Listens to label change events
812
+ *
813
+ * @event
814
+ * @param fn callback
815
+ * @fires [[Label]]
816
+ */
817
+ onLabel(fn) {
818
+ return __awaiter(this, void 0, void 0, function* () {
819
+ return this.registerListener(events_2.SimpleListener.Label, fn);
820
+ });
821
+ }
810
822
  /**
811
823
  *[REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
812
824
  *
@@ -62,6 +62,10 @@ export declare enum SimpleListener {
62
62
  * Represents [[onButton]]
63
63
  */
64
64
  Button = "onButton",
65
+ /**
66
+ * Represents [[onLabel]]
67
+ */
68
+ Label = "onLabel",
65
69
  /**
66
70
  * Requires licence
67
71
  * Represents [[onStory]]
@@ -69,6 +69,10 @@ var SimpleListener;
69
69
  * Represents [[onButton]]
70
70
  */
71
71
  SimpleListener["Button"] = "onButton";
72
+ /**
73
+ * Represents [[onLabel]]
74
+ */
75
+ SimpleListener["Label"] = "onLabel";
72
76
  /**
73
77
  * Requires licence
74
78
  * Represents [[onStory]]
@@ -106,3 +106,4 @@ export declare type EasyApiResponse = {
106
106
  export * from './config';
107
107
  export * from './media';
108
108
  export * from './aliases';
109
+ export * from './label';
@@ -120,3 +120,4 @@ var STATE;
120
120
  __exportStar(require("./config"), exports);
121
121
  __exportStar(require("./media"), exports);
122
122
  __exportStar(require("./aliases"), exports);
123
+ __exportStar(require("./label"), exports);
@@ -0,0 +1,24 @@
1
+ import { ContactId, ChatId, MessageId } from "./aliases";
2
+ export interface Label {
3
+ /**
4
+ * The internal ID of the label. Usually a number represented as a string e.g "1"
5
+ */
6
+ id: string;
7
+ /**
8
+ * The text contents of the label
9
+ */
10
+ name: string;
11
+ /**
12
+ * The items that are tagged with this label
13
+ */
14
+ items: {
15
+ /**
16
+ * Labels can be applied to chats, contacts or individual messages. This represents the type of object the label is attached to.
17
+ */
18
+ type: "Chat" | "Contact" | "Message";
19
+ /**
20
+ * The ID of the object that the label is atteched to.
21
+ */
22
+ id: ContactId | ChatId | MessageId;
23
+ }[];
24
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,3 @@
1
- import { ChatId, ContactId, MessageId } from "./aliases";
2
1
  import { Message } from "./message";
3
2
  export interface CustomProduct {
4
3
  /**
@@ -140,26 +139,3 @@ export interface Order {
140
139
  */
141
140
  message?: Message;
142
141
  }
143
- export interface Label {
144
- /**
145
- * The internal ID of the label. Usually a number represented as a string e.g "1"
146
- */
147
- id: string;
148
- /**
149
- * The text contents of the label
150
- */
151
- name: string;
152
- /**
153
- * The items that are tagged with this label
154
- */
155
- items: {
156
- /**
157
- * Labels can be applied to chats, contacts or individual messages. This represents the type of object the label is attached to.
158
- */
159
- type: "Chat" | "Contact" | "Message";
160
- /**
161
- * The ID of the object that the label is atteched to.
162
- */
163
- id: ContactId | ChatId | MessageId;
164
- }[];
165
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate",
3
- "version": "4.36.6",
3
+ "version": "4.37.0",
4
4
  "licenseCheckUrl": "https://funcs.openwa.dev/license-check",
5
5
  "brokenMethodReportUrl": "https://funcs.openwa.dev/report-bm",
6
6
  "patches": "https://cdn.openwa.dev/patches.json",