@alannxd/baileys 6.0.5 → 6.0.9

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 (123) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +341 -286
  3. package/WAProto/WAProto.proto +1782 -359
  4. package/WAProto/index.d.ts +75133 -9893
  5. package/WAProto/index.js +205861 -60606
  6. package/lib/Socket/luxu.js +6 -117
  7. package/lib/Socket/messages-send.js +637 -493
  8. package/lib/Socket/newsletter.js +229 -156
  9. package/lib/Utils/browser-utils.js +26 -6
  10. package/lib/Utils/decode-wa-message.js +33 -0
  11. package/lib/Utils/generics.js +10 -0
  12. package/lib/Utils/index.js +1 -0
  13. package/lib/Utils/message-composer.js +273 -0
  14. package/lib/Utils/messages.js +361 -24
  15. package/lib/WABinary/generic-utils.js +8 -1
  16. package/lib/WABinary/jid-utils.js +2 -0
  17. package/lib/index.js +1 -2
  18. package/package.json +5 -4
  19. package/lib/Defaults/index.d.ts +0 -75
  20. package/lib/Signal/Group/ciphertext-message.d.ts +0 -10
  21. package/lib/Signal/Group/group-session-builder.d.ts +0 -15
  22. package/lib/Signal/Group/group_cipher.d.ts +0 -17
  23. package/lib/Signal/Group/index.d.ts +0 -12
  24. package/lib/Signal/Group/keyhelper.d.ts +0 -11
  25. package/lib/Signal/Group/sender-chain-key.d.ts +0 -14
  26. package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -17
  27. package/lib/Signal/Group/sender-key-message.d.ts +0 -19
  28. package/lib/Signal/Group/sender-key-name.d.ts +0 -18
  29. package/lib/Signal/Group/sender-key-record.d.ts +0 -31
  30. package/lib/Signal/Group/sender-key-state.d.ts +0 -39
  31. package/lib/Signal/Group/sender-message-key.d.ts +0 -12
  32. package/lib/Signal/libsignal.d.ts +0 -5
  33. package/lib/Signal/lid-mapping.d.ts +0 -23
  34. package/lib/Socket/Client/index.d.ts +0 -3
  35. package/lib/Socket/Client/types.d.ts +0 -16
  36. package/lib/Socket/Client/websocket.d.ts +0 -13
  37. package/lib/Socket/business.d.ts +0 -217
  38. package/lib/Socket/chats.d.ts +0 -124
  39. package/lib/Socket/communities.d.ts +0 -273
  40. package/lib/Socket/groups.d.ts +0 -162
  41. package/lib/Socket/index.d.ts +0 -260
  42. package/lib/Socket/luxu.d.ts +0 -22
  43. package/lib/Socket/messages-recv.d.ts +0 -213
  44. package/lib/Socket/messages-send.d.ts +0 -199
  45. package/lib/Socket/mex.d.ts +0 -3
  46. package/lib/Socket/newsletter.d.ts +0 -170
  47. package/lib/Socket/socket.d.ts +0 -59
  48. package/lib/Store/index.d.ts +0 -10
  49. package/lib/Store/keyed-db.d.ts +0 -22
  50. package/lib/Store/make-cache-manager-store.d.ts +0 -19
  51. package/lib/Store/make-in-memory-store.d.ts +0 -39
  52. package/lib/Store/make-ordered-dictionary.d.ts +0 -14
  53. package/lib/Store/object-repository.d.ts +0 -11
  54. package/lib/Types/Auth.d.ts +0 -117
  55. package/lib/Types/Bussines.d.ts +0 -25
  56. package/lib/Types/Call.d.ts +0 -15
  57. package/lib/Types/Chat.d.ts +0 -124
  58. package/lib/Types/Contact.d.ts +0 -26
  59. package/lib/Types/Events.d.ts +0 -256
  60. package/lib/Types/GroupMetadata.d.ts +0 -71
  61. package/lib/Types/Label.d.ts +0 -47
  62. package/lib/Types/LabelAssociation.d.ts +0 -30
  63. package/lib/Types/Message.d.ts +0 -320
  64. package/lib/Types/Mex.d.ts +0 -141
  65. package/lib/Types/Product.d.ts +0 -79
  66. package/lib/Types/Signal.d.ts +0 -87
  67. package/lib/Types/Socket.d.ts +0 -136
  68. package/lib/Types/State.d.ts +0 -97
  69. package/lib/Types/USync.d.ts +0 -26
  70. package/lib/Types/index.d.ts +0 -65
  71. package/lib/Utils/auth-utils.d.ts +0 -24
  72. package/lib/Utils/browser-utils.d.ts +0 -4
  73. package/lib/Utils/business.d.ts +0 -23
  74. package/lib/Utils/chat-utils.d.ts +0 -100
  75. package/lib/Utils/companion-reg-client-utils.d.ts +0 -17
  76. package/lib/Utils/crypto.d.ts +0 -37
  77. package/lib/Utils/decode-wa-message.d.ts +0 -66
  78. package/lib/Utils/event-buffer.d.ts +0 -36
  79. package/lib/Utils/generics.d.ts +0 -91
  80. package/lib/Utils/history.d.ts +0 -24
  81. package/lib/Utils/identity-change-handler.d.ts +0 -44
  82. package/lib/Utils/index.d.ts +0 -22
  83. package/lib/Utils/link-preview.d.ts +0 -21
  84. package/lib/Utils/logger.d.ts +0 -12
  85. package/lib/Utils/lt-hash.d.ts +0 -8
  86. package/lib/Utils/make-mutex.d.ts +0 -9
  87. package/lib/Utils/message-retry-manager.d.ts +0 -115
  88. package/lib/Utils/messages-media.d.ts +0 -133
  89. package/lib/Utils/messages.d.ts +0 -91
  90. package/lib/Utils/noise-handler.d.ts +0 -20
  91. package/lib/Utils/offline-node-processor.d.ts +0 -17
  92. package/lib/Utils/pre-key-manager.d.ts +0 -28
  93. package/lib/Utils/process-message.d.ts +0 -60
  94. package/lib/Utils/reporting-utils.d.ts +0 -11
  95. package/lib/Utils/signal.d.ts +0 -47
  96. package/lib/Utils/stanza-ack.d.ts +0 -11
  97. package/lib/Utils/sync-action-utils.d.ts +0 -19
  98. package/lib/Utils/tc-token-utils.d.ts +0 -37
  99. package/lib/Utils/use-multi-file-auth-state.d.ts +0 -13
  100. package/lib/Utils/validate-connection.d.ts +0 -11
  101. package/lib/WABinary/constants.d.ts +0 -28
  102. package/lib/WABinary/decode.d.ts +0 -7
  103. package/lib/WABinary/encode.d.ts +0 -3
  104. package/lib/WABinary/generic-utils.d.ts +0 -18
  105. package/lib/WABinary/index.d.ts +0 -6
  106. package/lib/WABinary/jid-utils.d.ts +0 -48
  107. package/lib/WABinary/types.d.ts +0 -19
  108. package/lib/WAM/BinaryInfo.d.ts +0 -9
  109. package/lib/WAM/constants.d.ts +0 -40
  110. package/lib/WAM/encode.d.ts +0 -3
  111. package/lib/WAM/index.d.ts +0 -4
  112. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -10
  113. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -23
  114. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -13
  115. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -13
  116. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +0 -10
  117. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -26
  118. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -10
  119. package/lib/WAUSync/Protocols/index.d.ts +0 -6
  120. package/lib/WAUSync/USyncQuery.d.ts +0 -30
  121. package/lib/WAUSync/USyncUser.d.ts +0 -17
  122. package/lib/WAUSync/index.d.ts +0 -4
  123. package/lib/index.d.ts +0 -13
@@ -1,320 +0,0 @@
1
- import type { Readable } from 'stream';
2
- import type { URL } from 'url';
3
- import { proto } from '../../WAProto/index.js';
4
- import type { MediaType } from '../Defaults/index.js';
5
- import type { BinaryNode } from '../WABinary/index.js';
6
- import type { GroupMetadata } from './GroupMetadata.js';
7
- import type { CacheStore } from './Socket.js';
8
- export { proto as WAProto };
9
- export type WAMessage = proto.IWebMessageInfo & {
10
- key: WAMessageKey;
11
- messageStubParameters?: any;
12
- category?: string;
13
- retryCount?: number;
14
- };
15
- export type WAMessageContent = proto.IMessage;
16
- export type WAContactMessage = proto.Message.IContactMessage;
17
- export type WAContactsArrayMessage = proto.Message.IContactsArrayMessage;
18
- export type WAMessageKey = proto.IMessageKey & {
19
- remoteJidAlt?: string;
20
- remoteJidUsername?: string;
21
- participantAlt?: string;
22
- participantUsername?: string;
23
- server_id?: string;
24
- addressingMode?: string;
25
- isViewOnce?: boolean;
26
- };
27
- export type WATextMessage = proto.Message.IExtendedTextMessage;
28
- export type WAContextInfo = proto.IContextInfo;
29
- export type WALocationMessage = proto.Message.ILocationMessage;
30
- export type WAGenericMediaMessage = proto.Message.IVideoMessage | proto.Message.IImageMessage | proto.Message.IAudioMessage | proto.Message.IDocumentMessage | proto.Message.IStickerMessage;
31
- export declare const WAMessageStubType: typeof proto.WebMessageInfo.StubType;
32
- export declare const WAMessageStatus: typeof proto.WebMessageInfo.Status;
33
- import type { ILogger } from '../Utils/logger.js';
34
- export type WAMediaPayloadURL = {
35
- url: URL | string;
36
- };
37
- export type WAMediaPayloadStream = {
38
- stream: Readable;
39
- };
40
- export type WAMediaUpload = Buffer | WAMediaPayloadStream | WAMediaPayloadURL;
41
- /** Set of message types that are supported by the library */
42
- export type MessageType = keyof proto.Message;
43
- export declare enum WAMessageAddressingMode {
44
- PN = "pn",
45
- LID = "lid"
46
- }
47
- export type MessageWithContextInfo = 'imageMessage' | 'contactMessage' | 'locationMessage' | 'extendedTextMessage' | 'documentMessage' | 'audioMessage' | 'videoMessage' | 'call' | 'contactsArrayMessage' | 'liveLocationMessage' | 'templateMessage' | 'stickerMessage' | 'groupInviteMessage' | 'templateButtonReplyMessage' | 'productMessage' | 'listMessage' | 'orderMessage' | 'listResponseMessage' | 'buttonsMessage' | 'buttonsResponseMessage' | 'interactiveMessage' | 'interactiveResponseMessage' | 'pollCreationMessage' | 'requestPhoneNumberMessage' | 'messageHistoryBundle' | 'eventMessage' | 'newsletterAdminInviteMessage' | 'albumMessage' | 'stickerPackMessage' | 'pollResultSnapshotMessage' | 'messageHistoryNotice';
48
- export type DownloadableMessage = {
49
- mediaKey?: Uint8Array | null;
50
- directPath?: string | null;
51
- url?: string | null;
52
- };
53
- export type MessageReceiptType = 'read' | 'read-self' | 'hist_sync' | 'peer_msg' | 'sender' | 'inactive' | 'played' | undefined;
54
- export type MediaConnInfo = {
55
- auth: string;
56
- ttl: number;
57
- hosts: {
58
- hostname: string;
59
- maxContentLengthBytes: number;
60
- }[];
61
- fetchDate: Date;
62
- };
63
- export interface WAUrlInfo {
64
- 'canonical-url': string;
65
- 'matched-text': string;
66
- title: string;
67
- description?: string;
68
- jpegThumbnail?: Buffer;
69
- highQualityThumbnail?: proto.Message.IImageMessage;
70
- originalThumbnailUrl?: string;
71
- }
72
- type Mentionable = {
73
- /** list of jids that are mentioned in the accompanying text */
74
- mentions?: string[];
75
- /** mention all */
76
- mentionAll?: boolean;
77
- };
78
- type Contextable = {
79
- /** add contextInfo to the message */
80
- contextInfo?: proto.IContextInfo;
81
- };
82
- type ViewOnce = {
83
- viewOnce?: boolean;
84
- };
85
- type Editable = {
86
- edit?: WAMessageKey;
87
- };
88
- type WithDimensions = {
89
- width?: number;
90
- height?: number;
91
- };
92
- export type PollMessageOptions = {
93
- name: string;
94
- selectableCount?: number;
95
- values: string[];
96
- /** 32 byte message secret to encrypt poll selections */
97
- messageSecret?: Uint8Array;
98
- toAnnouncementGroup?: boolean;
99
- };
100
- export type EventMessageOptions = {
101
- name: string;
102
- description?: string;
103
- startDate: Date;
104
- endDate?: Date;
105
- location?: WALocationMessage;
106
- call?: 'audio' | 'video';
107
- isCancelled?: boolean;
108
- isScheduleCall?: boolean;
109
- extraGuestsAllowed?: boolean;
110
- messageSecret?: Uint8Array<ArrayBufferLike>;
111
- };
112
- export type AlbumMessageOptions = {
113
- /** Number of images expected in the album */
114
- expectedImageCount?: number;
115
- /** Number of videos expected in the album */
116
- expectedVideoCount?: number;
117
- };
118
- type SharePhoneNumber = {
119
- sharePhoneNumber: boolean;
120
- };
121
- type RequestPhoneNumber = {
122
- requestPhoneNumber: boolean;
123
- };
124
- export type AnyMediaMessageContent = (({
125
- image: WAMediaUpload;
126
- caption?: string;
127
- jpegThumbnail?: string;
128
- } & Mentionable & Contextable & WithDimensions) | ({
129
- video: WAMediaUpload;
130
- caption?: string;
131
- gifPlayback?: boolean;
132
- jpegThumbnail?: string;
133
- /** if set to true, will send as a `video note` */
134
- ptv?: boolean;
135
- } & Mentionable & Contextable & WithDimensions) | {
136
- audio: WAMediaUpload;
137
- /** if set to true, will send as a `voice note` */
138
- ptt?: boolean;
139
- /** optionally tell the duration of the audio */
140
- seconds?: number;
141
- } | ({
142
- sticker: WAMediaUpload;
143
- isAnimated?: boolean;
144
- } & WithDimensions) | ({
145
- document: WAMediaUpload;
146
- mimetype: string;
147
- fileName?: string;
148
- caption?: string;
149
- } & Contextable)) & {
150
- mimetype?: string;
151
- } & Editable & {
152
- /** key of the parent albumMessage to associate this media with */
153
- albumParentKey?: WAMessageKey;
154
- };
155
- export type ButtonReplyInfo = {
156
- displayText: string;
157
- id: string;
158
- index: number;
159
- };
160
- export type GroupInviteInfo = {
161
- inviteCode: string;
162
- inviteExpiration: number;
163
- text: string;
164
- jid: string;
165
- subject: string;
166
- };
167
- export type WASendableProduct = Omit<proto.Message.ProductMessage.IProductSnapshot, 'productImage'> & {
168
- productImage: WAMediaUpload;
169
- };
170
- export type AnyRegularMessageContent = (({
171
- text: string;
172
- linkPreview?: WAUrlInfo | null;
173
- } & Mentionable & Contextable & Editable) | AnyMediaMessageContent | {
174
- event: EventMessageOptions;
175
- } | ({
176
- poll: PollMessageOptions;
177
- } & Mentionable & Contextable & Editable) | ({
178
- album: AlbumMessageOptions;
179
- } & Contextable & Mentionable) | {
180
- contacts: {
181
- displayName?: string;
182
- contacts: proto.Message.IContactMessage[];
183
- };
184
- } | {
185
- location: WALocationMessage;
186
- } | {
187
- react: proto.Message.IReactionMessage;
188
- } | {
189
- buttonReply: ButtonReplyInfo;
190
- type: 'template' | 'plain';
191
- } | {
192
- groupInvite: GroupInviteInfo;
193
- } | {
194
- listReply: Omit<proto.Message.IListResponseMessage, 'contextInfo'>;
195
- } | {
196
- pin: WAMessageKey;
197
- type: proto.PinInChat.Type;
198
- /**
199
- * 24 hours, 7 days, 30 days
200
- */
201
- time?: 86400 | 604800 | 2592000;
202
- } | {
203
- product: WASendableProduct;
204
- businessOwnerJid?: string;
205
- body?: string;
206
- footer?: string;
207
- } | SharePhoneNumber | RequestPhoneNumber) & ViewOnce;
208
- export type AnyMessageContent = AnyRegularMessageContent | {
209
- forward: WAMessage;
210
- force?: boolean;
211
- } | {
212
- /** Delete your message or anyone's message in a group (admin required) */
213
- delete: WAMessageKey;
214
- } | {
215
- disappearingMessagesInChat: boolean | number;
216
- } | {
217
- limitSharing: boolean;
218
- };
219
- export type GroupMetadataParticipants = Pick<GroupMetadata, 'participants'>;
220
- type MinimalRelayOptions = {
221
- /** override the message ID with a custom provided string */
222
- messageId?: string;
223
- /** should we use group metadata cache, or fetch afresh from the server; default assumed to be "true" */
224
- useCachedGroupMetadata?: boolean;
225
- };
226
- export type MessageRelayOptions = MinimalRelayOptions & {
227
- /** only send to a specific participant; used when a message decryption fails for a single user */
228
- participant?: {
229
- jid: string;
230
- count: number;
231
- };
232
- /** additional attributes to add to the WA binary node */
233
- additionalAttributes?: {
234
- [_: string]: string;
235
- };
236
- additionalNodes?: BinaryNode[];
237
- /** should we use the devices cache, or fetch afresh from the server; default assumed to be "true" */
238
- useUserDevicesCache?: boolean;
239
- /** jid list of participants for status@broadcast */
240
- statusJidList?: string[];
241
- };
242
- export type MiscMessageGenerationOptions = MinimalRelayOptions & {
243
- /** optional, if you want to manually set the timestamp of the message */
244
- timestamp?: Date;
245
- /** the message you want to quote */
246
- quoted?: WAMessage;
247
- /** disappearing messages settings */
248
- ephemeralExpiration?: number | string;
249
- /** timeout for media upload to WA server */
250
- mediaUploadTimeoutMs?: number;
251
- /** jid list of participants for status@broadcast */
252
- statusJidList?: string[];
253
- /** backgroundcolor for status */
254
- backgroundColor?: string;
255
- /** font type for status */
256
- font?: number;
257
- /** if it is broadcast */
258
- broadcast?: boolean;
259
- };
260
- export type MessageGenerationOptionsFromContent = MiscMessageGenerationOptions & {
261
- userJid: string;
262
- };
263
- export type WAMediaUploadFunction = (encFilePath: string, opts: {
264
- fileEncSha256B64: string;
265
- mediaType: MediaType;
266
- timeoutMs?: number;
267
- }) => Promise<{
268
- mediaUrl: string;
269
- directPath: string;
270
- meta_hmac?: string;
271
- ts?: number;
272
- fbid?: number;
273
- }>;
274
- export type MediaGenerationOptions = {
275
- logger?: ILogger;
276
- mediaTypeOverride?: MediaType;
277
- upload: WAMediaUploadFunction;
278
- /** cache media so it does not have to be uploaded again */
279
- mediaCache?: CacheStore;
280
- mediaUploadTimeoutMs?: number;
281
- options?: RequestInit;
282
- backgroundColor?: string;
283
- font?: number;
284
- };
285
- export type MessageContentGenerationOptions = MediaGenerationOptions & {
286
- getUrlInfo?: (text: string) => Promise<WAUrlInfo | undefined>;
287
- getProfilePicUrl?: (jid: string, type: 'image' | 'preview') => Promise<string | undefined>;
288
- getCallLink?: (type: 'audio' | 'video', event?: {
289
- startTime: number;
290
- }) => Promise<string | undefined>;
291
- jid?: string;
292
- };
293
- export type MessageGenerationOptions = MessageContentGenerationOptions & MessageGenerationOptionsFromContent;
294
- /**
295
- * Type of message upsert
296
- * 1. notify => notify the user, this message was just received
297
- * 2. append => append the message to the chat history, no notification required
298
- */
299
- export type MessageUpsertType = 'append' | 'notify';
300
- export type MessageUserReceipt = proto.IUserReceipt;
301
- export type WAMessageUpdate = {
302
- update: Partial<WAMessage>;
303
- key: WAMessageKey;
304
- };
305
- export type WAMessageCursor = {
306
- before: WAMessageKey | undefined;
307
- } | {
308
- after: WAMessageKey | undefined;
309
- };
310
- export type MessageUserReceiptUpdate = {
311
- key: WAMessageKey;
312
- receipt: MessageUserReceipt;
313
- };
314
- export type MediaDecryptionKeyInfo = {
315
- iv: Uint8Array;
316
- cipherKey: Uint8Array;
317
- macKey?: Uint8Array;
318
- };
319
- export type MinimalMessage = Pick<WAMessage, 'key' | 'messageTimestamp'>;
320
- //# sourceMappingURL=Message.d.ts.map
@@ -1,141 +0,0 @@
1
- export declare enum XWAPaths {
2
- xwa2_newsletter_create = "xwa2_newsletter_create",
3
- xwa2_newsletter_subscribers = "xwa2_newsletter_subscribers",
4
- xwa2_newsletter_view = "xwa2_newsletter_view",
5
- xwa2_newsletter_metadata = "xwa2_newsletter",
6
- xwa2_newsletter_admin_count = "xwa2_newsletter_admin",
7
- xwa2_newsletter_mute_v2 = "xwa2_newsletter_mute_v2",
8
- xwa2_newsletter_unmute_v2 = "xwa2_newsletter_unmute_v2",
9
- xwa2_newsletter_follow = "xwa2_newsletter_follow",
10
- xwa2_newsletter_unfollow = "xwa2_newsletter_unfollow",
11
- xwa2_newsletter_join_v2 = "xwa2_newsletter_join_v2",
12
- xwa2_newsletter_leave_v2 = "xwa2_newsletter_leave_v2",
13
- xwa2_newsletter_change_owner = "xwa2_newsletter_change_owner",
14
- xwa2_newsletter_demote = "xwa2_newsletter_demote",
15
- xwa2_newsletter_delete_v2 = "xwa2_newsletter_delete_v2",
16
- xwa2_fetch_account_reachout_timelock = "xwa2_fetch_account_reachout_timelock",
17
- xwa2_message_capping_info = "xwa2_message_capping_info"
18
- }
19
- export declare enum QueryIds {
20
- CREATE = "8823471724422422",
21
- UPDATE_METADATA = "24250201037901610",
22
- METADATA = "6563316087068696",
23
- SUBSCRIBERS = "9783111038412085",
24
- FOLLOW = "24404358912487870",
25
- UNFOLLOW = "9767147403369991",
26
- MUTE = "29766401636284406",
27
- UNMUTE = "9864994326891137",
28
- ADMIN_COUNT = "7130823597031706",
29
- CHANGE_OWNER = "7341777602580933",
30
- DEMOTE = "6551828931592903",
31
- DELETE = "30062808666639665",
32
- REACHOUT_TIMELOCK = "23983697327930364",
33
- MESSAGE_CAPPING_INFO = "24503548349331633"
34
- }
35
- export type NewsletterUpdate = {
36
- name?: string;
37
- description?: string;
38
- picture?: string;
39
- };
40
- export interface NewsletterCreateResponse {
41
- id: string;
42
- state: {
43
- type: string;
44
- };
45
- thread_metadata: {
46
- creation_time: string;
47
- description: {
48
- id: string;
49
- text: string;
50
- update_time: string;
51
- };
52
- handle: string | null;
53
- invite: string;
54
- name: {
55
- id: string;
56
- text: string;
57
- update_time: string;
58
- };
59
- picture: {
60
- direct_path: string;
61
- id: string;
62
- type: string;
63
- };
64
- preview: {
65
- direct_path: string;
66
- id: string;
67
- type: string;
68
- };
69
- subscribers_count: string;
70
- verification: 'VERIFIED' | 'UNVERIFIED';
71
- };
72
- viewer_metadata: {
73
- mute: 'ON' | 'OFF';
74
- role: NewsletterViewRole;
75
- };
76
- }
77
- export interface NewsletterCreateResponse {
78
- id: string;
79
- state: {
80
- type: string;
81
- };
82
- thread_metadata: {
83
- creation_time: string;
84
- description: {
85
- id: string;
86
- text: string;
87
- update_time: string;
88
- };
89
- handle: string | null;
90
- invite: string;
91
- name: {
92
- id: string;
93
- text: string;
94
- update_time: string;
95
- };
96
- picture: {
97
- direct_path: string;
98
- id: string;
99
- type: string;
100
- };
101
- preview: {
102
- direct_path: string;
103
- id: string;
104
- type: string;
105
- };
106
- subscribers_count: string;
107
- verification: 'VERIFIED' | 'UNVERIFIED';
108
- };
109
- viewer_metadata: {
110
- mute: 'ON' | 'OFF';
111
- role: NewsletterViewRole;
112
- };
113
- }
114
- export type NewsletterViewRole = 'ADMIN' | 'GUEST' | 'OWNER' | 'SUBSCRIBER';
115
- export interface NewsletterMetadata {
116
- id: string;
117
- owner?: string;
118
- name: string;
119
- description?: string;
120
- invite?: string;
121
- creation_time?: number;
122
- subscribers?: number;
123
- picture?: {
124
- url?: string;
125
- directPath?: string;
126
- mediaKey?: string;
127
- id?: string;
128
- };
129
- verification?: 'VERIFIED' | 'UNVERIFIED';
130
- reaction_codes?: {
131
- code: string;
132
- count: number;
133
- }[];
134
- mute_state?: 'ON' | 'OFF';
135
- thread_metadata?: {
136
- creation_time?: number;
137
- name?: string;
138
- description?: string;
139
- };
140
- }
141
- //# sourceMappingURL=Mex.d.ts.map
@@ -1,79 +0,0 @@
1
- import type { WAMediaUpload } from './Message.js';
2
- export type CatalogResult = {
3
- data: {
4
- paging: {
5
- cursors: {
6
- before: string;
7
- after: string;
8
- };
9
- };
10
- data: any[];
11
- };
12
- };
13
- export type ProductCreateResult = {
14
- data: {
15
- product: {};
16
- };
17
- };
18
- export type CatalogStatus = {
19
- status: string;
20
- canAppeal: boolean;
21
- };
22
- export type CatalogCollection = {
23
- id: string;
24
- name: string;
25
- products: Product[];
26
- status: CatalogStatus;
27
- };
28
- export type ProductAvailability = 'in stock';
29
- export type ProductBase = {
30
- name: string;
31
- retailerId?: string;
32
- url?: string;
33
- description: string;
34
- price: number;
35
- currency: string;
36
- isHidden?: boolean;
37
- };
38
- export type ProductCreate = ProductBase & {
39
- /** ISO country code for product origin. Set to undefined for no country */
40
- originCountryCode: string | undefined;
41
- /** images of the product */
42
- images: WAMediaUpload[];
43
- };
44
- export type ProductUpdate = Omit<ProductCreate, 'originCountryCode'>;
45
- export type Product = ProductBase & {
46
- id: string;
47
- imageUrls: {
48
- [_: string]: string;
49
- };
50
- reviewStatus: {
51
- [_: string]: string;
52
- };
53
- availability: ProductAvailability;
54
- };
55
- export type OrderPrice = {
56
- currency: string;
57
- total: number;
58
- };
59
- export type OrderProduct = {
60
- id: string;
61
- imageUrl: string;
62
- name: string;
63
- quantity: number;
64
- currency: string;
65
- price: number;
66
- };
67
- export type OrderDetails = {
68
- price: OrderPrice;
69
- products: OrderProduct[];
70
- };
71
- export type CatalogCursor = string;
72
- export type GetCatalogOptions = {
73
- /** cursor to start from */
74
- cursor?: CatalogCursor;
75
- /** number of products to fetch */
76
- limit?: number;
77
- jid?: string;
78
- };
79
- //# sourceMappingURL=Product.d.ts.map
@@ -1,87 +0,0 @@
1
- import { proto } from '../../WAProto/index.js';
2
- import type { LIDMappingStore } from '../Signal/lid-mapping.js';
3
- type DecryptGroupSignalOpts = {
4
- group: string;
5
- authorJid: string;
6
- msg: Uint8Array;
7
- };
8
- type ProcessSenderKeyDistributionMessageOpts = {
9
- item: proto.Message.ISenderKeyDistributionMessage;
10
- authorJid: string;
11
- };
12
- type DecryptSignalProtoOpts = {
13
- jid: string;
14
- type: 'pkmsg' | 'msg';
15
- ciphertext: Uint8Array;
16
- };
17
- type EncryptMessageOpts = {
18
- jid: string;
19
- data: Uint8Array;
20
- };
21
- type EncryptGroupMessageOpts = {
22
- group: string;
23
- data: Uint8Array;
24
- meId: string;
25
- };
26
- type GetSenderKeyDistributionMessageOpts = {
27
- group: string;
28
- meId: string;
29
- };
30
- type PreKey = {
31
- keyId: number;
32
- publicKey: Uint8Array;
33
- };
34
- type SignedPreKey = PreKey & {
35
- signature: Uint8Array;
36
- };
37
- type E2ESession = {
38
- registrationId: number;
39
- identityKey: Uint8Array;
40
- signedPreKey: SignedPreKey;
41
- preKey?: PreKey;
42
- };
43
- type E2ESessionOpts = {
44
- jid: string;
45
- session: E2ESession;
46
- };
47
- export type SignalRepository = {
48
- decryptGroupMessage(opts: DecryptGroupSignalOpts): Promise<Uint8Array>;
49
- processSenderKeyDistributionMessage(opts: ProcessSenderKeyDistributionMessageOpts): Promise<void>;
50
- decryptMessage(opts: DecryptSignalProtoOpts): Promise<Uint8Array>;
51
- encryptMessage(opts: EncryptMessageOpts): Promise<{
52
- type: 'pkmsg' | 'msg';
53
- ciphertext: Uint8Array;
54
- }>;
55
- encryptGroupMessage(opts: EncryptGroupMessageOpts): Promise<{
56
- senderKeyDistributionMessage: Uint8Array;
57
- ciphertext: Uint8Array;
58
- }>;
59
- getSenderKeyDistributionMessage(opts: GetSenderKeyDistributionMessageOpts): Promise<Uint8Array>;
60
- hasSenderKey(opts: GetSenderKeyDistributionMessageOpts): Promise<boolean>;
61
- getSessionInfo(jid: string): Promise<{
62
- baseKey: Uint8Array;
63
- registrationId: number;
64
- } | null>;
65
- injectE2ESession(opts: E2ESessionOpts): Promise<void>;
66
- validateSession(jid: string): Promise<{
67
- exists: boolean;
68
- reason?: string;
69
- }>;
70
- jidToSignalProtocolAddress(jid: string): string;
71
- migrateSession(fromJid: string, toJid: string): Promise<{
72
- migrated: number;
73
- skipped: number;
74
- total: number;
75
- }>;
76
- validateSession(jid: string): Promise<{
77
- exists: boolean;
78
- reason?: string;
79
- }>;
80
- deleteSession(jids: string[]): Promise<void>;
81
- };
82
- export interface SignalRepositoryWithLIDStore extends SignalRepository {
83
- lidMapping: LIDMappingStore;
84
- close?: () => void;
85
- }
86
- export {};
87
- //# sourceMappingURL=Signal.d.ts.map