angularsockets 1.4.3 → 1.4.5

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.
@@ -1,416 +0,0 @@
1
- import { proto } from '../../WAProto';
2
-
3
- declare namespace RexxHayanasi {
4
- interface MediaUploadOptions {
5
- fileEncSha256?: Buffer;
6
- mediaType?: string;
7
- newsletter?: boolean;
8
- }
9
-
10
- type WAMediaUploadFunction = (
11
- stream: Buffer | NodeJS.ReadableStream,
12
- options?: MediaUploadOptions
13
- ) => Promise<{ url: string; directPath: string }>;
14
-
15
- interface WAMessageContentGenerationOptions {
16
- upload?: WAMediaUploadFunction;
17
- mediaCache?: any;
18
- options?: any;
19
- logger?: any;
20
- }
21
-
22
- interface StickerMessage {
23
- url: string;
24
- fileSha256: Buffer | string;
25
- fileEncSha256: Buffer | string;
26
- mediaKey: Buffer | string;
27
- mimetype: string;
28
- directPath: string;
29
- fileLength: number | string;
30
- mediaKeyTimestamp: number | string;
31
- isAnimated?: boolean;
32
- stickerSentTs?: number | string;
33
- isAvatar?: boolean;
34
- isAiSticker?: boolean;
35
- isLottie?: boolean;
36
- }
37
-
38
- interface PaymentMessage {
39
- amount: number;
40
- currency?: string;
41
- from?: string;
42
- expiry?: number;
43
- sticker?: { stickerMessage: StickerMessage };
44
- note?: string;
45
- background?: {
46
- id?: string;
47
- fileLength?: string;
48
- width?: number;
49
- height?: number;
50
- mimetype?: string;
51
- placeholderArgb?: number;
52
- textArgb?: number;
53
- subtextArgb?: number;
54
- };
55
- }
56
-
57
- interface ProductMessage {
58
- title: string;
59
- description: string;
60
- thumbnail: Buffer | { url: string };
61
- productId: string;
62
- retailerId: string;
63
- url: string;
64
- body?: string;
65
- footer?: string;
66
- buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
67
- priceAmount1000?: number | null;
68
- currencyCode?: string;
69
- }
70
-
71
- interface InteractiveMessage {
72
- header?: string;
73
- title: string;
74
- footer?: string;
75
- thumbnail?: string;
76
- image?: string | Buffer | { url: string };
77
- video?: string | Buffer | { url: string };
78
- document?: string | Buffer | { url: string };
79
- mimetype?: string;
80
- fileName?: string;
81
- jpegThumbnail?: string | Buffer | { url: string };
82
- contextInfo?: {
83
- mentionedJid?: string[];
84
- forwardingScore?: number;
85
- isForwarded?: boolean;
86
- externalAdReply?: {
87
- title?: string;
88
- body?: string;
89
- mediaType?: number;
90
- thumbnailUrl?: string;
91
- mediaUrl?: string;
92
- sourceUrl?: string;
93
- showAdAttribution?: boolean;
94
- renderLargerThumbnail?: boolean;
95
- [key: string]: any;
96
- };
97
- [key: string]: any;
98
- };
99
- externalAdReply?: {
100
- title?: string;
101
- body?: string;
102
- mediaType?: number;
103
- thumbnailUrl?: string;
104
- mediaUrl?: string;
105
- sourceUrl?: string;
106
- showAdAttribution?: boolean;
107
- renderLargerThumbnail?: boolean;
108
- [key: string]: any;
109
- };
110
- buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
111
- nativeFlowMessage?: {
112
- messageParamsJson?: string;
113
- buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
114
- [key: string]: any;
115
- };
116
- }
117
-
118
- interface AlbumItem {
119
- image?: string | Buffer | { url: string; caption?: string };
120
- video?: string | Buffer | { url: string; caption?: string };
121
- }
122
-
123
- interface EventMessageLocation {
124
- degreesLatitude: number;
125
- degreesLongitude: number;
126
- name: string;
127
- }
128
-
129
- interface EventMessage {
130
- isCanceled?: boolean;
131
- name: string;
132
- description: string;
133
- location?: EventMessageLocation;
134
- joinLink?: string;
135
- startTime?: string | number;
136
- endTime?: string | number;
137
- extraGuestsAllowed?: boolean;
138
- }
139
-
140
- interface PollVote {
141
- optionName: string;
142
- optionVoteCount: string | number;
143
- }
144
-
145
- interface PollResultMessage {
146
- name: string;
147
- pollVotes: PollVote[];
148
- }
149
-
150
- interface GroupStatusMessage {
151
- message?: any;
152
- image?: string | Buffer | { url: string };
153
- video?: string | Buffer | { url: string };
154
- text?: string;
155
- caption?: string;
156
- document?: string | Buffer | { url: string };
157
- [key: string]: any;
158
- }
159
-
160
- interface MessageContent {
161
- requestPaymentMessage?: PaymentMessage;
162
- productMessage?: ProductMessage;
163
- interactiveMessage?: InteractiveMessage;
164
- import { proto } from '../../WAProto';
165
-
166
- declare namespace RexxHayanasi {
167
- interface MediaUploadOptions {
168
- fileEncSha256?: Buffer;
169
- mediaType?: string;
170
- newsletter?: boolean;
171
- }
172
-
173
- type WAMediaUploadFunction = (
174
- stream: Buffer | NodeJS.ReadableStream,
175
- options?: MediaUploadOptions
176
- ) => Promise<{ url: string; directPath: string }>;
177
-
178
- interface WAMessageContentGenerationOptions {
179
- upload?: WAMediaUploadFunction;
180
- mediaCache?: any;
181
- options?: any;
182
- logger?: any;
183
- }
184
-
185
- interface StickerMessage {
186
- url: string;
187
- fileSha256: Buffer | string;
188
- fileEncSha256: Buffer | string;
189
- mediaKey: Buffer | string;
190
- mimetype: string;
191
- directPath: string;
192
- fileLength: number | string;
193
- mediaKeyTimestamp: number | string;
194
- isAnimated?: boolean;
195
- stickerSentTs?: number | string;
196
- isAvatar?: boolean;
197
- isAiSticker?: boolean;
198
- isLottie?: boolean;
199
- }
200
-
201
- interface PaymentMessage {
202
- amount: number;
203
- currency?: string;
204
- from?: string;
205
- expiry?: number;
206
- sticker?: { stickerMessage: StickerMessage };
207
- note?: string;
208
- background?: {
209
- id?: string;
210
- fileLength?: string;
211
- width?: number;
212
- height?: number;
213
- mimetype?: string;
214
- placeholderArgb?: number;
215
- textArgb?: number;
216
- subtextArgb?: number;
217
- };
218
- }
219
-
220
- interface ProductMessage {
221
- title: string;
222
- description: string;
223
- thumbnail: Buffer | { url: string };
224
- productId: string;
225
- retailerId: string;
226
- url: string;
227
- body?: string;
228
- footer?: string;
229
- buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
230
- priceAmount1000?: number | null;
231
- currencyCode?: string;
232
- }
233
-
234
- interface InteractiveMessage {
235
- header?: string;
236
- title: string;
237
- footer?: string;
238
- thumbnail?: string;
239
- image?: string | Buffer | { url: string };
240
- video?: string | Buffer | { url: string };
241
- document?: string | Buffer | { url: string };
242
- mimetype?: string;
243
- fileName?: string;
244
- jpegThumbnail?: string | Buffer | { url: string };
245
- contextInfo?: {
246
- mentionedJid?: string[];
247
- forwardingScore?: number;
248
- isForwarded?: boolean;
249
- externalAdReply?: {
250
- title?: string;
251
- body?: string;
252
- mediaType?: number;
253
- thumbnailUrl?: string;
254
- mediaUrl?: string;
255
- sourceUrl?: string;
256
- showAdAttribution?: boolean;
257
- renderLargerThumbnail?: boolean;
258
- [key: string]: any;
259
- };
260
- [key: string]: any;
261
- };
262
- externalAdReply?: {
263
- title?: string;
264
- body?: string;
265
- mediaType?: number;
266
- thumbnailUrl?: string;
267
- mediaUrl?: string;
268
- sourceUrl?: string;
269
- showAdAttribution?: boolean;
270
- renderLargerThumbnail?: boolean;
271
- [key: string]: any;
272
- };
273
- buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
274
- nativeFlowMessage?: {
275
- messageParamsJson?: string;
276
- buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
277
- [key: string]: any;
278
- };
279
- }
280
-
281
- interface AlbumItem {
282
- image?: string | Buffer | { url: string; caption?: string };
283
- video?: string | Buffer | { url: string; caption?: string };
284
- }
285
-
286
- interface EventMessageLocation {
287
- degreesLatitude: number;
288
- degreesLongitude: number;
289
- name: string;
290
- }
291
-
292
- interface EventMessage {
293
- isCanceled?: boolean;
294
- name: string;
295
- description: string;
296
- location?: EventMessageLocation;
297
- joinLink?: string;
298
- startTime?: string | number;
299
- endTime?: string | number;
300
- extraGuestsAllowed?: boolean;
301
- }
302
-
303
- interface PollVote {
304
- optionName: string;
305
- optionVoteCount: string | number;
306
- }
307
-
308
- interface PollResultMessage {
309
- name: string;
310
- pollVotes: PollVote[];
311
- }
312
-
313
- interface GroupStatusMessage {
314
- message?: any;
315
- image?: string | Buffer | { url: string };
316
- video?: string | Buffer | { url: string };
317
- text?: string;
318
- caption?: string;
319
- document?: string | Buffer | { url: string };
320
- [key: string]: any;
321
- }
322
-
323
- interface MessageContent {
324
- requestPaymentMessage?: PaymentMessage;
325
- productMessage?: ProductMessage;
326
- interactiveMessage?: InteractiveMessage;
327
- albumMessage?: AlbumItem[];
328
- eventMessage?: EventMessage;
329
- pollResultMessage?: PollResultMessage;
330
- groupStatusMessage?: GroupStatusMessage;
331
- sender?: string;
332
- }
333
-
334
- interface MessageOptions {
335
- quoted?: proto.IWebMessageInfo;
336
- filter?: boolean;
337
- }
338
-
339
- interface Utils {
340
- prepareWAMessageMedia: (media: any, options: WAMessageContentGenerationOptions) => Promise<any>;
341
- generateWAMessageContent: (content: any, options: WAMessageContentGenerationOptions) => Promise<any>;
342
- generateWAMessageFromContent: (jid: string, content: any, options?: any) => Promise<any>;
343
- generateWAMessage: (jid: string, content: any, options?: any) => Promise<any>;
344
- generateMessageID: () => string;
345
- prepareMessageContent?: (content: any, options?: any) => Promise<any>;
346
- }
347
-
348
- interface BailUtils {
349
- generateWAMessageContent?: (content: any, options: WAMessageContentGenerationOptions) => Promise<any>;
350
- generateMessageID: () => string;
351
- getContentType: (msg: any) => string;
352
- }
353
- }
354
-
355
- declare class RexxHayanasi {
356
- constructor(
357
- utils: RexxHayanasi.Utils,
358
- waUploadToServer: RexxHayanasi.WAMediaUploadFunction,
359
- relayMessageFn?: (jid: string, content: any, options?: any) => Promise<any>
360
- );
361
-
362
- detectType(content: RexxHayanasi.MessageContent): 'PAYMENT' | 'PRODUCT' | 'INTERACTIVE' | 'ALBUM' | 'EVENT' | 'POLL_RESULT' | 'GROUP_STORY' | null;
363
-
364
- handlePayment(
365
- content: { requestPaymentMessage: RexxHayanasi.PaymentMessage },
366
- quoted?: proto.IWebMessageInfo
367
- ): Promise<{ requestPaymentMessage: proto.Message.RequestPaymentMessage }>;
368
-
369
- handleProduct(
370
- content: { productMessage: RexxHayanasi.ProductMessage },
371
- jid: string,
372
- quoted?: proto.IWebMessageInfo
373
- ): Promise<{ viewOnceMessage: proto.Message.ViewOnceMessage }>;
374
-
375
- handleInteractive(
376
- content: { interactiveMessage: RexxHayanasi.InteractiveMessage },
377
- jid: string,
378
- quoted?: proto.IWebMessageInfo
379
- ): Promise<{ interactiveMessage: proto.Message.InteractiveMessage }>;
380
-
381
- handleAlbum(
382
- content: { albumMessage: RexxHayanasi.AlbumItem[] },
383
- jid: string,
384
- quoted?: proto.IWebMessageInfo
385
- ): Promise<any>;
386
-
387
- handleEvent(
388
- content: { eventMessage: RexxHayanasi.EventMessage },
389
- jid: string,
390
- quoted?: proto.IWebMessageInfo
391
- ): Promise<any>;
392
-
393
- handlePollResult(
394
- content: { pollResultMessage: RexxHayanasi.PollResultMessage },
395
- jid: string,
396
- quoted?: proto.IWebMessageInfo
397
- ): Promise<any>;
398
-
399
- handleGroupStory(
400
- content: { groupStatusMessage: RexxHayanasi.GroupStatusMessage },
401
- jid: string,
402
- quoted?: proto.IWebMessageInfo
403
- ): Promise<any>;
404
-
405
- buildMessageContent(
406
- content: any,
407
- opts?: RexxHayanasi.WAMessageContentGenerationOptions
408
- ): Promise<any>;
409
-
410
- utils: RexxHayanasi.Utils;
411
- relayMessage: (jid: string, content: any, options?: any) => Promise<any>;
412
- waUploadToServer: RexxHayanasi.WAMediaUploadFunction;
413
- bail: RexxHayanasi.BailUtils;
414
- }
415
-
416
- export = RexxHayanasi;