@open-wa/wa-automate 4.76.0 → 5.0.0-alpha.2

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 (125) hide show
  1. package/README.md +14 -165
  2. package/dist/cli-runtime-B7_3MM0c.cjs +798 -0
  3. package/dist/cli-runtime-B7_3MM0c.cjs.map +1 -0
  4. package/dist/cli-runtime-CmpYxFCk.d.cts +31 -0
  5. package/dist/cli-runtime-CmpYxFCk.d.cts.map +1 -0
  6. package/dist/cli.cjs +17 -0
  7. package/dist/cli.cjs.map +1 -0
  8. package/dist/cli.d.cts +2 -0
  9. package/dist/index.cjs +224 -0
  10. package/dist/index.cjs.map +1 -0
  11. package/dist/index.d.cts +81 -0
  12. package/dist/index.d.cts.map +1 -0
  13. package/package.json +34 -177
  14. package/CNAME +0 -1
  15. package/_tsconfig.docs.json +0 -140
  16. package/bin/config-schema.json +0 -1
  17. package/bin/oas-type-schemas.json +0 -1
  18. package/bin/server.js +0 -45
  19. package/build/build-config-json-for-bin.ts +0 -56
  20. package/build/generate-oas-types.ts +0 -31
  21. package/dist/api/Client.d.ts +0 -2255
  22. package/dist/api/Client.js +0 -4358
  23. package/dist/api/functions/exposed.enum.d.ts +0 -7
  24. package/dist/api/functions/exposed.enum.js +0 -11
  25. package/dist/api/model/aliases.d.ts +0 -110
  26. package/dist/api/model/aliases.js +0 -3
  27. package/dist/api/model/button.d.ts +0 -24
  28. package/dist/api/model/button.js +0 -2
  29. package/dist/api/model/call.d.ts +0 -51
  30. package/dist/api/model/call.js +0 -18
  31. package/dist/api/model/chat.d.ts +0 -221
  32. package/dist/api/model/chat.js +0 -52
  33. package/dist/api/model/config.d.ts +0 -836
  34. package/dist/api/model/config.js +0 -111
  35. package/dist/api/model/contact.d.ts +0 -143
  36. package/dist/api/model/contact.js +0 -2
  37. package/dist/api/model/errors.d.ts +0 -90
  38. package/dist/api/model/errors.js +0 -117
  39. package/dist/api/model/events.d.ts +0 -120
  40. package/dist/api/model/events.js +0 -127
  41. package/dist/api/model/group-metadata.d.ts +0 -124
  42. package/dist/api/model/group-metadata.js +0 -25
  43. package/dist/api/model/id.d.ts +0 -5
  44. package/dist/api/model/id.js +0 -2
  45. package/dist/api/model/index.d.ts +0 -110
  46. package/dist/api/model/index.js +0 -128
  47. package/dist/api/model/label.d.ts +0 -24
  48. package/dist/api/model/label.js +0 -2
  49. package/dist/api/model/media.d.ts +0 -93
  50. package/dist/api/model/media.js +0 -12
  51. package/dist/api/model/message.d.ts +0 -422
  52. package/dist/api/model/message.js +0 -40
  53. package/dist/api/model/product.d.ts +0 -141
  54. package/dist/api/model/product.js +0 -2
  55. package/dist/api/model/reactions.d.ts +0 -76
  56. package/dist/api/model/reactions.js +0 -2
  57. package/dist/api/model/sessionInfo.d.ts +0 -77
  58. package/dist/api/model/sessionInfo.js +0 -2
  59. package/dist/build/build-postman.d.ts +0 -1
  60. package/dist/build/build-postman.js +0 -262
  61. package/dist/cli/cli-options.d.ts +0 -9
  62. package/dist/cli/cli-options.js +0 -289
  63. package/dist/cli/collections.d.ts +0 -2
  64. package/dist/cli/collections.js +0 -251
  65. package/dist/cli/file-utils.d.ts +0 -1
  66. package/dist/cli/file-utils.js +0 -71
  67. package/dist/cli/index.d.ts +0 -1
  68. package/dist/cli/index.js +0 -231
  69. package/dist/cli/integrations/chatwoot.d.ts +0 -49
  70. package/dist/cli/integrations/chatwoot.js +0 -672
  71. package/dist/cli/integrations/cloudflare.d.ts +0 -6
  72. package/dist/cli/integrations/cloudflare.js +0 -76
  73. package/dist/cli/logo.d.ts +0 -1
  74. package/dist/cli/logo.js +0 -49
  75. package/dist/cli/server.d.ts +0 -24
  76. package/dist/cli/server.js +0 -540
  77. package/dist/cli/setup.d.ts +0 -30
  78. package/dist/cli/setup.js +0 -308
  79. package/dist/config/puppeteer.config.d.ts +0 -11
  80. package/dist/config/puppeteer.config.js +0 -65
  81. package/dist/controllers/auth.d.ts +0 -36
  82. package/dist/controllers/auth.js +0 -322
  83. package/dist/controllers/browser.d.ts +0 -17
  84. package/dist/controllers/browser.js +0 -603
  85. package/dist/controllers/events.d.ts +0 -82
  86. package/dist/controllers/events.js +0 -173
  87. package/dist/controllers/init_patch.d.ts +0 -13
  88. package/dist/controllers/init_patch.js +0 -42
  89. package/dist/controllers/initializer.d.ts +0 -22
  90. package/dist/controllers/initializer.js +0 -511
  91. package/dist/controllers/launch_checks.d.ts +0 -8
  92. package/dist/controllers/launch_checks.js +0 -130
  93. package/dist/controllers/patch_manager.d.ts +0 -37
  94. package/dist/controllers/patch_manager.js +0 -231
  95. package/dist/controllers/popup/index.d.ts +0 -3
  96. package/dist/controllers/popup/index.html +0 -168
  97. package/dist/controllers/popup/index.js +0 -148
  98. package/dist/controllers/script_preloader.d.ts +0 -17
  99. package/dist/controllers/script_preloader.js +0 -88
  100. package/dist/index.d.ts +0 -13
  101. package/dist/index.js +0 -36
  102. package/dist/lib/README.md +0 -5
  103. package/dist/lib/base64.js +0 -1
  104. package/dist/lib/hash.js +0 -1
  105. package/dist/lib/jsSha.min.js +0 -1
  106. package/dist/lib/launch.js +0 -1
  107. package/dist/lib/qr.min.js +0 -1
  108. package/dist/lib/wapi.js +0 -2163
  109. package/dist/logging/custom_transport.d.ts +0 -9
  110. package/dist/logging/custom_transport.js +0 -35
  111. package/dist/logging/logging.d.ts +0 -50
  112. package/dist/logging/logging.js +0 -196
  113. package/dist/structures/Collector.d.ts +0 -202
  114. package/dist/structures/Collector.js +0 -391
  115. package/dist/structures/Dialog.d.ts +0 -55
  116. package/dist/structures/Dialog.js +0 -21
  117. package/dist/structures/MessageCollector.d.ts +0 -78
  118. package/dist/structures/MessageCollector.js +0 -145
  119. package/dist/structures/preProcessors.d.ts +0 -58
  120. package/dist/structures/preProcessors.js +0 -181
  121. package/dist/utils/pid_utils.d.ts +0 -1
  122. package/dist/utils/pid_utils.js +0 -26
  123. package/dist/utils/tools.d.ts +0 -152
  124. package/dist/utils/tools.js +0 -494
  125. package/tos.md +0 -77
@@ -1,422 +0,0 @@
1
- import { ChatId, ContactId, MessageId, GroupChatId } from "./aliases";
2
- import { Button, Row, Section } from "./button";
3
- import { Chat } from "./chat";
4
- import { Contact } from "./contact";
5
- export type MessagePinDuration = "FifteenSeconds" | "FiveSeconds" | "OneDay" | "OneMinute" | "SevenDays" | "ThirtyDays";
6
- export interface Message {
7
- /**
8
- * The ID of the selected button
9
- */
10
- selectedButtonId: string;
11
- /**
12
- * The id of the message. Consists of the Chat ID and a unique string.
13
- *
14
- * Example:
15
- *
16
- * ```
17
- * false_447123456789@c.us_7D914FEA78BE10277743F4B785045C37
18
- * ```
19
- */
20
- id: MessageId;
21
- /**
22
- * The unique segment of the message id.
23
- *
24
- * Example:
25
- *
26
- * ```
27
- * 7D914FEA78BE10277743F4B785045C37
28
- * ```
29
- */
30
- mId: string;
31
- /**
32
- * The body of the message. If the message type is `chat` , `body` will be the text of the chat. If the message type is some sort of media, then this body will be the thumbnail of the media.
33
- */
34
- body: string;
35
- /**
36
- * The device ID of the device that sent the message. This is only present if the message was sent from host account-linked session. This is useful for determining if a message was sent from a different mobile device (note that whenever a device) or a desktop session.
37
- *
38
- * Note: This will emit a number for the current controlled session also but the only way to know if the number represents the current session is by checking `local` (it will be `true` if the message was sent from the current session).
39
- *
40
- * If the device ID is `0` then the message was sent from the "root" host account device.
41
- *
42
- * This might be undefined for incoming messages.
43
- */
44
- device: number;
45
- /**
46
- * If the message was sent from this controlled session this will be `true`. This is useful for determining if a message was sent from a different mobile device (note that whenever a device) or a desktop session.
47
- */
48
- local: boolean;
49
- /**
50
- * a convenient way to get the main text content from a message.
51
- */
52
- text: string;
53
- /**
54
- * The type of the message, see [[MessageTypes]]
55
- */
56
- type: MessageTypes;
57
- /**
58
- * Used to checking the integrity of the decrypted media.
59
- */
60
- filehash?: string;
61
- mimetype?: string;
62
- /**
63
- * The latitude of a location message
64
- */
65
- lat?: string;
66
- /**
67
- * The longitude of a location message
68
- */
69
- lng?: string;
70
- /**
71
- * The text associated with a location message
72
- */
73
- loc?: string;
74
- /**
75
- * The timestamp of the message
76
- */
77
- t: number;
78
- notifyName: string;
79
- /**
80
- * The chat from which the message was sent
81
- */
82
- from: ChatId;
83
- /**
84
- * The chat id to which the message is being sent
85
- */
86
- to: ChatId;
87
- /**
88
- * Indicates whether the message is coming into the session or going out of the session. You can have a message sent by the host account show as `in` when the message was sent from another
89
- * session or from the host account device itself.
90
- */
91
- self: "in" | "out";
92
- /**
93
- * The length of the media in the message, if it exists.
94
- */
95
- duration?: string | number;
96
- /**
97
- * The acknolwedgement state of a message [[MessageAck]]
98
- */
99
- ack: MessageAck;
100
- invis: boolean;
101
- isNewMsg: boolean;
102
- star: boolean;
103
- recvFresh: boolean;
104
- /**
105
- * If the message is sent as a broadcast
106
- */
107
- broadcast: boolean;
108
- /**
109
- * If the message has been forwarded
110
- */
111
- isForwarded: boolean;
112
- /**
113
- * The labels associated with the message (used with business accounts)
114
- */
115
- labels: string[];
116
- /**
117
- * An array of all mentioned numbers in this message.
118
- */
119
- mentionedJidList: ContactId[];
120
- /**
121
- * If the message is of a media type, it may also have a caption
122
- */
123
- caption: string;
124
- /**
125
- * The contact object of the account that sent the message
126
- */
127
- sender: Contact;
128
- /**
129
- * the timestanmp of the message
130
- */
131
- timestamp: number;
132
- /**
133
- * When `config.messagePreprocessor: "AUTO_DECRYPT_SAVE"` is set, media is decrypted and saved on disk in a folder called media relative to the current working directory.
134
- *
135
- * This is the filePath of the decrypted file.
136
- */
137
- filePath?: string;
138
- /**
139
- * The given filename of the file
140
- */
141
- filename?: string;
142
- content: string;
143
- isGroupMsg: boolean;
144
- isMMS: boolean;
145
- isMedia: boolean;
146
- isNotification: boolean;
147
- isPSA: boolean;
148
- /**
149
- * If the message is from the host account
150
- */
151
- fromMe: boolean;
152
- /**
153
- * The chat object
154
- */
155
- chat: Chat;
156
- chatId: ChatId;
157
- author: string;
158
- stickerAuthor?: string;
159
- stickerPack?: string;
160
- /**
161
- * @deprecated
162
- *
163
- * Ironically, you should be using `deprecatedMms3Url` instead
164
- */
165
- clientUrl: string;
166
- deprecatedMms3Url: string;
167
- /**
168
- * If this message is quoting (replying to) another message
169
- */
170
- isQuotedMsgAvailable: boolean;
171
- quotedMsg?: Message;
172
- quotedMsgObj?: Message;
173
- /**
174
- * When a user requests to join a group wihtin a community the request is received by the host as a message. This boolean will allow you to easily determine if the incoming message is a request to join a group.
175
- *
176
- * If this is `true` then you need to determine within your own code whether or not to accept the user to the group which is indicated with `quotedRemoteJid` using `addParticipant`.
177
- */
178
- isGroupJoinRequest?: GroupChatId;
179
- /**
180
- * The ID of the message sender
181
- */
182
- senderId?: string;
183
- /**
184
- * The ID of the quoted group. Usually present when a user is requesting to join a group.
185
- */
186
- quotedRemoteJid?: string;
187
- /**
188
- * The parent group ID (community ID - communities are just groups made up of other groups) of the group represented by `quotedRemoteJid`
189
- */
190
- quotedParentGroupJid?: GroupChatId;
191
- mediaData: unknown;
192
- shareDuration: number;
193
- isAnimated: boolean;
194
- ctwaContext?: {
195
- sourceUrl: string;
196
- thumbnail: string | null;
197
- mediaType: number;
198
- isSuspiciousLink: boolean | null;
199
- };
200
- /**
201
- * Is the message a "view once" message
202
- */
203
- isViewOnce: boolean;
204
- /**
205
- * Use this to traverse the quote chain.
206
- */
207
- quoteMap: QuoteMap;
208
- /**
209
- * The URL of the file after being uploaded to the cloud using a cloud upload message preprocessor.
210
- */
211
- cloudUrl?: string;
212
- /**
213
- * Buttons associated with the message
214
- */
215
- buttons?: Button[];
216
- /**
217
- * List response associated with the message
218
- */
219
- listResponse?: Row;
220
- /**
221
- * The list associated with the list message
222
- */
223
- list?: {
224
- "sections": Section[];
225
- "title": string;
226
- "description": string;
227
- "buttonText": string;
228
- };
229
- /**
230
- * The options of a poll
231
- */
232
- pollOptions?: PollOption[];
233
- /**
234
- * The reaction of the host account to this message
235
- */
236
- reactionByMe?: ReactionSender;
237
- reactions: {
238
- aggregateEmoji: string;
239
- /**
240
- * The senders of this reaction
241
- */
242
- senders: ReactionSender[];
243
- /**
244
- * If the host account has reacted to this message with this reaction
245
- */
246
- hasReactionByMe: boolean;
247
- /**
248
- * The message ID of the reaction itself
249
- */
250
- id: string;
251
- }[];
252
- }
253
- export interface ReactionSender {
254
- /**
255
- * The ID of the message being reacted to
256
- */
257
- parentMsgKey: MessageId;
258
- /**
259
- * The contact ID of the sender of the reaction
260
- */
261
- senderUserJid: ContactId;
262
- /**
263
- * The message ID of the reaction itself
264
- */
265
- msgKey: MessageId;
266
- /**
267
- * The text of the reaction
268
- */
269
- reactionText: string;
270
- /**
271
- * The timestamp of the reaction
272
- */
273
- timestamp: number;
274
- orphan: number;
275
- /**
276
- * If the reaction was seen/read
277
- */
278
- read: boolean;
279
- /**
280
- * The timestamp of the reaction
281
- */
282
- t?: number;
283
- /**
284
- * The message ID of the reaction itself
285
- */
286
- id: MessageId;
287
- isSendFailure: boolean;
288
- ack?: number;
289
- }
290
- export interface PollOption {
291
- name: string;
292
- localId: number;
293
- }
294
- export interface PollData {
295
- /**
296
- * The total amount of votes recorded so far
297
- */
298
- totalVotes: number;
299
- /**
300
- * The poll options and their respective count of votes.
301
- */
302
- pollOptions: (PollOption & {
303
- count: number;
304
- })[];
305
- /**
306
- * An arrray of vote objects
307
- */
308
- votes: PollVote[];
309
- /**
310
- * The message object of the poll
311
- */
312
- pollMessage: Message;
313
- }
314
- export interface PollVote {
315
- ack: number;
316
- /**
317
- * The message ID of this vote. For some reason this is different from the msgKey and includes exclamaition marks.
318
- */
319
- id: string;
320
- /**
321
- * The message key of this vote
322
- */
323
- msgKey: string;
324
- /**
325
- * The Message ID of the original Poll message
326
- */
327
- parentMsgKey: string;
328
- /**
329
- * The original poll options available on the poll
330
- */
331
- pollOptions: PollOption[];
332
- /**
333
- * The selected option IDs of the voter
334
- */
335
- selectedOptionLocalIds: number[];
336
- /**
337
- * The selected option values by this voter
338
- */
339
- selectedOptionValues: string[];
340
- /**
341
- * The contact ID of the voter
342
- */
343
- sender: ContactId;
344
- /**
345
- * The contact object of the voter
346
- */
347
- senderObj: Contact;
348
- /**
349
- * Timestamp of the vote
350
- */
351
- senderTimestampMs: number;
352
- stale: boolean;
353
- }
354
- export interface QuoteMap {
355
- [messageId: string]: {
356
- /**
357
- * The body of the message
358
- */
359
- body: string;
360
- /**
361
- * The message ID of the message that was quoted. Null if no message was quoted.
362
- */
363
- quotes?: MessageId;
364
- };
365
- }
366
- export interface MessageInfoInteraction {
367
- /**
368
- * The contact ID of the contact that interacted with the message.
369
- */
370
- id: ContactId;
371
- /**
372
- * The timestamp of the interaction. You have to x 1000 to use in a JS Date object.
373
- */
374
- t: number;
375
- }
376
- export interface MessageInfo {
377
- deliveryRemaining: number;
378
- playedRemaining: number;
379
- readRemaining: number;
380
- delivery: MessageInfoInteraction[];
381
- read: MessageInfoInteraction[];
382
- played: MessageInfoInteraction[];
383
- /**
384
- * The ID of the message
385
- */
386
- id: MessageId;
387
- }
388
- /**
389
- * Message types
390
- * @readonly
391
- * @enum {string}
392
- */
393
- export declare enum MessageTypes {
394
- TEXT = "chat",
395
- AUDIO = "audio",
396
- VOICE = "ptt",
397
- IMAGE = "image",
398
- VIDEO = "video",
399
- DOCUMENT = "document",
400
- STICKER = "sticker",
401
- LOCATION = "location",
402
- CONTACT_CARD = "vcard",
403
- CONTACT_CARD_MULTI = "multi_vcard",
404
- REVOKED = "revoked",
405
- ORDER = "order",
406
- BUTTONS_RESPONSE = "buttons_response",
407
- LIST_RESPONSE = "list_response",
408
- UNKNOWN = "unknown"
409
- }
410
- /**
411
- * Message ACK
412
- * @readonly
413
- * @enum {number}
414
- */
415
- export declare enum MessageAck {
416
- ACK_ERROR = -1,
417
- ACK_PENDING = 0,
418
- ACK_SERVER = 1,
419
- ACK_DEVICE = 2,
420
- ACK_READ = 3,
421
- ACK_PLAYED = 4
422
- }
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MessageAck = exports.MessageTypes = void 0;
4
- /**
5
- * Message types
6
- * @readonly
7
- * @enum {string}
8
- */
9
- var MessageTypes;
10
- (function (MessageTypes) {
11
- MessageTypes["TEXT"] = "chat";
12
- MessageTypes["AUDIO"] = "audio";
13
- MessageTypes["VOICE"] = "ptt";
14
- MessageTypes["IMAGE"] = "image";
15
- MessageTypes["VIDEO"] = "video";
16
- MessageTypes["DOCUMENT"] = "document";
17
- MessageTypes["STICKER"] = "sticker";
18
- MessageTypes["LOCATION"] = "location";
19
- MessageTypes["CONTACT_CARD"] = "vcard";
20
- MessageTypes["CONTACT_CARD_MULTI"] = "multi_vcard";
21
- MessageTypes["REVOKED"] = "revoked";
22
- MessageTypes["ORDER"] = "order";
23
- MessageTypes["BUTTONS_RESPONSE"] = "buttons_response";
24
- MessageTypes["LIST_RESPONSE"] = "list_response";
25
- MessageTypes["UNKNOWN"] = "unknown";
26
- })(MessageTypes = exports.MessageTypes || (exports.MessageTypes = {}));
27
- /**
28
- * Message ACK
29
- * @readonly
30
- * @enum {number}
31
- */
32
- var MessageAck;
33
- (function (MessageAck) {
34
- MessageAck[MessageAck["ACK_ERROR"] = -1] = "ACK_ERROR";
35
- MessageAck[MessageAck["ACK_PENDING"] = 0] = "ACK_PENDING";
36
- MessageAck[MessageAck["ACK_SERVER"] = 1] = "ACK_SERVER";
37
- MessageAck[MessageAck["ACK_DEVICE"] = 2] = "ACK_DEVICE";
38
- MessageAck[MessageAck["ACK_READ"] = 3] = "ACK_READ";
39
- MessageAck[MessageAck["ACK_PLAYED"] = 4] = "ACK_PLAYED";
40
- })(MessageAck = exports.MessageAck || (exports.MessageAck = {}));
@@ -1,141 +0,0 @@
1
- import { Message } from "./message";
2
- export interface CustomProduct {
3
- /**
4
- * The main title of the product. E.g:
5
- * `BAVARIA — 35 SPORTS CRUISER (2006)`
6
- */
7
- name: string;
8
- /**
9
- * The description of the product. This shows right under the price so it is useful for subscriptions/rentals. E.g:
10
- *
11
- * `(per day)\n\nCome and have a fantastic sailing adventure aboard our boat. \nShe is a Bavaria 35 sports cruiser and is powered by 2 economical Volvo D6’s with Bravo 2 outdrives as well as a bow thruster. This Makes maneuvering very easy. She can accommodate up to 8 people for day charters and for overnight charters she can accommodate 4 in comfort in 2 cabins.`
12
- */
13
- description: string;
14
- /**
15
- * The price amount multiplied by 1000. For example, for something costing `825` units of currency:
16
- * `825000`
17
- */
18
- priceAmount1000: number;
19
- /**
20
- * The [**ISO 4217**](https://en.wikipedia.org/wiki/ISO_4217) 3 letter currency code. E.g (Swedish krona)
21
- * `SEK`
22
- */
23
- currency: string;
24
- /**
25
- * The URL of the product.
26
- *
27
- * NOTE: At the moment, the URL DOES NOT WORK. It shows up for the recipient but they will not be able to click it. As a rememdy, it is added as a reply to the product message.
28
- */
29
- url?: string;
30
- }
31
- export interface CartItem {
32
- /**
33
- * Product ID
34
- */
35
- id: string;
36
- /**
37
- * Product name
38
- */
39
- name: string;
40
- /**
41
- * Amount of this item in the cart
42
- */
43
- qty: number;
44
- thumbnailId: string;
45
- /**
46
- * URL to .enc file of the thumbnail. Just change the filetype to .jpg to view the thumbnail
47
- */
48
- thumbnailUrl: string;
49
- }
50
- export interface Product {
51
- /**
52
- * Product ID
53
- */
54
- id: string;
55
- /**
56
- * `true` if the product is hidden from public view.
57
- */
58
- isHidden?: boolean;
59
- /**
60
- * The id of the catalog in which this product is located.
61
- */
62
- catalogWid?: string;
63
- /**
64
- * The URL of the product.
65
- */
66
- url?: string;
67
- /**
68
- * The name of the product.
69
- */
70
- name?: string;
71
- /**
72
- * The description of the product.
73
- */
74
- description?: string;
75
- /**
76
- * The availiable quantity of this product.
77
- * @default "unknown"`
78
- */
79
- availability?: number | "unknown";
80
- /**
81
- * The review status of the product
82
- */
83
- reviewStatus?: "NO_REVIEW" | "PENDING" | "REJECTED" | "APPROVED" | "OUTDATED";
84
- /**
85
- * The url of the main image of the product.
86
- *
87
- * NOTE: If downloading manually, the filetype must be changed to .jpg to view the image.
88
- */
89
- imageCdnUrl?: string;
90
- /**
91
- * The number of images of the product.
92
- */
93
- imageCount?: number;
94
- /**
95
- * Array of URLs of the other images of the product. Does not include the main image.
96
- */
97
- additionalImageCdnUrl?: string[];
98
- /**
99
- * The price of the product in 1000 units.
100
- */
101
- priceAmount1000?: number;
102
- /**
103
- * The custom id of the product.
104
- */
105
- retailerId?: string;
106
- /**
107
- * The timestamp when the product was created / 1000
108
- */
109
- t?: number;
110
- /**
111
- * The [**ISO 4217**](https://en.wikipedia.org/wiki/ISO_4217) 3 letter currency code. E.g (Swedish krona)
112
- * `SEK`
113
- */
114
- currency: string;
115
- }
116
- export interface Order {
117
- /**
118
- * Order ID
119
- */
120
- id: string;
121
- /**
122
- * epoch ts divided by 1000
123
- */
124
- createdAt: number;
125
- /**
126
- * The [**ISO 4217**](https://en.wikipedia.org/wiki/ISO_4217) 3 letter currency code. E.g (Swedish krona)
127
- * `SEK`
128
- */
129
- currency: string;
130
- /**
131
- * An array of items in the cart
132
- */
133
- products: CartItem[];
134
- sellerJid: string;
135
- subtotal: `${number}`;
136
- total: `${number}`;
137
- /**
138
- * The message object associated with the order. Only populated in `onOrder` callback.
139
- */
140
- message?: Message;
141
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,76 +0,0 @@
1
- import { ContactId } from "./aliases";
2
- import { Message, MessageAck } from "./message";
3
- /**
4
- * A reaction is identified the specific emoji.
5
- */
6
- export 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 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 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
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });